Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
This cannot connect to nRF Toolbox
On the BLE_Health_Thermometer_blog:
I can make it connect with nRF Master control but NOT with nRF Toolbox. I noticed that the advertising flags is limited to BREDR_NOT_SUPPORTED but does not involved LE_GENERAL_DISCOVERABLE or LE_LIMITED_DISCOVERABLE.
Thus no PC neither phones can't see this device. (I think this is the reason)
I tried to include LE_GENERAL_DISCOVERABLE but did not succeed in the way the advertising is formated. I get always compiling error for the type. Maybe I am not an expert with C++ and probably failed rewriting the code?
Anyone has a clue on this?
How can we modified the line: "advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED);"
in: "advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);"
Thanks if someone could help. jean-marc
Question relating to:
1 Answer
Assigned to
9 years, 8 months ago.This means that the question has been accepted and is being worked on.
Since no one answer:
I have a solution.
I can already suspect that the BLE_API_Native seems to be limitated compare to the BLE_API regarding the advertising.
All example compiled with BLE_API show connect and bond correctly.
I also received a keyfob from Texas that I did not program and can be seen in any media.
Beside this below is my solution:
I made some change to GapAdvertisingData.h (which I hate but could not find a better solution) and in the GapAdvertisingData.cpp
The compiler did not like the type Flags and wanted an uint_8.
I am not a C++ super expert so it took me some time to understand the problem.
in the file GapAdvertisingData.h made the following changes:
line cancelled-> ble_error_t addFlags(Flags flag = LE_GENERAL_DISCOVERABLE);
replaced by this line -> ble_error_t addFlags(uint8_t flag = LE_GENERAL_DISCOVERABLE);
then in the main{} modified this line:
line canceled -> advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED);
replaced by the line below->
advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
Need the following change also in GapAdvertisingData.cpp
ble_error_t GapAdvertisingData::addFlags(uint8_t flag) {
return addData(GapAdvertisingData::FLAGS, (uint8_t*)&flag, 1);
}
Basically the declaration uint_8 let us change the flags and make it discoverable.
Even if it was set by default it was not advertising it as such.
Finally I could make this work with the nRFToolbox and can see it from my PC and Phones WP and Android.
I suspect this to be a "soft" bug, but if someone could add some comment?
Jean-Marc
posted by jean-marc jobin 10 Apr 2015