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
Occasionally getting error 139 when calling RP1210_ReadMessage
-
- Posts: 4
- Joined: Thu 22. Apr 2021, 10:30
Re: Occasionally getting error 139 when calling RP1210_ReadMessage
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.
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
Keneth