-
Notifications
You must be signed in to change notification settings - Fork 3k
cellular: ATHandler send delay #6572
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
Conversation
@AriParkkila please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description should state this as a fix, here implemented for TELIT.
@@ -893,6 +896,8 @@ void ATHandler::resp_stop() | |||
set_tag(&_resp_stop, OK); | |||
// Reset info resp prefix | |||
memset(_info_resp_prefix, 0, sizeof(_info_resp_prefix)); | |||
|
|||
_last_response_stop = rtos::Kernel::get_ms_count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 0 to avoid redundant initial waiting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set 0 in the constructor
I am confused. It's new API there so feature it is? |
There are no changes in API folder, and thus, no application using cellular need to be changed so I'd say it's not a feature. |
Set as Fix according to Ari's comments |
I could go either way with this PR. the API for ATHandler is definitely updated, and in the past, constructor defaults that changed in a backwards compatible way were still marked as a feature, but this is also appears to be an internal-only change. I'm fine with having it marked as a fix. |
/morph build |
Build : SUCCESSBuild number : 1694 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1327 |
Test : SUCCESSBuild number : 1488 |
@@ -58,7 +59,7 @@ static const uint8_t map_3gpp_errors[][2] = { | |||
{ 146, 46 }, { 178, 65 }, { 179, 66 }, { 180, 48 }, { 181, 83 }, { 171, 49 }, | |||
}; | |||
|
|||
ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter) : | |||
ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter, uint16_t send_delay) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint16_t send_delay
- why uint16_t was chosen? vs int timeout
(3rd parameter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the delay is always positive, and 16 bits is enough for it for practical cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I was just asking as basic types should be sufficient , if there was a specific reason to use uint16_t (why then timeout is plain int
). If I add a new method here, I would be confused which one to use
@TeemuKultala is ATHandler only visible internally or is it exposed to the public API ? |
@adbridge ATHandler is not available in the API folder, so it is not a part of the public API |
Description
For some modems there is a minimum delay between the end of the response of the previous command and the beginning of a new command, and this change takes into account that kind of requirement. The delay set to 20 ms for Telit HE910 modems. The change is tested with a Telit HE910 modem
Pull request type
[ X ] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change