![]() |
roneos
Operating System for the r-one robot
|
Controls radio commands sent between robots. More...
Go to the source code of this file.
Data Structures | |
struct | RadioCmd |
A radio command is a linked list of the radio commands received. More... | |
Typedefs | |
typedef struct RadioCmd | RadioCmd |
A radio command is a linked list of the radio commands received. | |
Functions | |
void | radioCommandInit (void) |
Initializes radio command processing. More... | |
void | radioCommandAddCallback (RadioCmd *radioCmdPtr, const char *name, void(*funcPtr)(RadioCmd *radioCmdPtr, RadioMessage *message)) |
Creates radio command that will call function. More... | |
void | radioCommandAddQueue (RadioCmd *radioCmdPtr, const char *name, uint8 messageQueueSize) |
Create radio command that uses a queue of specified size. More... | |
void | radioCommandAdd (RadioCmd *radioCmdPtr, const char *name, void(*funcPtr)(RadioCmd *radioCmdPtr, RadioMessage *message), uint8 messageQueueSize, void *externalDataPtr) |
Creates a radio command that can call a function or a queue. More... | |
boolean | radioCommandReceive (RadioCmd *radioCmdPtr, RadioMessage *messagePtr, uint32 maxDelay) |
Receives specific radio commands. More... | |
boolean | radioCommandReceiveNonBlocking (RadioCmd *radioCmdPtr, RadioMessage *messagePtr) |
Receives specific radio commands. More... | |
void | radioCommandXmit (RadioCmd *radioCmdPtr, uint8 destinationID, RadioMessage *message) |
Sends a radio message to the specified ID if RC mode is off. More... | |
boolean | radioCommandTimeout (RadioCmd *radioCmdPtr, uint32 timeout) |
Check if time since last time stamp has exceeded timeout. More... | |
uint8 | radioCommandGetType (RadioMessage *messagePtr) |
Get radio command type. More... | |
uint8 | radioCommandGetSubnet (RadioMessage *messagePtr) |
Get radio command subnet. More... | |
void | radioCommandSetSubnet (uint8 subnet) |
Sets the radio command subnet. More... | |
char * | radioCommandGetDataPtr (RadioMessage *messagePtr) |
Get radio command data pointer. More... | |
Controls radio commands sent between robots.
void radioCommandAdd | ( | RadioCmd * | radioCmdPtr, |
const char * | name, | ||
void(*)(RadioCmd *radioCmdPtr, RadioMessage *message) | funcPtr, | ||
uint8 | messageQueueSize, | ||
void * | externalDataPtr | ||
) |
Creates a radio command that can call a function or a queue.
radioCmdPtr | is pointer to specific radio command group to be sent |
name | is the name of the command |
funcPtr | points to function that radio message will be sent to |
messageQueueSize | is maximum size of queue - the number of messages that it can hold, not the size of the message. The radio message size is RADIO_COMMAND_MESSAGE_DATA_LENGTH, currently |
externalDataPtr | is a void* that can be set to whatever structure the user needs access to during the callback. |
void radioCommandAddCallback | ( | RadioCmd * | radioCmdPtr, |
const char * | name, | ||
void(*)(RadioCmd *radioCmdPtr, RadioMessage *message) | funcPtr | ||
) |
Creates radio command that will call function.
radioCmdPtr | is pointer to specific radio command group to be sent |
name | is the name of the command |
funcPtr | points to function that radio message will be sent to |
void radioCommandAddQueue | ( | RadioCmd * | radioCmdPtr, |
const char * | name, | ||
uint8 | messageQueueSize | ||
) |
Create radio command that uses a queue of specified size.
radioCmdPtr | is pointer to specific radio command |
name | is the name of the command |
messageQueueSize | is maximum size of queue - the number of messages that it can hold, not the size of the message. The radio message size is RADIO_COMMAND_MESSAGE_DATA_LENGTH, currently |
char* radioCommandGetDataPtr | ( | RadioMessage * | messagePtr) |
Get radio command data pointer.
messagePtr | is the message to examine |
uint8 radioCommandGetSubnet | ( | RadioMessage * | messagePtr) |
Get radio command subnet.
messagePtr | is the message to examine |
uint8 radioCommandGetType | ( | RadioMessage * | messagePtr) |
Get radio command type.
messagePtr | is the message to examine |
void radioCommandInit | ( | void | ) |
Initializes radio command processing.
boolean radioCommandReceive | ( | RadioCmd * | radioCmdPtr, |
RadioMessage * | messagePtr, | ||
uint32 | maxDelay | ||
) |
Receives specific radio commands.
radioCmdPtr | The command group of radio messages that will go into messagePtr |
messagePtr | Will contain the next message for the given radio command group |
maxDelay | The maximum time the call will take before returning. If 0, will not block (call radioCommandReceiveNonBlocking() instead).. |
boolean radioCommandReceiveNonBlocking | ( | RadioCmd * | radioCmdPtr, |
RadioMessage * | messagePtr | ||
) |
Receives specific radio commands.
radioCmdPtr | The command group of radio messages that will go into messagePtr |
messagePtr | Will contain the next message for the given radio command group |
void radioCommandSetSubnet | ( | uint8 | subnet) |
Sets the radio command subnet.
subnet | is the subnet to join. Range is from 0-3. |
boolean radioCommandTimeout | ( | RadioCmd * | radioCmdPtr, |
uint32 | timeout | ||
) |
Check if time since last time stamp has exceeded timeout.
radioCmdPtr | The command group of the radio message to be sent |
timeout | is the amount of time in milliseconds before the function returns |
void radioCommandXmit | ( | RadioCmd * | radioCmdPtr, |
uint8 | destinationID, | ||
RadioMessage * | message | ||
) |
Sends a radio message to the specified ID if RC mode is off.
radioCmdPtr | The command group of the radio message to be sent |
destinationID | Which robots the message is being sent to. 0xFF (ROBOT_ID_ALL) sends to all robots |
message | the message to be sent |