OpenWSN Firmware
OpenQueue

The component which managing the buffer of packet. More...

Data Structures

struct  debugOpenQueueEntry_t
 
struct  openqueue_vars_t
 

Macros

#define QUEUELENGTH   10
 

Functions

void openqueue_init (void)
 Initialize this module. More...
 
bool debugPrint_queue (void)
 Trigger this module to print status information, over serial. More...
 
OpenQueueEntry_topenqueue_getFreePacketBuffer (uint8_t creator)
 Request a new (free) packet buffer. More...
 
owerror_t openqueue_freePacketBuffer (OpenQueueEntry_t *pkt)
 Free a previously-allocated packet buffer. More...
 
void openqueue_removeAllCreatedBy (uint8_t creator)
 Free all the packet buffers created by a specific module. More...
 
void openqueue_removeAllOwnedBy (uint8_t owner)
 Free all the packet buffers owned by a specific module. More...
 
OpenQueueEntry_topenqueue_sixtopGetSentPacket (void)
 
OpenQueueEntry_topenqueue_sixtopGetReceivedPacket (void)
 
OpenQueueEntry_topenqueue_macGetDataPacket (open_addr_t *toNeighbor)
 
OpenQueueEntry_topenqueue_macGetAdvPacket (void)
 

Detailed Description

The component which managing the buffer of packet.

Author
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, August 2010

Macro Definition Documentation

#define QUEUELENGTH   10

Function Documentation

bool debugPrint_queue ( void  )

Trigger this module to print status information, over serial.

debugPrint_* functions are used by the openserial module to continuously print status information about several modules in the OpenWSN stack.

Returns
TRUE if this function printed something, FALSE otherwise.
owerror_t openqueue_freePacketBuffer ( OpenQueueEntry_t pkt)

Free a previously-allocated packet buffer.

Parameters
pktA pointer to the previsouly-allocated packet buffer.
Returns
E_SUCCESS when the freeing was succeful.
E_FAIL when the module could not find the specified packet buffer.
OpenQueueEntry_t* openqueue_getFreePacketBuffer ( uint8_t  creator)

Request a new (free) packet buffer.

Component throughout the protocol stack can call this function is they want to get a new packet buffer to start creating a new packet.

Note
Once a packet has been allocated, it is up to the creator of the packet to free it using the openqueue_freePacketBuffer() function.
Returns
A pointer to the queue entry when it could be allocated, or NULL when it could not be allocated (buffer full or not synchronized).
void openqueue_init ( void  )

Initialize this module.

OpenQueueEntry_t* openqueue_macGetAdvPacket ( void  )
OpenQueueEntry_t* openqueue_macGetDataPacket ( open_addr_t toNeighbor)
void openqueue_removeAllCreatedBy ( uint8_t  creator)

Free all the packet buffers created by a specific module.

Parameters
creatorThe identifier of the component, taken in COMPONENT_*.
void openqueue_removeAllOwnedBy ( uint8_t  owner)

Free all the packet buffers owned by a specific module.

Parameters
ownerThe identifier of the component, taken in COMPONENT_*.
OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket ( void  )
OpenQueueEntry_t* openqueue_sixtopGetSentPacket ( void  )