- switch(cmd[0]) {
- case LEGIC_HSK :snprintf(exp, size, "HANDSHAKE");break;
- case LEGIC_READ :snprintf(exp, size, "READ");break;
- case LEGIC_WRITE :snprintf(exp, size, "WRITE");break;
- default :snprintf(exp,size,"?"); break;
- }
+
+ if ( cmdsize > 1) {
+ switch(cmd[0]) {
+ case LEGIC_READ :snprintf(exp, size, "READ Byte(%d)", cmd[1]);break;
+ case LEGIC_WRITE :snprintf(exp, size, "WRITE Byte(%d)", cmd[1]);break;
+ default :snprintf(exp, size, "?"); break;
+ }
+ } else {
+ switch(cmd[0]) {
+ case LEGIC_HSK :snprintf(exp, size, "END Handshake");break;
+ default :snprintf(exp, size, "?"); break;
+ }
+ }