digidotcom / xbee_ansic_library

A collection of portable ANSI C code for communicating with Digi International's XBee wireless radio modules in API mode.
204 stars 116 forks source link

Clarification on the use of XBEE_ATCMD_REUSE in an AT command callback #34

Closed acpie360 closed 1 month ago

acpie360 commented 3 years ago

If my API mode AT command callback function uses XBEE_ATCMD_REUSE as the return value, will it cause the same AT command to be re-sent automatically? I am guessing XBEE_ATCMD_REUSE is only used to preserve the call table entry, therefore if I want to send the same AT command again in the case of a timeout, I'll have to do it on my code.

In the current implementation, the AT command time-out is hard coded at 2-second. Will there be a plan to make this value adjustable on the per command basis?

Thanks.

tomlogic commented 2 years ago

I don't believe anyone is actively working on the library at the moment. I agree that there's a need for a per-command timeout, especially for long-running commands like ATND or ATAS.

Per the documentation for XBEE_ATCMD_REUSE, it means, "more responses are expected, or the request handle will be reused". Your code would be responsible for sending the command again (or a different command by reusing the existing handle).