Interface API

group Interface



csp_new_packet is deprecated, use csp_qfifo_write


void csp_qfifo_write(csp_packet_t *packet, csp_iface_t *interface, CSP_BASE_TYPE *pxTaskWoken)

Inputs a new packet into the system This function is called from interface drivers ISR to route and accept packets.

But it can also be called from a task, provided that the pxTaskWoken parameter is NULL!

EXTREMELY IMPORTANT: pxTaskWoken arg must ALWAYS be NULL if called from task, and ALWAYS be NON NULL if called from ISR! If this condition is met, this call is completely thread-safe

This function is fire and forget, it returns void, meaning that a packet will always be either accepted or dropped so the memory will always be freed.

  • packet: A pointer to the incoming packet
  • interface: A pointer to the incoming interface TX function.
  • pxTaskWoken: This must be a pointer a valid variable if called from ISR or NULL otherwise!

uint8_t csp_route_get_mac(uint8_t node)

Get MAC layer address of next hop.

MAC layer address
  • node: Next hop node

void csp_iflist_add(csp_iface_t *ifc)

Register your interface in the router core using this function.

This must be done in the interface init() function.