X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid_layer2.c;h=4cad6c3ab3029fbe265a5793487e05fc8222defe;hb=893a580c6f1c7f1cc50d9bd1acc51c9fd6307a17;hp=bc5a4ec380a0c0a4abab5d30b692dc7a4c699179;hpb=7f510a35e8c64da454d2bce2fb171791057d79e9;p=librfid diff --git a/src/rfid_layer2.c b/src/rfid_layer2.c index bc5a4ec..4cad6c3 100644 --- a/src/rfid_layer2.c +++ b/src/rfid_layer2.c @@ -117,6 +117,15 @@ rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname, { if (optname >> 16 == 0) { switch (optname) { + case RFID_OPT_LAYER2_UID: + printf("----> sizeof(ph->uid): %d\n",sizeof(ph->uid)); + if ((ph->uid_len < sizeof(ph->uid)) && (optlen<=sizeof(ph->uid))) { + //(ph->uid_lenuid_len = optlen; + memcpy(ph->uid, optval, optlen); + } else + return -EINVAL; + break; default: return -EINVAL; break;