mikalhart / IridiumSBD

Arduino library for RockBLOCK Iridium satellite modem (http://rock7mobile.com)
132 stars 52 forks source link

Receiving message to the modem #36

Open infinitemind2 opened 4 years ago

infinitemind2 commented 4 years ago

Having trouble reliably receiving messages. My data is mainly going out-bound but i check if there is incoming message to act on. So far i get some messages, this is a problem.

A successful receive debug output... +SBDIX: 0, 10, 1, 1, 11, 0

OK SBDIX MO code: 0 SBDIX success! Incoming message!

AT+SBDRB Waiting for response AT+SBDRB << .AT+SBDRB.[Binary size:11]............[csum:1176]Waiting for response OK

A failed one with a message wait (i thought) +SBDIX: 0, 11, 1, 2, 11, 0

OK SBDIX MO code: 0 SBDIX success! Stopping Modem

Next success... +SBDIX: 0, 13, 1, 3, 11, 0

OK SBDIX MO code: 0 SBDIX success! Incoming message!

AT+SBDRB

These three messages, the failed one was using int sendReceiveSBDText(const char message, uint8_t rxBuffer, size_t &rxBufferSize); with message set to a string, whereas the other 2 did happen to be message set to NULL. And just tested it with a text message and it worked.

Any ideas what is wrong

Thanks

infinitemind2 commented 4 years ago

have had a play with the source code of the library and separated if (mtCode == 1 && rxBuffer)

if (mtCode == 1) // retrieved 1 message { diagprint(F("Incoming message!\r\n")); if (rxBuffer) return doSBDRB(rxBuffer, prxBufferSize); if (prxBufferSize) *prxBufferSize = 0; }

It seem to work now??????

Doesn't make sense?