Internal LNP Interface: link networking protocol.
More...
Go to the source code of this file.
|
| enum | lnp_integrity_state_t {
LNPwaitHeader
, LNPwaitLength
, LNPwaitData
, LNPwaitCRC
,
LNPwaitRMH1
, LNPwaitRMH2
, LNPwaitRMH3
, LNPwaitRMH4
,
LNPwaitRB0
, LNPwaitRB0I
, LNPwaitRB1
, LNPwaitRB1I
,
LNPwaitRC
, LNPwaitRCI
, LNPwaitMH3
, LNPwaitMH4
,
LNPwaitMN
, LNPwaitMNC
, LNPwaitMC
, LNPwaitMCC
} |
| | states for the integrity layer state machine More...
|
| |
|
| unsigned char | lnp_checksum_copy (unsigned char *dest, const unsigned char *data, unsigned length) |
| | the LNP ‘copy and compute checksum’ function.
|
| |
| void | lnp_integrity_byte (unsigned char b) |
| | receive a byte from the physical layer, decoding integrity layer packets.
|
| |
| void | lnp_integrity_reset (void) |
| | reset the integrity layer on error or timeout.
|
| |
| int | lnp_integrity_active (void) |
| | return whether a packet is currently being received
|
| |
| void | lnp_timeout_reset (void) |
| | reset the inter-byte timeout counter.
|
| |
| void | lnp_timeout_set (unsigned short timeout) |
| | set the inter-byte timeout and reset the timeout counter to that value.
|
| |
| void | lnp_init (void) |
| | Initialise protocol handlers.
|
| |
Internal LNP Interface: link networking protocol.
- Author
- Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de
Definition in file lnp.h.
◆ LNP_HOSTMASK
◆ LNP_PORTMASK
LNP port mask is derived from host mask.
Definition at line 46 of file lnp.h.
◆ LNP_RCX_HEADER_LENGTH
| #define LNP_RCX_HEADER_LENGTH (3-1) |
length of header from remote/rcx, -1 because first byte is used to id sequence
Definition at line 50 of file lnp.h.
◆ LNP_RCX_MSG_OP_LENGTH
| #define LNP_RCX_MSG_OP_LENGTH (5-3) |
length of rcx message op, -3 because first 3 bytes is used to id sequence
Definition at line 56 of file lnp.h.
◆ LNP_RCX_REMOTE_OP_LENGTH
| #define LNP_RCX_REMOTE_OP_LENGTH (5-3) |
length of remote button op, -3 because first 3 bytes is used to id sequence
Definition at line 53 of file lnp.h.
◆ lnp_integrity_state_t
states for the integrity layer state machine
| Enumerator |
|---|
| LNPwaitHeader | |
| LNPwaitLength | |
| LNPwaitData | |
| LNPwaitCRC | |
| LNPwaitRMH1 | states when waiting for rcx protocol message
|
| LNPwaitRMH2 | |
| LNPwaitRMH3 | |
| LNPwaitRMH4 | |
| LNPwaitRB0 | states when waiting for remote buttons args
|
| LNPwaitRB0I | |
| LNPwaitRB1 | |
| LNPwaitRB1I | |
| LNPwaitRC | |
| LNPwaitRCI | |
| LNPwaitMH3 | states when waiting for rcx message opcode
|
| LNPwaitMH4 | |
| LNPwaitMN | |
| LNPwaitMNC | |
| LNPwaitMC | |
| LNPwaitMCC | |
Definition at line 60 of file lnp.h.
◆ lnp_checksum_copy()
| unsigned char lnp_checksum_copy |
( |
unsigned char * |
dest, |
|
|
const unsigned char * |
data, |
|
|
unsigned |
length |
|
) |
| |
|
extern |
the LNP ‘copy and compute checksum’ function.
◆ lnp_init()
Initialise protocol handlers.
Adressing port 0 is reserved for the program handler. DLL transfers programs to this port.
◆ lnp_integrity_active()
| int lnp_integrity_active |
( |
void |
| ) |
|
|
externinline |
◆ lnp_integrity_byte()
| void lnp_integrity_byte |
( |
unsigned char |
b | ) |
|
|
extern |
receive a byte from the physical layer, decoding integrity layer packets.
- Parameters
-
◆ lnp_integrity_reset()
| void lnp_integrity_reset |
( |
void |
| ) |
|
|
extern |
reset the integrity layer on error or timeout.
◆ lnp_timeout_reset()
| void lnp_timeout_reset |
( |
void |
| ) |
|
|
extern |
reset the inter-byte timeout counter.
◆ lnp_timeout_set()
| void lnp_timeout_set |
( |
unsigned short |
timeout | ) |
|
|
externinline |
set the inter-byte timeout and reset the timeout counter to that value.
- Parameters
-
| timeout | the new timeout value |
Definition at line 155 of file lnp.h.
References lnp_timeout, and lnp_timeout_counter.
◆ lnp_integrity_state
◆ lnp_timeout
| unsigned short lnp_timeout |
|
extern |
◆ lnp_timeout_counter
| volatile unsigned short lnp_timeout_counter |
|
extern |