Go to the source code of this file.
Macros | |
#define | ENABLE_FILTER_DUPLICATE_PACKETS 1 |
#define | ENABLE_FILTER_DUPLICATE_PACKETS_MATCH_ALL_CHARACTERS 0 |
#define | MAX_REQUEST_PERIOD_MS 100000 |
#define | MIN_REQUEST_PERIOD_MS 1 |
#define | MSG_PERIOD_DISABLED 0 |
#define | MSG_PERIOD_SEND_ONCE -1 |
#define | PARSE_DOUBLE(str) strtod(str, 0) |
#define | PARSE_FLOAT(str) strtof(str, 0) |
Functions | |
int | asciiMessageCompare (const void *elem1, const void *elem2) |
void | comManagerAssignUserPointer (CMHANDLE cmInstance, void *userPointer) |
void | comManagerDisableBroadcasts (int pHandle) |
void | comManagerDisableBroadcastsInstance (CMHANDLE cmInstance_, int pHandle) |
int | comManagerDisableData (int pHandle, uint32_t dataId) |
int | comManagerDisableDataInstance (CMHANDLE cmInstance, int pHandle, uint32_t dataId) |
void | comManagerGetData (int pHandle, uint32_t dataId, int offset, int size, int periodMultiple) |
Request data This function requests the specified data w/ offset and length for partial reads. More... | |
void | comManagerGetDataInstance (CMHANDLE cmInstance, int pHandle, uint32_t dataId, int offset, int size, int periodMultiple) |
int | comManagerGetDataRequest (int pHandle, p_data_get_t *req) |
int | comManagerGetDataRequestInstance (CMHANDLE _cmInstance, int pHandle, p_data_get_t *req) |
void | comManagerGetDataRmc (int pHandle, uint64_t rmcBits, uint32_t rmcOptions) |
void | comManagerGetDataRmcInstance (CMHANDLE cmInstance, int pHandle, uint64_t rmcBits, uint32_t rmcOptions) |
CMHANDLE | comManagerGetGlobal (void) |
bufTxRxPtr_t * | comManagerGetRegisteredDataInfo (uint32_t dataId) |
bufTxRxPtr_t * | comManagerGetRegisteredDataInfoInstance (CMHANDLE _cmInstance, uint32_t dataId) |
com_manager_status_t * | comManagerGetStatus (int pHandle) |
com_manager_status_t * | comManagerGetStatusInstance (CMHANDLE cmInstance, int pHandle) |
void * | comManagerGetUserPointer (CMHANDLE cmInstance) |
int | comManagerInit (int numHandles, int maxEnsuredPackets, int stepPeriodMilliseconds, int retryCount, pfnComManagerRead readFnc, pfnComManagerSend sendFnc, pfnComManagerSendBufferAvailableBytes txFreeFnc, pfnComManagerPostRead pstRxFnc, pfnComManagerPostAck pstAckFnc, pfnComManagerDisableBroadcasts disableBcastFnc, com_manager_init_t *buffers, com_manager_port_t *cmPorts) |
int | comManagerInitInstance (CMHANDLE cmHandle, int numHandles, int maxEnsuredPackets, int stepPeriodMilliseconds, int retryCount, pfnComManagerRead readFnc, pfnComManagerSend sendFnc, pfnComManagerSendBufferAvailableBytes txFreeFnc, pfnComManagerPostRead pstRxFnc, pfnComManagerPostAck pstAckFnc, pfnComManagerDisableBroadcasts disableBcastFnc, com_manager_init_t *buffers, com_manager_port_t *cmPorts) |
void | comManagerRegister (uint32_t dataId, pfnComManagerPreSend txFnc, pfnComManagerPostRead pstRxFnc, const void *txDataPtr, void *rxDataPtr, int dataSize, uint8_t pktFlags) |
void | comManagerRegisterInstance (CMHANDLE cmInstance_, uint32_t dataId, pfnComManagerPreSend txFnc, pfnComManagerPostRead pstRxFnc, const void *txDataPtr, void *rxDataPtr, int dataSize, uint8_t pktFlags) |
int | comManagerSend (int pHandle, uint8_t pktInfo, bufPtr_t *bodyHdr, bufPtr_t *txData, uint8_t pFlags) |
int | comManagerSendData (int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
int | comManagerSendDataInstance (CMHANDLE cmInstance, int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
int | comManagerSendDataNoAck (int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
int | comManagerSendDataNoAckInstance (CMHANDLE cmInstance, int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
int | comManagerSendEnsured (int pHandle, uint8_t pktInfo, unsigned char *data, unsigned int dataSize) |
int | comManagerSendEnsuredInstance (CMHANDLE cmInstance, int pHandle, uint8_t pktInfo, unsigned char *data, unsigned int dataSize) |
int | comManagerSendInstance (CMHANDLE cmInstance, int pHandle, uint8_t pktInfo, bufPtr_t *bodyHdr, bufPtr_t *txData, uint8_t pktFlags) |
int | comManagerSendRawData (int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
int | comManagerSendRawDataInstance (CMHANDLE cmInstance, int pHandle, uint32_t dataId, void *dataPtr, int dataSize, int dataOffset) |
void | comManagerSetCallbacks (pfnComManagerAsapMsg handlerRmc, pfnComManagerGenMsgHandler handlerAscii, pfnComManagerGenMsgHandler handlerUblox, pfnComManagerGenMsgHandler handlerRtcm3) |
void | comManagerSetCallbacksInstance (CMHANDLE cmInstance, pfnComManagerAsapMsg handlerRmc, pfnComManagerGenMsgHandler handlerAscii, pfnComManagerGenMsgHandler handlerUblox, pfnComManagerGenMsgHandler handlerRtcm3) |
void | comManagerStep (void) |
void | comManagerStepInstance (CMHANDLE cmInstance_) |
void | comManagerStepRxInstance (CMHANDLE cmInstance_) |
void | comManagerStepTxInstance (CMHANDLE cmInstance_) |
int | comManagerValidateBaudRate (unsigned int baudRate) |
void | disableBroadcastMsg (com_manager_t *cmInstance, broadcast_msg_t *msg) |
void | disableDidBroadcast (com_manager_t *cmInstance, int pHandle, p_data_disable_t *disable) |
void | enableBroadcastMsg (com_manager_t *cmInstance, broadcast_msg_t *msg, int periodMultiple) |
int | encodeBinaryPacket (com_manager_t *cmInstance, int pHandle, buffer_t *pkt, packet_t *dPkt, uint8_t additionalPktFlags) |
Adds data to a packet: adds start, info, data length, data, checksum, and stop bytes. All data is communicated in the endianess of the sender, each packet has a bit that determines big or little endian. Process for Creating Tx Packet: 1.) Add to packet. More... | |
int | findAsciiMessage (const void *a, const void *b) |
int | initComManagerInstanceInternal (com_manager_t *cmInstance, int numHandles, int maxEnsuredPackets, int stepPeriodMilliseconds, int retryCount, pfnComManagerRead readFnc, pfnComManagerSend sendFnc, pfnComManagerSendBufferAvailableBytes txFreeFnc, pfnComManagerPostRead pstRxFnc, pfnComManagerPostAck pstAckFnc, pfnComManagerDisableBroadcasts disableBcastFnc, com_manager_init_t *buffers, com_manager_port_t *cmPorts) |
int | processBinaryRxPacket (com_manager_t *cmInstance, int pHandle, packet_t *pkt) |
Process binary packet content: More... | |
packet_t * | registerPacketRetry (com_manager_t *cmInstance, int pHandle, uint8_t pid, unsigned char data[], unsigned int dataSize) |
registerPacketRetry - Saves data and packet header info to a retry list that will be resent if the corresponding response is not received (data or ack) within the given period. The packet header info must be populated following a call to this function. More... | |
void | sendAck (com_manager_t *cmInstance, int pHandle, packet_t *pkt, unsigned char pid_ack) |
int | sendDataPacket (com_manager_t *cmInstance, int pHandle, pkt_info_t *msg) |
int | sendPacket (com_manager_t *cmInstance, int pHandle, packet_t *dPkt, uint8_t additionalPktFlags) |
Encode and send out serial port the referenced packet structure. More... | |
void | stepComManagerSendMessages (void) |
void | stepComManagerSendMessagesInstance (CMHANDLE cmInstance) |
void | stepPacketRetry (com_manager_t *cmInstance) |
stepPacketRetry - Resend the ensured packets after the ENSURE_RETRY_COUNT period if the expected response was not received. More... | |
void | updatePacketRetryAck (com_manager_t *cmInstance, packet_t *pkt) |
void | updatePacketRetryData (com_manager_t *cmInstance, packet_t *pkt) |
Update packet retry. If the specific data requested or acknowledge is received, the retry list is updated as to no continue to resend the corresponding message. More... | |
Variables | |
static com_manager_t | g_cm |
#define ENABLE_FILTER_DUPLICATE_PACKETS 1 |
Definition at line 19 of file com_manager.c.
#define ENABLE_FILTER_DUPLICATE_PACKETS_MATCH_ALL_CHARACTERS 0 |
Definition at line 22 of file com_manager.c.
#define MAX_REQUEST_PERIOD_MS 100000 |
Definition at line 28 of file com_manager.c.
#define MIN_REQUEST_PERIOD_MS 1 |
Definition at line 27 of file com_manager.c.
#define MSG_PERIOD_DISABLED 0 |
Definition at line 30 of file com_manager.c.
#define MSG_PERIOD_SEND_ONCE -1 |
Definition at line 29 of file com_manager.c.
#define PARSE_DOUBLE | ( | str | ) | strtod(str, 0) |
Definition at line 24 of file com_manager.c.
#define PARSE_FLOAT | ( | str | ) | strtof(str, 0) |
Definition at line 25 of file com_manager.c.
int asciiMessageCompare | ( | const void * | elem1, |
const void * | elem2 | ||
) |
Definition at line 239 of file com_manager.c.
void comManagerAssignUserPointer | ( | CMHANDLE | cmInstance, |
void * | userPointer | ||
) |
Attach user defined data to a com manager instance
Definition at line 477 of file com_manager.c.
void comManagerDisableBroadcasts | ( | int | pHandle | ) |
Disables broadcasts of all messages on specified port, or all ports if phandle == -1.
pHandle | the pHandle to disable broadcasts on, -1 for all |
Definition at line 1057 of file com_manager.c.
void comManagerDisableBroadcastsInstance | ( | CMHANDLE | cmInstance_, |
int | pHandle | ||
) |
Definition at line 1062 of file com_manager.c.
int comManagerDisableData | ( | int | pHandle, |
uint32_t | dataId | ||
) |
Disable a broadcast for a specified port handle and data identifier
pHandle | the port handle to disable a broadcast for |
dataId | the data id to disable boradcast for |
Example:
Definition at line 625 of file com_manager.c.
int comManagerDisableDataInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint32_t | dataId | ||
) |
Definition at line 630 of file com_manager.c.
void comManagerGetData | ( | int | pHandle, |
uint32_t | dataId, | ||
int | offset, | ||
int | size, | ||
int | periodMultiple | ||
) |
Request data This function requests the specified data w/ offset and length for partial reads.
[in] | dataId | Data structure ID |
[in] | offset | Byte offset into data structure. 0 = data start. |
[in] | length | Byte length of data. 0 = entire structure. |
[in] | periodMultiple | Broadcast period of requested data. 0 = single request. |
Definition at line 516 of file com_manager.c.
void comManagerGetDataInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint32_t | dataId, | ||
int | offset, | ||
int | size, | ||
int | periodMultiple | ||
) |
Definition at line 521 of file com_manager.c.
int comManagerGetDataRequest | ( | int | pHandle, |
p_data_get_t * | req | ||
) |
Internal use mostly, process a get data request for a message that needs to be broadcasted
Definition at line 895 of file com_manager.c.
int comManagerGetDataRequestInstance | ( | CMHANDLE | _cmInstance, |
int | pHandle, | ||
p_data_get_t * | req | ||
) |
Definition at line 900 of file com_manager.c.
void comManagerGetDataRmc | ( | int | pHandle, |
uint64_t | rmcBits, | ||
uint32_t | rmcOptions | ||
) |
Make a request to a port handle to broadcast a piece of data at a set interval.
pHandle | the port handle to request broadcast data from |
RMC | bits specifying data messages to stream. See presets: RMC_PRESET_PPD_BITS = post processing data, RMC_PRESET_INS_BITS = INS2 and GPS data at full rate |
RMC | options to enable data streaming on ports other than the current port. |
offset | offset into the structure for the data id to broadcast - pass offset and size of 0 to receive the entire data set |
size | number of bytes in the data structure from offset to broadcast - pass offset and size of 0 to receive the entire data set |
periodMultiple | the data broadcast period in multiples of the base update period |
Example that enables streaming of all data messages necessary for post processing:
Example that broadcasts INS and GPS data at full rate:
Definition at line 539 of file com_manager.c.
void comManagerGetDataRmcInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint64_t | rmcBits, | ||
uint32_t | rmcOptions | ||
) |
Definition at line 544 of file com_manager.c.
CMHANDLE comManagerGetGlobal | ( | void | ) |
Definition at line 76 of file com_manager.c.
bufTxRxPtr_t* comManagerGetRegisteredDataInfo | ( | uint32_t | dataId | ) |
Internal use mostly, get data info for a the specified pre-registered dataId
Definition at line 878 of file com_manager.c.
bufTxRxPtr_t* comManagerGetRegisteredDataInfoInstance | ( | CMHANDLE | _cmInstance, |
uint32_t | dataId | ||
) |
Definition at line 883 of file com_manager.c.
com_manager_status_t* comManagerGetStatus | ( | int | pHandle | ) |
Get the most recent status of the com manager
Definition at line 487 of file com_manager.c.
com_manager_status_t* comManagerGetStatusInstance | ( | CMHANDLE | cmInstance, |
int | pHandle | ||
) |
Definition at line 492 of file com_manager.c.
void* comManagerGetUserPointer | ( | CMHANDLE | cmInstance | ) |
Get user defined data to from a com manager instance
Definition at line 482 of file com_manager.c.
int comManagerInit | ( | int | numHandles, |
int | maxEnsuredPackets, | ||
int | stepPeriodMilliseconds, | ||
int | retryCount, | ||
pfnComManagerRead | readFnc, | ||
pfnComManagerSend | sendFnc, | ||
pfnComManagerSendBufferAvailableBytes | txFreeFnc, | ||
pfnComManagerPostRead | pstRxFnc, | ||
pfnComManagerPostAck | pstAckFnc, | ||
pfnComManagerDisableBroadcasts | disableBcastFnc, | ||
com_manager_init_t * | buffers, | ||
com_manager_port_t * | cmPorts | ||
) |
Initializes the default global com manager. This is generally only called once on program start. The global com manager is used by the functions that do not have the Instance suffix and first parameter of void* cmInstance. The instance functions can be ignored, unless you have a reason to have two com managers in the same process.
numHandles | the max number of serial ports possible |
maxEnsuredPackets | the max number of ensured packets |
stepPeriodMilliseconds | how many milliseconds you are waiting in between calls to comManagerStep |
retryCount | the number of times to retry failed packets |
readFnc | read data from the serial port represented by pHandle |
sendFnc | send data to the serial port represented by pHandle |
txFreeFnc | optional, return the number of free bytes in the send buffer for the serial port represented by pHandle |
pstRxFnc | optional, called after new data is available (successfully parsed and checksum passed) from the serial port represented by pHandle |
pstAckFnc | optional, called after an ACK is received by the serial port represented by pHandle |
disableBcastFnc | mostly for internal use, this can be left as 0 or NULL |
Example:
Definition at line 79 of file com_manager.c.
int comManagerInitInstance | ( | CMHANDLE | cmHandle, |
int | numHandles, | ||
int | maxEnsuredPackets, | ||
int | stepPeriodMilliseconds, | ||
int | retryCount, | ||
pfnComManagerRead | readFnc, | ||
pfnComManagerSend | sendFnc, | ||
pfnComManagerSendBufferAvailableBytes | txFreeFnc, | ||
pfnComManagerPostRead | pstRxFnc, | ||
pfnComManagerPostAck | pstAckFnc, | ||
pfnComManagerDisableBroadcasts | disableBcastFnc, | ||
com_manager_init_t * | buffers, | ||
com_manager_port_t * | cmPorts | ||
) |
Definition at line 111 of file com_manager.c.
void comManagerRegister | ( | uint32_t | dataId, |
pfnComManagerPreSend | txFnc, | ||
pfnComManagerPostRead | pstRxFnc, | ||
const void * | txDataPtr, | ||
void * | rxDataPtr, | ||
int | dataSize, | ||
uint8_t | pktFlags | ||
) |
Register message handling function for a received data id (binary). This is mostly an internal use function, but can be used if you are implementing your own receiver on a device.
dataId | the data id to register the handler for |
txFnc | called right before the data is sent |
pstRxFnc | called after data is received for the data id |
txDataPtr | a pointer to the structure in memory of the data to send |
rxDataPtr | a pointer to the structure in memory to copy received data to |
dataSize | size of the data structure in txDataPtr and rxDataPtr |
pktFlags | packet flags, usually 0 |
Example:
Definition at line 247 of file com_manager.c.
void comManagerRegisterInstance | ( | CMHANDLE | cmInstance_, |
uint32_t | dataId, | ||
pfnComManagerPreSend | txFnc, | ||
pfnComManagerPostRead | pstRxFnc, | ||
const void * | txDataPtr, | ||
void * | rxDataPtr, | ||
int | dataSize, | ||
uint8_t | pktFlags | ||
) |
Definition at line 252 of file com_manager.c.
int comManagerSend | ( | int | pHandle, |
uint8_t | pktInfo, | ||
bufPtr_t * | bodyHdr, | ||
bufPtr_t * | txData, | ||
uint8_t | pktFlags | ||
) |
Send a packet to a port handle
pHandle | the port handle to send the packet to |
pktInfo | the type of packet (PID) |
bodyHdr | optional, can contain information about the actual data of the body (txData), usually the data id, offset and size |
txData | optional, the actual body of the packet |
Example:
Definition at line 639 of file com_manager.c.
int comManagerSendData | ( | int | pHandle, |
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Convenience function that wraps comManagerSend for sending data structures. Must be multiple of 4 bytes in size.
pHandle | the port handle to send data to |
dataId | the data id of the data to send |
dataPtr | pointer to the data structure to send |
dataSize | number of bytes to send |
dataOffset | offset into dataPtr to send at |
Example:
Definition at line 553 of file com_manager.c.
int comManagerSendDataInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Definition at line 558 of file com_manager.c.
int comManagerSendDataNoAck | ( | int | pHandle, |
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Same as comManagerSend, except that no retry is attempted
pHandle | the port handle to send the packet to |
dataId | Data structure ID number. |
dataPtr | Pointer to actual data. |
dataSize | Size of data to send in number of bytes. |
dataOffset | Offset into data structure where copied data starts. |
pFlags | Additional packet flags if needed. |
Definition at line 577 of file com_manager.c.
int comManagerSendDataNoAckInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Definition at line 582 of file com_manager.c.
int comManagerSendEnsured | ( | int | pHandle, |
uint8_t | pktInfo, | ||
unsigned char * | data, | ||
unsigned int | dataSize | ||
) |
Same as comManagerSend, except that the com manager may retry the send if an ACK is not received
pHandle | the port handle to send the packet to |
pktInfo | the type of packet (PID) |
bodyHdr | optional, can contain information about the actual data of the body (txData), usually the data id, offset and size |
txData | optional, the actual body of the packet |
Definition at line 665 of file com_manager.c.
int comManagerSendEnsuredInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint8_t | pktInfo, | ||
unsigned char * | data, | ||
unsigned int | dataSize | ||
) |
Definition at line 670 of file com_manager.c.
int comManagerSendInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint8_t | pktInfo, | ||
bufPtr_t * | bodyHdr, | ||
bufPtr_t * | txData, | ||
uint8_t | pktFlags | ||
) |
Definition at line 644 of file com_manager.c.
int comManagerSendRawData | ( | int | pHandle, |
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Convenience function that wraps comManagerSend for sending data structures. Allows arbitrary bytes size, 4 byte multiple not required. No byte swapping occurs.
pHandle | the port handle to send data to |
dataId | the data id of the data to send |
dataPtr | pointer to the data structure to send |
dataSize | number of bytes to send |
dataOffset | offset into dataPtr to send at |
Example:
Definition at line 601 of file com_manager.c.
int comManagerSendRawDataInstance | ( | CMHANDLE | cmInstance, |
int | pHandle, | ||
uint32_t | dataId, | ||
void * | dataPtr, | ||
int | dataSize, | ||
int | dataOffset | ||
) |
Definition at line 606 of file com_manager.c.
void comManagerSetCallbacks | ( | pfnComManagerAsapMsg | rmcHandler, |
pfnComManagerGenMsgHandler | asciiHandler, | ||
pfnComManagerGenMsgHandler | ubloxHandler, | ||
pfnComManagerGenMsgHandler | rtcm3Handler | ||
) |
Register message handler callback functions. Pass in NULL to disable any of these callbacks.
msgFunc | handler for Realtime Message Controller (RMC) called whenever we get a message broadcast request or message disable command. |
msgFunc | handler for ASCII messages. |
msgFunc | handler for ublox messages. |
msgFunc | handler for RTCM3 messages. |
Definition at line 453 of file com_manager.c.
void comManagerSetCallbacksInstance | ( | CMHANDLE | cmInstance, |
pfnComManagerAsapMsg | handlerRmc, | ||
pfnComManagerGenMsgHandler | handlerAscii, | ||
pfnComManagerGenMsgHandler | handlerUblox, | ||
pfnComManagerGenMsgHandler | handlerRtcm3 | ||
) |
Definition at line 462 of file com_manager.c.
void comManagerStep | ( | void | ) |
Performs one round of sending and receiving message. This should be called as often as you want to send and receive data.
Definition at line 281 of file com_manager.c.
void comManagerStepInstance | ( | CMHANDLE | cmInstance_ | ) |
Definition at line 287 of file com_manager.c.
void comManagerStepRxInstance | ( | CMHANDLE | cmInstance_ | ) |
Definition at line 300 of file com_manager.c.
void comManagerStepTxInstance | ( | CMHANDLE | cmInstance_ | ) |
Definition at line 397 of file com_manager.c.
int comManagerValidateBaudRate | ( | unsigned int | baudRate | ) |
Ensure baudrate is valid for InertialSense hardware
baudRate | the baud rate to check |
Definition at line 1587 of file com_manager.c.
void disableBroadcastMsg | ( | com_manager_t * | cmInstance, |
broadcast_msg_t * | msg | ||
) |
Definition at line 1049 of file com_manager.c.
void disableDidBroadcast | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
p_data_disable_t * | disable | ||
) |
Definition at line 1074 of file com_manager.c.
void enableBroadcastMsg | ( | com_manager_t * | cmInstance, |
broadcast_msg_t * | msg, | ||
int | periodMultiple | ||
) |
Definition at line 1035 of file com_manager.c.
int encodeBinaryPacket | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
buffer_t * | pkt, | ||
packet_t * | dPkt, | ||
uint8_t | additionalPktFlags | ||
) |
Adds data to a packet: adds start, info, data length, data, checksum, and stop bytes. All data is communicated in the endianess of the sender, each packet has a bit that determines big or little endian. Process for Creating Tx Packet: 1.) Add to packet.
@return 0 on success, -1 on failure.
Definition at line 1270 of file com_manager.c.
int findAsciiMessage | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 689 of file com_manager.c.
int initComManagerInstanceInternal | ( | com_manager_t * | cmInstance, |
int | numHandles, | ||
int | maxEnsuredPackets, | ||
int | stepPeriodMilliseconds, | ||
int | retryCount, | ||
pfnComManagerRead | readFnc, | ||
pfnComManagerSend | sendFnc, | ||
pfnComManagerSendBufferAvailableBytes | txFreeFnc, | ||
pfnComManagerPostRead | pstRxFnc, | ||
pfnComManagerPostAck | pstAckFnc, | ||
pfnComManagerDisableBroadcasts | disableBcastFnc, | ||
com_manager_init_t * | buffers, | ||
com_manager_port_t * | cmPorts | ||
) |
Definition at line 152 of file com_manager.c.
int processBinaryRxPacket | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
packet_t * | pkt | ||
) |
Process binary packet content:
Definition at line 702 of file com_manager.c.
packet_t * registerPacketRetry | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
uint8_t | pid, | ||
unsigned char | data[], | ||
unsigned int | dataSize | ||
) |
registerPacketRetry - Saves data and packet header info to a retry list that will be resent if the corresponding response is not received (data or ack) within the given period. The packet header info must be populated following a call to this function.
[in] | data[] | Pointer to data buffer. |
[in] | dataSize | Size of the data buffer. |
Definition at line 1336 of file com_manager.c.
void sendAck | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
packet_t * | pkt, | ||
unsigned char | pid_ack | ||
) |
Definition at line 1220 of file com_manager.c.
int sendDataPacket | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
pkt_info_t * | msg | ||
) |
Definition at line 1122 of file com_manager.c.
int sendPacket | ( | com_manager_t * | cmInstance, |
int | pHandle, | ||
packet_t * | dPkt, | ||
uint8_t | additionalPktFlags | ||
) |
Encode and send out serial port the referenced packet structure.
Definition at line 1103 of file com_manager.c.
void stepComManagerSendMessages | ( | void | ) |
Definition at line 403 of file com_manager.c.
void stepComManagerSendMessagesInstance | ( | CMHANDLE | cmInstance | ) |
Definition at line 408 of file com_manager.c.
void stepPacketRetry | ( | com_manager_t * | cmInstance | ) |
stepPacketRetry - Resend the ensured packets after the ENSURE_RETRY_COUNT period if the expected response was not received.
Definition at line 1294 of file com_manager.c.
void updatePacketRetryAck | ( | com_manager_t * | cmInstance, |
packet_t * | pkt | ||
) |
Definition at line 1520 of file com_manager.c.
void updatePacketRetryData | ( | com_manager_t * | cmInstance, |
packet_t * | pkt | ||
) |
Update packet retry. If the specific data requested or acknowledge is received, the retry list is updated as to no continue to resend the corresponding message.
[in] | *pkt | Pointer to pkt buffer. |
Definition at line 1476 of file com_manager.c.
|
static |
Definition at line 32 of file com_manager.c.