pass HEX AFI in security to json
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 28 Jul 2010 14:18:24 +0000 (16:18 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 28 Jul 2010 14:18:24 +0000 (16:18 +0200)
scripts/RFID-JSONP-server.pl

index 5c47daf..7b0119a 100755 (executable)
@@ -75,7 +75,7 @@ sub http_server {
                                foreach my $tag ( keys %$tags ) {
                                        my $hash = RFID::Serial::Decode::RFID501->to_hash( $tags->{$tag} );
                                        $hash->{sid}  = $tag;
-                                       $hash->{security} = $rfid->read_afi( $tag );
+                                       $hash->{security} = uc unpack 'H*', $rfid->read_afi( $tag );
                                        push @{ $json->{tags} }, $hash;
                                };
                                warn "#### ", encode_json($json);