-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xbee: add timeout for AT command response (fixes #4731) #4734
Conversation
The test is done in a branch with #4445 merged. |
I can test next week, if needed. |
#4443 is also required, right? |
@OlegHahm Thank you for testing. Yes, you need #4443 for native platform. My experiment branch is here: https://github.com/Yonezawa-T2/RIOT/tree/xbee_border_router. This contains #4443, #4445, #4448 and some other minor patches. Steps to test:
The XBee driver initializes the XBee hardware on boot. On successful startup, it outputs debug outputs like following:
If we comment out some codes in
As xbee.c don't check status of AT commands on startup, it shows "Initialization successful" despite of timeout. |
Added status checking on startup: #4749. |
ping @Yonezawa-T2 |
I'm waiting for review. |
Let's try to review and test this tonight. |
I think we might simplify this PR to some extend (and save memory with this): The paradigm we use in device drivers concerning broken connections is, that we check the correct connection to a device once during initialization and assume a working connection from this point on. For the xbee device, I think we should simply send a single AT comman |
Moved the timer from |
But it would enable the |
|
I don't see it. Say the call |
To check response for |
now I see why I was so confused - I forgot that Just tested this PR -> there is still a bug: you need to call |
|
this seems not be be my day, overlooked that this depnends on #4445 |
@Yonezawa-T2 can you squash this too? code seems ok, I can test it ASAP, se let's Murdock check for errors. |
6af7098
to
4042239
Compare
Squashed. |
will need rebase since #4445 has been merged... |
ACK and try to merge it... |
Needs backport. |
Adds timeout for receiving AT command response.
Tested on a native platform with a XBee connected via USB adapter.
It works fine for normal case without producing debug output
"xbee: response timeout"
. When the following lines in_rx_cb
is commented out to simulate broken UART, it produces debug output"xbee: response timeout"
and proceeds.