diff --git a/examples/pn53x-tamashell.1 b/examples/pn53x-tamashell.1 index 328b1e7..3607e05 100644 --- a/examples/pn53x-tamashell.1 +++ b/examples/pn53x-tamashell.1 @@ -15,6 +15,14 @@ TAMA commands and responses prefixes (0xD4/0xD5), CRC and any framing above are You can use the shell interactively (with readline support) or you can write your own script file consisting in commands and comments (anything that starts with ";", "#" or "//"). +Spaces are ignored and can be used for readability. + +Shebang is supported, simply start your script with: + #!/usr/bin/env \fBpn53x-tamashell\fP + +.SH COMMANDS + +\fIp N\fP to introduce a pause of N seconds. \fIq\fP or \fICtrl-d\fP to quit. @@ -35,7 +43,7 @@ GetFirmware command is D4 02, so one has just to send the command "02": Same thing, with a script: - $ cat << EOF | \fBpn53x-tamashell\fP + $ \fBpn53x-tamashell\fP << EOF // This is a comment 02 // GetFirmware 40 // Command with missing arguments diff --git a/examples/pn53x-tamashell.c b/examples/pn53x-tamashell.c index 3d76fe8..ef89ee5 100644 --- a/examples/pn53x-tamashell.c +++ b/examples/pn53x-tamashell.c @@ -126,6 +126,20 @@ int main(int argc, const char* argv[]) free(cmd); break; } + if (cmd[0]=='p') { + int s=0; + offset++; + while (isspace(cmd[offset])) { + offset++; + } + sscanf(cmd+offset, "%u", &s); + printf("Pause for %i secs\n", s); + if (s>0) { + sleep(s); + } + free(cmd); + continue; + } szTx = 0; for(int i = 0; i