43 #define LNP_HOSTMASK CONF_LNP_HOSTMASK 45 #define LNP_PORTMASK (0x00ff & ~CONF_LNP_HOSTMASK) 48 #if defined(CONF_RCX_PROTOCOL) || defined(CONF_RCX_MESSAGE) 49 #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))
156 lnp_timeout_counter=lnp_timeout=timeout;
171 #endif // __sys_lnp_h__ lnp_integrity_state_t lnp_integrity_state
the integrity layer state
void lnp_timeout_reset(void)
reset the inter-byte timeout counter.
unsigned char lnp_checksum_copy(unsigned char *dest, const unsigned char *data, unsigned length)
the LNP `copy and compute checksum' function.
states when waiting for rcx message opcode
lnp_integrity_state_t
states for the integrity layer state machine
states when waiting for remote buttons args
volatile unsigned short lnp_timeout_counter
the timeout counter in ms
void lnp_integrity_byte(unsigned char b)
receive a byte from the physical layer, decoding integrity layer packets.
void lnp_timeout_set(unsigned short timeout)
set the inter-byte timeout and reset the timeout counter to that value.
unsigned short lnp_timeout
the timeout length in ms
int lnp_integrity_active(void)
return whether a packet is currently being received
void lnp_init(void)
Initialise protocol handlers.
void lnp_integrity_reset(void)
reset the integrity layer on error or timeout.
states when waiting for rcx protocol message