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