Update of /cvsroot/playerstage/code/player/server/drivers/shell
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29042
Modified Files:
readlog.cc writelog.cc
Log Message:
applied patch 1776227
Index: writelog.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/shell/writelog.cc,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** writelog.cc 18 Oct 2007 21:31:20 -0000 1.85
--- writelog.cc 18 Oct 2007 21:34:37 -0000 1.86
***************
*** 1878,1881 ****
--- 1878,1882 ----
- tags_count (int): the numer of tags found
- list of tags; for each tag:
+ - type (int): type of the tag
- guid (string): tag guid in hex
***************
*** 1898,1902 ****
}
! fprintf(file, "%04d ", rdata->tags_count);
for (player_rfid_tag_t *t(rdata->tags);
--- 1899,1903 ----
}
! fprintf(file, "%04lu ", (long)rdata->tags_count);
for (player_rfid_tag_t *t(rdata->tags);
***************
*** 1909,1913 ****
memset(str, '\0', sizeof(str));
EncodeHex(str, sizeof(str), t->guid, t->guid_count);
! fprintf(file, "%s ", str);
}
--- 1910,1914 ----
memset(str, '\0', sizeof(str));
EncodeHex(str, sizeof(str), t->guid, t->guid_count);
! fprintf(file, "%04lu %s ", (long)t->type, str);
}
Index: readlog.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/shell/readlog.cc,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** readlog.cc 18 Oct 2007 21:31:20 -0000 1.54
--- readlog.cc 18 Oct 2007 21:34:37 -0000 1.55
***************
*** 2513,2516 ****
--- 2513,2530 ----
////////////////////////////////////////////////////////////////////////////
// Parse RFID data
+ /*
+ The format changed so the rfid "type" will be saved.
+ To convert the old log files to the new format use this awk filter:
+
+ awk '/rfid/ {
+ split($0, a);
+ for (i=1; i<=length(a); i++)
+ printf(i < 9 ? "%s " : "0001 %s ", a[i]);
+ printf("\n")
+ }
+ !/rfid/ {
+ print $0
+ }'
+ */
int ReadLog::ParseRFID(player_devaddr_t id, unsigned short type,
unsigned short subtype, int linenum, int token_count,
***************
*** 2529,2535 ****
}
! rdata.tags_count = atoi(tokens[7]);
! if (token_count - 8 != static_cast<int>(rdata.tags_count)) {
PLAYER_ERROR2("invalid line at %s:%d: number of tokens does not
"
"match count", this->filename, linenum);
--- 2543,2549 ----
}
! rdata.tags_count = strtoul(tokens[7], NULL, 10);
! if (token_count - 8 != 2 * static_cast<int>(rdata.tags_count)) {
PLAYER_ERROR2("invalid line at %s:%d: number of tokens does not
"
"match count", this->filename, linenum);
***************
*** 2546,2549 ****
--- 2560,2565 ----
for (player_rfid_tag_t *r(rdata.tags);
r != rdata.tags + rdata.tags_count; ++r, ++t) {
+ r->type = strtoul(*t, NULL, 10);
+ ++t;
r->guid_count = strlen(*t) / 2;
DecodeHex(r->guid, PLAYER_RFID_MAX_GUID, *t, strlen(*t));
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit