|
NetBurner 3.5.7
PDF Version |
Class to hold received CAN messages. More...
#include <multican.h>
Public Member Functions | |
| uint8_t | GetLength () |
| Returns the amount of data stored in the message. | |
| uint8_t | GetData (uint8_t *buffer, uint8_t max_len) |
| Copy the data in the message up to max_len. | |
| uint32_t | GetId () |
| Returns the ID of the message. | |
| uint16_t | GetTimeStamp () |
| Returns the time stamp of the message. | |
| BOOL | IsValid () |
| Check to verify the CanRxMessage is a valid message. | |
| CanRxMessage (OS_FIFO *pFifo, uint16_t timeout) | |
| Build a CanRxMessage from a FIFO. | |
| CanRxMessage (int moduleNum, uint32_t id, uint16_t timeout) | |
| Constructor that sends out a RTR request to ID and waits for a response. | |
| ~CanRxMessage () | |
| Destructor. | |
| BOOL | GetNewMessage (OS_FIFO *pFifo, uint16_t timeout) |
| Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received. | |
Class to hold received CAN messages.
| canMCF5441x::CanRxMessage::CanRxMessage | ( | OS_FIFO * | pFifo, |
| uint16_t | timeout ) |
Build a CanRxMessage from a FIFO.
The FIFO must be registered to listen for incoming messages. If no messages are received in the timeout interval, the returned CanRxMessage will be marked as not valid. A Timeout value of 0 will wait forever.
| pFifo | Pointer to an OS_FIFO to store the message |
| timeout | Message timeout in TICKS_PER_SECOND |
| canMCF5441x::CanRxMessage::CanRxMessage | ( | int | moduleNum, |
| uint32_t | id, | ||
| uint16_t | timeout ) |
Constructor that sends out a RTR request to ID and waits for a response.
The CAN system uses any unused channel to send and receive the buffer. The constructor can return an invalid message for two reasons:
| moduleNum | CAN module number |
| id | CAN ID number |
| timeout | Message timeout in TICKS_PER_SECOND. A value of 0 will wait forever. |
| uint8_t canMCF5441x::CanRxMessage::GetData | ( | uint8_t * | buffer, |
| uint8_t | max_len ) |
Copy the data in the message up to max_len.
| buffer | Pointer to destination storage buffer |
| max_len | Maximum number of bytes to copy |
| BOOL canMCF5441x::CanRxMessage::GetNewMessage | ( | OS_FIFO * | pFifo, |
| uint16_t | timeout ) |
Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received.
| pFifo | Pointer to the OS_FIFO. |
| timeout | Timeout to wait if no messages are currently available. Value is in TICKS_PER_SECOND, a value of 0 will wait forever. |
| BOOL canMCF5441x::CanRxMessage::IsValid | ( | ) |
Check to verify the CanRxMessage is a valid message.
Please refer to the CanRxMessage() constructor for further information on valid messages.