summaryrefslogtreecommitdiff
path: root/tuer-rfid/sl018.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-08-17 12:45:13 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-08-17 12:45:13 +0000
commit3ace23e881f35fa78d9195f2c04e08e96a2cfea3 (patch)
tree94a303dada0fa5392fbdd3c9d104614e8b6b033d /tuer-rfid/sl018.c
parentfixed Board definition for teenstep (diff)
whitespace cleanups
git-svn-id: https://svn.spreadspace.org/avr/trunk@218 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'tuer-rfid/sl018.c')
-rw-r--r--tuer-rfid/sl018.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/tuer-rfid/sl018.c b/tuer-rfid/sl018.c
index 9916e36..a94e704 100644
--- a/tuer-rfid/sl018.c
+++ b/tuer-rfid/sl018.c
@@ -184,37 +184,37 @@ uint8_t sl018_cmd(const uint8_t* twi_send_buf)
}
void sl018_read_card_uid(uid_t * uid)
-{
+{
uid->length=0;
uid->buffer=NULL;
- printf( "Info(card): ");
- if(!sl018_cmd(SL018_CMD_ComSelectCard))
- {
- uint8_t uid_len = twi_recv_msg->len - sizeof(twi_recv_msg->command) - sizeof(twi_recv_msg->status) - 1;
- if(uid_len == 255 || uid_len > MAX_UID_LEN) {
- printf(" received UID length (%d) is to big for keystore \n\r", uid_len);
- return;
- }
- uint8_t type = twi_recv_msg->data[uid_len];
- uint8_t expected_uid_len = SL018_tagtype_to_uidlen(type);
- if(expected_uid_len != uid_len) {
- printf(" Invalid uid length (%d) for tag type: %s\n\r", uid_len, SL018_tagtype_tostring(type));
- return;
- }
-
- for (uint8_t pos=0; pos<uid_len; pos++)
- printf("%02X",twi_recv_msg->data[uid_len-pos-1]);
- printf( ", %s\n\r", SL018_tagtype_tostring(type));
-
- if (0 < type && type < 7) {
+ printf( "Info(card): ");
+ if(!sl018_cmd(SL018_CMD_ComSelectCard))
+ {
+ uint8_t uid_len = twi_recv_msg->len - sizeof(twi_recv_msg->command) - sizeof(twi_recv_msg->status) - 1;
+ if(uid_len == 255 || uid_len > MAX_UID_LEN) {
+ printf(" received UID length (%d) is to big for keystore \n\r", uid_len);
+ return;
+ }
+ uint8_t type = twi_recv_msg->data[uid_len];
+ uint8_t expected_uid_len = SL018_tagtype_to_uidlen(type);
+ if(expected_uid_len != uid_len) {
+ printf(" Invalid uid length (%d) for tag type: %s\n\r", uid_len, SL018_tagtype_tostring(type));
+ return;
+ }
+
+ for (uint8_t pos=0; pos<uid_len; pos++)
+ printf("%02X",twi_recv_msg->data[uid_len-pos-1]);
+ printf( ", %s\n\r", SL018_tagtype_tostring(type));
+
+ if (0 < type && type < 7) {
uid->length= uid_len;
- uid->buffer=twi_recv_msg->data;
- } else {
- printf("Info(card): Ignoring unknown card type %02x\n\r",type);
- }
- }
-}
-
+ uid->buffer=twi_recv_msg->data;
+ } else {
+ printf("Info(card): Ignoring unknown card type %02x\n\r",type);
+ }
+ }
+}
+
void sl018_set_led(uint8_t on)
{
if(on)