pierremolinaro / acan2515

MCP2515 CAN Controller Driver for Arduino
MIT License
74 stars 29 forks source link

'class ACAN2515' has no member named 'receiveBufferPeakCount' #3

Closed qwec01 closed 2 years ago

qwec01 commented 5 years ago

Following the PDF chapter 8.4, I just copied the example in 8.4 to the LoopBackDemo, to get the RecieveBufferPeakCount. But when I try to upload it, the IDE tells me "class ACAN2515' has no member named 'receiveBufferPeakCount", is there something wrong? please help. Thanks My IDE is 1.8.7, Arduino board is pro mini. code: if (can.available ()) { can.receive (frame) ; gReceivedFrameCount ++ ; Serial.print ("Received: ") ; Serial.println (gReceivedFrameCount) ; const uint16_t peak = can.receiveBufferPeakCount () ; //Line added }

pierremolinaro commented 5 years ago

Hello,

Indeed, I forgot to implement this function.

The fix is to add it in the file ACAN2515.h, for example after the receive buffer declaration:

public: inline uint16_t receiveBufferPeakCount (void) const { return mReceiveBuffer.peakCount () ; }

I will distribute soon a new release with this bug fix.

Best regards,

Pierre

Le 16 janv. 2019 à 05:05, qwec01 notifications@github.com a écrit :

Following the PDF chapter 8.4, I just copied the example in 8.4 to the LoopBackDemo, to get the RecieveBufferPeakCount. But when I try to upload it, the IDE tells me "class ACAN2515' has no member named 'receiveBufferPeakCount", is there something wrong? please help. Thanks My IDE is 1.8.7, Arduino board is pro mini. code: if (can.available ()) { can.receive (frame) ; gReceivedFrameCount ++ ; Serial.print ("Received: ") ; Serial.println (gReceivedFrameCount) ; const uint16_t peak = can.receiveBufferPeakCount () ; //Line added }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan2515/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/ASys1Fh9ZdjZeXo8p2yxUaDohoA797Zoks5vDqT-gaJpZM4aCRkv.

qwec01 commented 5 years ago

It worked! Thanks a lot!