DMCP interface 03.18_025
Loading...
Searching...
No Matches
Serial Console Protocol

Serial Console Protocol.

Serial Console Protocol.

Serial link

Serial link uses a multiplexed stream consisting of several channels for both input and output. Data belonging to a particular channel are prefixed with a <channel_id> character and are demultiplexed into corresponding channels after the reception.

There are 11 supported Channel IDs:
Channel0 = '\x10', Channel1 = '\x11', .. , Channel10 = '\x1a'

Currently, only 4 input channels are supported (see USIN_CHAN_CNT) - which technically means four input buffers are allocated for channels 0-3 and data for other channels are ignored by demultiplexer.

Usage of INPUT channels:

0 - KEY input
1 - (reserved by system)
2 -  
3 -  

Usage of OUTPUT channels:

0 - sys output (e.g. LCD/calc key pressed)
1 - printf
2 - 
3 - 

Line processing

Data (input characters) in each channel are (for a convenience) separated to "lines". And only full line can be read from a channel. Channel can be checked for available "line" using SERIO_LINE_READY ioctl call.

Line is a sequence of characters ending with '\n' (US_LINEEND_CHAR). Note that several characters are reserved — i.e. cannot be used in user messages (e.g. channel identifiers) — or have special meaning (e.g. '\n' denotes line end).

Buffer overflow

Attempt to store character to last available place in FIFO leads to storing US_OVERFLOW_CHAR instead. That marks end of line and further characters are ignored:

Then the ordinary line read and decoding is resumed.

Special characters

+--------+-----------------+----------------------+
| Code   |  Meaning        |   Note               |
+--------+-----------------+----------------------+
| 00-06  |                 | (not  used)          |
| 07     | '\a'            |                      |
| 08     | '\b'            |                      |
| 09     | '\t'            |                      |
| 0a     | '\n'            | (line end)           |
| 0b     | '\v'            |                      |
| 0c     | '\f'            |                      |
| 0d     | '\r'            |                      |
| 0e     |                 | (not used)           |
| 0f     |  Overflow flag  | (reserved by system) |
| 10-1a  |  chan0..chan10  | (reserved by system) |
| 1b     | '\e'            |                      |
| 1c-1f  |                 | (not used)           |
+--------+-----------------+----------------------+