X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid_layer2.c;h=4cad6c3ab3029fbe265a5793487e05fc8222defe;hb=50363eb7c6e10400b8da6e52784467a17986e197;hp=ff6d2b09d215075e2d9345d9c67ba7dedf69e7a1;hpb=fb488a0210b1c694dba762ba086f43a5d4655c4f;p=librfid diff --git a/src/rfid_layer2.c b/src/rfid_layer2.c index ff6d2b0..4cad6c3 100644 --- a/src/rfid_layer2.c +++ b/src/rfid_layer2.c @@ -14,12 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include +#include /* for memcpy */ #include #include @@ -116,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;