CAN message container. Defines "<<" and ">>" operators to simplify adding/getting data to/from a CAN message.
CAN message container
In order to simplify adding/getting data to/from a CAN message the CANMsg class extends mbed's built-in CANMessage class by defining "<<" (append) and ">>" (extract) operators. Since it inherits everything from CANMessage, after importing the library into your project, you can use it instead of CANMessage without any additional modification or limitations. The usage of "<<" and ">>" operators is similar to the C++ io-streams operators.
- Before adding data to a CANMsg object it is recommended to clear it by calling its
- Then set up all the other properties (ID, type, format) as needed.
- Finally append data one by one or combine them into a stream. The actual data length of a CAN message is automatically updated when using "<<" or ">>" operators. However, you have to make sure that the total length of data does not exceed eight bytes.
For an example of use have a look at this wiki page.
Revisions of CANMsg.h
|4:5017a65ff423||7 months ago||Modified.||File Diff Annotate|
|3:4e42fdc0459f||17 months ago||Fixed to work with the new mbed library/compiler.||File Diff Annotate|
|2:2b8425b12d05||18 months ago||Updated.||File Diff Annotate|
|1:34738eb16cf7||2017-03-18||Updated.||File Diff Annotate|
|0:3d11ed680b6a||2017-03-17||Initial release.||File Diff Annotate|