EasyVR3_LED_Library
protocol.h@0:8ec860bd579a, 2015-10-22 (annotated)
- Committer:
- Xiaofei
- Date:
- Thu Oct 22 19:35:17 2015 +0000
- Revision:
- 0:8ec860bd579a
EasyVR3_LED
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Xiaofei | 0:8ec860bd579a | 1 | #ifndef PROTOCOL_H |
Xiaofei | 0:8ec860bd579a | 2 | #define PROTOCOL_H |
Xiaofei | 0:8ec860bd579a | 3 | |
Xiaofei | 0:8ec860bd579a | 4 | #define CMD_BREAK 'b' // abort recog or ping |
Xiaofei | 0:8ec860bd579a | 5 | #define CMD_SLEEP 's' // go to power down |
Xiaofei | 0:8ec860bd579a | 6 | #define CMD_KNOB 'k' // set si knob <1> |
Xiaofei | 0:8ec860bd579a | 7 | #define CMD_MIC_DIST 'k' // set microphone (<1>=-1) distance <2> |
Xiaofei | 0:8ec860bd579a | 8 | #define CMD_LEVEL 'v' // set sd level <1> |
Xiaofei | 0:8ec860bd579a | 9 | #define CMD_LANGUAGE 'l' // set si language <1> |
Xiaofei | 0:8ec860bd579a | 10 | #define CMD_TIMEOUT 'o' // set timeout <1> |
Xiaofei | 0:8ec860bd579a | 11 | #define CMD_RECOG_SI 'i' // do si recog from ws <1> |
Xiaofei | 0:8ec860bd579a | 12 | #define CMD_TRAIN_SD 't' // train sd command at group <1> pos <2> |
Xiaofei | 0:8ec860bd579a | 13 | #define CMD_GROUP_SD 'g' // insert new command at group <1> pos <2> |
Xiaofei | 0:8ec860bd579a | 14 | #define CMD_UNGROUP_SD 'u' // remove command at group <1> pos <2> |
Xiaofei | 0:8ec860bd579a | 15 | #define CMD_RECOG_SD 'd' // do sd recog at group <1> (0 = trigger mixed si/sd) |
Xiaofei | 0:8ec860bd579a | 16 | #define CMD_ERASE_SD 'e' // reset command at group <1> pos <2> |
Xiaofei | 0:8ec860bd579a | 17 | #define CMD_NAME_SD 'n' // label command at group <1> pos <2> with length <3> name <4-n> |
Xiaofei | 0:8ec860bd579a | 18 | #define CMD_COUNT_SD 'c' // get command count for group <1> |
Xiaofei | 0:8ec860bd579a | 19 | #define CMD_DUMP_SD 'p' // read command data at group <1> pos <2> |
Xiaofei | 0:8ec860bd579a | 20 | #define CMD_MASK_SD 'm' // get active group mask |
Xiaofei | 0:8ec860bd579a | 21 | #define CMD_RESETALL 'r' // reset all commands and groups |
Xiaofei | 0:8ec860bd579a | 22 | #define CMD_ID 'x' // get version id |
Xiaofei | 0:8ec860bd579a | 23 | #define CMD_DELAY 'y' // set transmit delay <1> (log scale) |
Xiaofei | 0:8ec860bd579a | 24 | #define CMD_BAUDRATE 'a' // set baudrate <1> (bit time, 1=>115200) |
Xiaofei | 0:8ec860bd579a | 25 | #define CMD_QUERY_IO 'q' // configure, read or write I/O pin <1> of type <2> |
Xiaofei | 0:8ec860bd579a | 26 | #define CMD_PLAY_SX 'w' // wave table entry <1-2> (10-bit) playback at volume <3> |
Xiaofei | 0:8ec860bd579a | 27 | #define CMD_PLAY_DTMF 'w' // play (<1>=-1) dial tone <2> for duration <3> |
Xiaofei | 0:8ec860bd579a | 28 | #define CMD_DUMP_SX 'h' // dump wave table entries |
Xiaofei | 0:8ec860bd579a | 29 | #define CMD_DUMP_SI 'z' // dump si settings for ws <1> (or total ws count if -1) |
Xiaofei | 0:8ec860bd579a | 30 | #define CMD_SEND_SN 'j' // send sonicnet token with bits <1> index <2-3> at time <4-5> |
Xiaofei | 0:8ec860bd579a | 31 | #define CMD_RECV_SN 'f' // receive sonicnet token with bits <1> rejection <2> timeout <3-4> |
Xiaofei | 0:8ec860bd579a | 32 | |
Xiaofei | 0:8ec860bd579a | 33 | #define STS_MASK 'k' // mask of active groups <1-8> |
Xiaofei | 0:8ec860bd579a | 34 | #define STS_COUNT 'c' // count of commands <1> (or number of ws <1>) |
Xiaofei | 0:8ec860bd579a | 35 | #define STS_AWAKEN 'w' // back from power down mode |
Xiaofei | 0:8ec860bd579a | 36 | #define STS_DATA 'd' // provide training <1>, conflict <2>, command label <3-35> (counted string) |
Xiaofei | 0:8ec860bd579a | 37 | #define STS_ERROR 'e' // signal error code <1-2> |
Xiaofei | 0:8ec860bd579a | 38 | #define STS_INVALID 'v' // invalid command or argument |
Xiaofei | 0:8ec860bd579a | 39 | #define STS_TIMEOUT 't' // timeout expired |
Xiaofei | 0:8ec860bd579a | 40 | #define STS_INTERR 'i' // back from aborted recognition (see 'break') |
Xiaofei | 0:8ec860bd579a | 41 | #define STS_SUCCESS 'o' // no errors status |
Xiaofei | 0:8ec860bd579a | 42 | #define STS_RESULT 'r' // recognised sd command <1> - training similar to sd <1> |
Xiaofei | 0:8ec860bd579a | 43 | #define STS_SIMILAR 's' // recognised si <1> (in mixed si/sd) - training similar to si <1> |
Xiaofei | 0:8ec860bd579a | 44 | #define STS_OUT_OF_MEM 'm' // no more available commands (see 'group') |
Xiaofei | 0:8ec860bd579a | 45 | #define STS_ID 'x' // provide version id <1> |
Xiaofei | 0:8ec860bd579a | 46 | #define STS_PIN 'p' // return pin state <1> |
Xiaofei | 0:8ec860bd579a | 47 | #define STS_TABLE_SX 'h' // table entries count <1-2> (10-bit), table name <3-35> (counted string) |
Xiaofei | 0:8ec860bd579a | 48 | #define STS_GRAMMAR 'z' // si grammar: flags <1>, word count <2>, labels... <3-35> (n counted strings) |
Xiaofei | 0:8ec860bd579a | 49 | #define STS_TOKEN 'f' // received sonicnet token <1-2> |
Xiaofei | 0:8ec860bd579a | 50 | |
Xiaofei | 0:8ec860bd579a | 51 | // protocol arguments are in the range 0x40 (-1) to 0x60 (+31) inclusive |
Xiaofei | 0:8ec860bd579a | 52 | #define ARG_MIN 0x40 |
Xiaofei | 0:8ec860bd579a | 53 | #define ARG_MAX 0x60 |
Xiaofei | 0:8ec860bd579a | 54 | #define ARG_ZERO 0x41 |
Xiaofei | 0:8ec860bd579a | 55 | |
Xiaofei | 0:8ec860bd579a | 56 | #define ARG_ACK 0x20 // to read more status arguments |
Xiaofei | 0:8ec860bd579a | 57 | |
Xiaofei | 0:8ec860bd579a | 58 | #endif //PROTOCOL_H |
Xiaofei | 0:8ec860bd579a | 59 |