blob: 68bd4c08d1d43b1389d88b67c139c00b145cd007 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include "rsp.h"
#include "rsp_lemm.h"
#include "utils.h"
#include <string.h> /* memset() */
#include <stdio.h> /* printf() */
int main(int argc, char *argv[]) {
int rv, end=0;
struct rsp_state rsp;
char ds_si[10], command[16];
rv=rsp_lemm_init(&rsp, ds_si);
if ( rv != 0 ) {
printf("Error rsp_lemm_init() returns %i\n", rv);
return 1;
}
while (!end) {
rsp_query(&rsp, "c"); // Continue
if ( rsp.replied != 1 ) printf("Bug 03\n");
rsp_recv_full(&rsp);
if ( rsp_check_and_clear(&rsp, "S05") != 0 ) printf("Bug 04\n");
snprintf(command, 15, "m%s,0x2d", ds_si);
rsp_query(&rsp, command); // Read a lemming record
if ( rsp_decode(&rsp) != 0x2d * 2 ) {
printf("Bug 07\n");
} else {
printf("%s\n", rsp.decoded);
}
}
rsp_quit(&rsp);
return 0;
}
|