43#define LNP_HOSTMASK CONF_LNP_HOSTMASK
46#define LNP_PORTMASK (0x00ff & ~CONF_LNP_HOSTMASK)
48#if defined(CONF_RCX_PROTOCOL) || defined(CONF_RCX_MESSAGE)
50#define LNP_RCX_HEADER_LENGTH (3-1)
53#define LNP_RCX_REMOTE_OP_LENGTH (5-3)
56#define LNP_RCX_MSG_OP_LENGTH (5-3)
66#if defined(CONF_RCX_PROTOCOL) || defined(CONF_RCX_MESSAGE)
75#ifdef CONF_RCX_PROTOCOL
85#ifdef CONF_RCX_MESSAGE
121 const unsigned char *data,
132#ifdef CONF_RCX_COMPILER
133__attribute__ ((rcx_interrupt))
146#ifdef CONF_RCX_COMPILER
147__attribute__ ((rcx_interrupt))
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.
lnp_integrity_state_t
states for the integrity layer state machine
@ LNPwaitRB0
states when waiting for remote buttons args
@ LNPwaitMH3
states when waiting for rcx message opcode
@ LNPwaitRMH1
states when waiting for rcx protocol message
lnp_integrity_state_t lnp_integrity_state
the integrity layer state
unsigned short lnp_timeout
the timeout length in ms
void lnp_timeout_reset(void)
reset the inter-byte timeout counter.
volatile unsigned short lnp_timeout_counter
the timeout counter in ms
unsigned char lnp_checksum_copy(unsigned char *dest, const unsigned char *data, unsigned length)
the LNP ‘copy and compute checksum’ function.
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.
int lnp_integrity_active(void)
return whether a packet is currently being received