CAN library containing a CAN controller object handling a FIFO, and CAN peripherals attached to it.
Diff: PeripheralCAN.h
- Revision:
- 5:d1920eb1d63e
- Parent:
- 4:0ed21bbd917b
--- a/PeripheralCAN.h Sat May 05 13:46:16 2018 +0000 +++ b/PeripheralCAN.h Sat Sep 12 12:36:45 2020 +0000 @@ -63,8 +63,11 @@ * @param Id Id message * @param data char array containing data to be send * @param len size of the data array + * @param timeout timeout value in ms (if 0 only one write attempt) + * + * @returns Write status : true if message was successfully sent, false else. */ - void writeOnCAN(unsigned short Id, const char *data, char len); + bool writeOnCAN(unsigned short Id, const char *data, char len, unsigned int timeout = 0); //short readOnCAN(unsigned short Id, CANMessage& msg); /** Get the IdsRead vector @@ -75,6 +78,8 @@ private : vector<unsigned short*> IdsRead; + + protected: ControllerCAN* controllerCAN; };