Open alexose opened 2 years ago
I would be more inclined to keep it. I don't see how randomly firing off a message could be any better than waiting for a specified signal. According to the 9602 developer guide it is about two seconds to get a result, not 20s that Rock7 claim.
Note: A signal strength response may not be immediately available, but will usually be received within two seconds of issuing the command. If the 9602 is in the process of acquiring the system, a delay in response of up to 50 seconds may be experienced.
Also based on the iridium best practices guide it is recommended to check the signal before transmitting.
Before transmitting, check for good signal quality and network availability. If the session fails (e.g. code 32), implement a retry back off scheme starting with 60 seconds. Do not continuously retry.
For info I am working on a new 9602/9603 library for an internal project which is written in typescript and promises. I will seek approval to release it to the public. Also working on 9602/9603 emulator.
I just had a look at the code again. I think the sendMessage function should accept some kind of parameter specifying the minimal signal quality before invoking the SBD session. If the minimum signal quality is "NONE" then the waitForNetwork function could be skipped.
Ah, I was going off the RockBlock guide only. I didn't realize there was conflicting advice in the 9602 guide.
In that case, I agree. Best to leave it up to the developer as to whether or not to skip the network check.
Fantastic that you're working on a typescript driver! Hopefully this code is serving as a good starting point, and that you'll be able to release it when the time comes.
Per the RockBlock documentation:
Skipping waitForNetwork definitely seems to work better in practice. Messages come through much quicker if we don't have to wait to read the signal strength beforehand.