FreeCalypso > hg > freecalypso-sw
comparison rvinterf/lowlevel/clientcmd.c @ 870:2682003dcba7
rvinterf: client programs can now register to receive AT and EXTUI packets
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Fri, 29 May 2015 06:16:02 +0000 |
parents | cb833ff54d88 |
children | a5c8f48003cd |
comparison
equal
deleted
inserted
replaced
869:4cf69e1c784c | 870:2682003dcba7 |
---|---|
16 void | 16 void |
17 process_msg_from_client(cli) | 17 process_msg_from_client(cli) |
18 struct client *cli; | 18 struct client *cli; |
19 { | 19 { |
20 int c; | 20 int c; |
21 char logmsg[128]; | |
22 | 21 |
23 switch (cli->rx_buf[0]) { | 22 switch (cli->rx_buf[0]) { |
24 case CLI2RVI_WANT_RVTRACE: | 23 case CLI2RVI_WANT_RVTRACE: |
25 if (cli->rx_msglen != 9) { | 24 if (cli->rx_msglen != 9) { |
26 send_local_msg_to_client(cli, "-Bad command length"); | 25 send_local_msg_to_client(cli, "-Bad command length"); |
36 cli->rx_buf[2] << 16 | | 35 cli->rx_buf[2] << 16 | |
37 cli->rx_buf[3] << 8 | cli->rx_buf[4]; | 36 cli->rx_buf[3] << 8 | cli->rx_buf[4]; |
38 cli->int_rvt_match[c] = cli->rx_buf[5] << 24 | | 37 cli->int_rvt_match[c] = cli->rx_buf[5] << 24 | |
39 cli->rx_buf[6] << 16 | | 38 cli->rx_buf[6] << 16 | |
40 cli->rx_buf[7] << 8 | cli->rx_buf[8]; | 39 cli->rx_buf[7] << 8 | cli->rx_buf[8]; |
41 #if 0 | |
42 sprintf(logmsg, | |
43 "*** Client program interested in RVT mask %08X match %08X", | |
44 cli->int_rvt_mask[c], cli->int_rvt_match[c]); | |
45 output_line(logmsg); | |
46 #endif | |
47 cli->int_rvt_count++; | 40 cli->int_rvt_count++; |
48 send_local_msg_to_client(cli, "+OK"); | 41 send_local_msg_to_client(cli, "+OK"); |
49 return; | 42 return; |
50 case CLI2RVI_WANT_MUXPROTO: | 43 case CLI2RVI_WANT_MUXPROTO: |
51 if (cli->rx_msglen != 2) { | 44 if (cli->rx_msglen != 2) { |
52 send_local_msg_to_client(cli, "-Bad command length"); | 45 send_local_msg_to_client(cli, "-Bad command length"); |
53 return; | 46 return; |
54 } | 47 } |
55 if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x18) { | 48 if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x1B) { |
56 send_local_msg_to_client(cli, | 49 send_local_msg_to_client(cli, |
57 "-Unsupported protocol MUX value"); | 50 "-Unsupported protocol MUX value"); |
58 return; | 51 return; |
59 } | 52 } |
60 #if 0 | |
61 sprintf(logmsg, | |
62 "*** Client program interested in MUX proto %02X", | |
63 cli->rx_buf[1]); | |
64 output_line(logmsg); | |
65 #endif | |
66 cli->int_proto[cli->rx_buf[1] - 0x12] = 1; | 53 cli->int_proto[cli->rx_buf[1] - 0x12] = 1; |
67 send_local_msg_to_client(cli, "+OK"); | 54 send_local_msg_to_client(cli, "+OK"); |
68 return; | 55 return; |
69 case CLI2RVI_RESET_PACKET_RX: | 56 case CLI2RVI_RESET_PACKET_RX: |
70 cli->int_rvt_count = 0; | 57 cli->int_rvt_count = 0; |