Skip to content

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

Merged
merged 2 commits into from Apr 10, 2018
Merged

cellular: ATHandler send delay #6572

merged 2 commits into from Apr 10, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 9, 2018

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

@ghost
Copy link
Author

ghost commented Apr 9, 2018

@AriParkkila please review

Copy link

@AriParkkila AriParkkila left a 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();

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.

Copy link
Author

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

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2018

PR description should state this as a fix, here implemented for TELIT.

I am confused. It's new API there so feature it is?

@AriParkkila
Copy link

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.

@ghost
Copy link
Author

ghost commented Apr 9, 2018

Set as Fix according to Ari's comments

@cmonr
Copy link
Contributor

cmonr commented Apr 10, 2018

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.

@cmonr
Copy link
Contributor

cmonr commented Apr 10, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

Build : SUCCESS

Build number : 1694
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6572/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

@@ -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) :
Copy link
Contributor

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)

Copy link
Author

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

Copy link
Contributor

@0xc0170 0xc0170 Apr 10, 2018

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

@cmonr cmonr merged commit 1c6d485 into ARMmbed:master Apr 10, 2018
@adbridge
Copy link
Contributor

@TeemuKultala is ATHandler only visible internally or is it exposed to the public API ?

@ghost ghost deleted the at_send_wait branch April 12, 2018 05:36
@ghost
Copy link
Author

ghost commented Apr 12, 2018

@adbridge ATHandler is not available in the API folder, so it is not a part of the public API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants