roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
nbrData.h File Reference

Init, setter, and getter functions for the nbrData structure. More...

Go to the source code of this file.

Functions

void nbrDataCreate (NbrData *nbrDataPtr, const char *name, uint8 size, uint8 value)
 Create a neighbor data. This is transmitted using the radio each neighbor round. More...
 
void nbrDataCreateIR (NbrData *nbrDataPtr, const char *name, uint8 size, uint8 value)
 Create a IR neighbor data. This is transmitted via IR. The neighbor system makes one 7-bit data by default for the robot ID. Only data that need to share the fate of an IR message should go here. The rest should use radio (See nbrDataCreate()) More...
 
void nbrDataSet (NbrData *nbrDataPtr, uint8 value)
 Set the value of the neighbor data. More...
 
uint8 nbrDataGet (NbrData *nbrDataPtr)
 Get value in a neighbor message. More...
 
uint8 nbrDataGetNbr (NbrData *nbrDataPtr, Nbr *nbrPtr)
 Get value of the local nbrData. More...
 
const char * nbrDataGetName (NbrData *nbrDataPtr)
 Get name of neighbor message. More...
 
uint8 nbrDataGetSize (NbrData *nbrDataPtr)
 Get size of neighbor message. More...
 
void nbrDataPrintNbr (Nbr *nbrPtr)
 Print all the neighbor messages of a given neighbor. More...
 
void nbrDataPrintNbrVerbose (Nbr *nbrPtr)
 Print all the neighbor messages of the given neighbor. Prints in verbose format, with names on separate lines. More...
 
void nbrDataPrintHeaders (void)
 Print the names of all the nbr data in a header suitable for data logging. More...
 
uint8 nbrDataCount (void)
 Get the total number of nbr data that have been created. More...
 

Detailed Description

Init, setter, and getter functions for the nbrData structure.

nbrData is ideal for keeping track of messages sent between robots.

Since
February 12, 2013
Author
James McLurkin

Function Documentation

uint8 nbrDataCount ( void  )

Get the total number of nbr data that have been created.

Returns
the count of nbrData objects
void nbrDataCreate ( NbrData nbrDataPtr,
const char *  name,
uint8  size,
uint8  value 
)

Create a neighbor data. This is transmitted using the radio each neighbor round.

This function is called only once to init each neighbor data

Parameters
nbrDataPtrthe pointer to the neighbor data
namethe name for the type of neighbor data being stored
sizethe size of the neighbor data
valuethe value of the neighbor data
Returns
void
void nbrDataCreateIR ( NbrData nbrDataPtr,
const char *  name,
uint8  size,
uint8  value 
)

Create a IR neighbor data. This is transmitted via IR. The neighbor system makes one 7-bit data by default for the robot ID. Only data that need to share the fate of an IR message should go here. The rest should use radio (See nbrDataCreate())

This function is called only once to init each neighbor data

Parameters
nbrDataPtrthe pointer to the neighbor data
namethe name for the neighbor data
sizethe size of the neighbor data
valuethe value of the neighbor data
Returns
void
uint8 nbrDataGet ( NbrData nbrDataPtr)

Get value in a neighbor message.

Parameters
nbrDataPtrpointer to neighbor message
Returns
if nbrDataPtr is valid, value; else, 0
const char* nbrDataGetName ( NbrData nbrDataPtr)

Get name of neighbor message.

As specified in NbrMsgCreate()

Parameters
nbrDataPtrpointer to neighbor message
Returns
if nbrMsgPtr is valid, name; else, 0
uint8 nbrDataGetNbr ( NbrData nbrDataPtr,
Nbr nbrPtr 
)

Get value of the local nbrData.

Parameters
nbrDataPtrpointer to neighbor message
nbrPtrneighbor pointer
Returns
if nbrPtr and nbrMsgPtr are valid, value; else, 0
uint8 nbrDataGetSize ( NbrData nbrDataPtr)

Get size of neighbor message.

As specified in NbrMsgCreate()

Parameters
nbrDataPtrpointer to neighbor message
Returns
if nbrMsgPtr is valid, size; else, 0
void nbrDataPrintHeaders ( void  )

Print the names of all the nbr data in a header suitable for data logging.

Returns
void
void nbrDataPrintNbr ( Nbr nbrPtr)

Print all the neighbor messages of a given neighbor.

Parameters
nbrPtrneighbor pointer
Returns
void
void nbrDataPrintNbrVerbose ( Nbr nbrPtr)

Print all the neighbor messages of the given neighbor. Prints in verbose format, with names on separate lines.

Parameters
nbrPtrneighbor pointer
Returns
void
void nbrDataSet ( NbrData nbrDataPtr,
uint8  value 
)

Set the value of the neighbor data.

Parameters
nbrDataPtrthe point to the nbrMsgPtr to be set. The size of the pointer must be 8 or smaller.
valuethe value the nbrMsgPtr should be set to
Returns
void