Occasionally getting error 139 when calling RP1210_ReadMessage

RP1210 Development Package and RP1210 Connectivity to PEAK CAN Interfaces
Post Reply
eugen.berenstein
Posts: 4
Joined: Thu 22. Apr 2021, 10:30

Occasionally getting error 139 when calling RP1210_ReadMessage

Post by eugen.berenstein » Mon 17. Mar 2025, 08:55

Hello,

I am reading broadcasted J1939 messages and occasionally error 139 is returned from RP1210_ReadMessage.
When calling it again the message is read and I can proceed.
Is this error just a warning that thew input buffer is full? What is the recommended course of action when this error is received?

Thank you for support

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Occasionally getting error 139 when calling RP1210_ReadMessage

Post by K.Wagner » Mon 17. Mar 2025, 21:29

Hello,

this error occurs when you do not retrieve messages from the reception queue fast enought, so that the queue get full when trying to include a new message. The RP1210 API states that, when this happens, the queue must be emptied and the error 139 returned. Any message contained in the queue is lost, and the queue gets its initial capacity for new messages. That is why you seee the error "occasionally".

To avoid this, you should always read for messages periodically, so that the queue always has place for new messages. The best is to use a timer or a dedicated thread to periodically read the queue until emptiness.
Best regards,
Keneth

Post Reply