Skip to content

Cellular: Fix AT Handler compile warning #6765

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
May 3, 2018

Conversation

mirelachirica
Copy link
Contributor

Description

Fix AT Handler compile warning in read routine + returned length. Unit tests are also passing after these changes.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@mirelachirica
Copy link
Contributor Author

@jarvte please review this

0xc0170
0xc0170 previously approved these changes Apr 27, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 27, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Apr 27, 2018

@mbed-ci
Copy link

mbed-ci commented Apr 28, 2018

@@ -515,15 +515,15 @@ ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool he
pbuf[buf_idx] = c;
} else {
if (read_idx % 2 == 0) {
upper = hex_str_to_int(&c, 1);
upper = hex_str_to_int((const char*)&c, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That cast is not legal - you're going to need to actually have a char to pass this function.

Suggest the simplest way might not be to remember upper but to remember the previous character.

 char hexbuf[2];

 hexbuf[read_idx % 2] = c;
 if (read_idx % 2 == 1) {
    hex_str_to_char_str(hexbuf, 2, pbuf+buf_idx);
 }

@adbridge
Copy link
Contributor

@kjbracey-arm could you re-review please

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a lot better.

@adbridge
Copy link
Contributor

/morph build

@mirelachirica
Copy link
Contributor Author

This is linked to/fixes #6691 which has label release-version: 5.9.0-rc1.

@mbed-ci
Copy link

mbed-ci commented Apr 30, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Apr 30, 2018

@mbed-ci
Copy link

mbed-ci commented Apr 30, 2018

@mirelachirica
Copy link
Contributor Author

mirelachirica commented May 3, 2018

@0xc0170 will you merge this? thanks.

@0xc0170 0xc0170 merged commit 16ab718 into ARMmbed:master May 3, 2018
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.

6 participants