Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RN52.cpp
- Revision:
- 2:10c60edc8573
- Parent:
- 1:63db3f3124d4
- Child:
- 4:3041a571b7a7
--- a/RN52.cpp Mon Jan 04 18:54:24 2016 +0000 +++ b/RN52.cpp Mon Jan 04 23:36:50 2016 +0000 @@ -77,13 +77,14 @@ case RN52_GETSTATUS: serial.printf(GETSTATUS); capture_response(result->response); - result->media_connected = (result->response[0] & (1 << 2)) >> 2; - result->phone_connected = (result->response[0] & (1 << 3)) >> 3; - result->connection = (RN52_CONNECTION)(result->response[0] & 0x0F); - if((result->response[0] & (1 << 4)) >> 4) { + int response_value = strtoul(result->response, NULL, 16); + result->media_connected = (response_value & (1 << 10)) >> 10; //byte 0, bit 2 + result->phone_connected = (response_value & (1 << 11)) >> 11; //byte 0, bit 3 + result->connection = (RN52_CONNECTION)(response_value & 0x0F); //byte 1, bits 0-3 + if((response_value & (1 << 12)) >> 12) { //byte 0, bit 4 result->event = RN52_CALLER_ID_EVENT; } - else if((result->response[0] & (1 << 5)) >> 5) { + else if((response_value & (1 << 13)) >> 13) { //byte 0, bit 5 result->event = RN52_TRACK_CHANGE_EVENT; } else {