Use library functions

Set the mbed-os version to 5.15.0 in the project,
The path inside mbed-os is features/FEATURE_BLE/ble/gap/Events.h.


In this Events.h, there is a function called getRssi().
I want to use this function to receive and output the Rssi value.
But I don’t know how to use that function in main.
Including it in the default gives me the following error:
q2
I don’t know what to do.
And when I click Events.h, I get an error like this.

Hello friend,

no one can help when you stop communicate How to use getRssi() - Keil Studio - Arm Mbed OS support forum

Usually is good to share necessary steps how to reproduce your issue. For exaple

Now is your turn…

BTW some times is good ignore reported errors from clang and try to compilation instead.

BR, Jan

Oh sorry I tried to build but it kept failing.

features/FEATURE_BLE/ble/gap/Events.h in mbed-os.
I didn’t know how to include Events.h in this path.
After several attempts, I included in this way, but a red line appeared.


When I ignored it and built it, the problem was that there was a red line in ble/blecommon.h in the Events.h code.
ble/blecommon.h is in this path.

The header file is in that path, but I don’t know why there is a red line in the code #include in Events.h.

Hello,

this is not what I wanted, you write ± still same thing.

Look to this example mbed-os-example-ble-GAP - Demonstration of the GAP profile. It shows advert… | Mbed
there the main include just these files

#include <events/mbed_events.h>
#include <mbed.h>
#include "ble/BLE.h"
#include "gap/Gap.h"
#include "gap/AdvertisingDataParser.h"

and on the line 431 is event.getRssi() called.

So delete your include of features/FEATURE_BLE/ble/gap/Events.h and use something of this.

Ofc mbed_app.json need to modified - mbed-os-example-ble-GAP - Demonstration of the GAP profile. It shows advert… | Mbed, something like

{
    "target_overrides": {
        "HEXIWEAR": {
            "target.features_add": ["BLE"],
            "target.extra_labels_add": ["CORDIO"]
        }
    }
}

BR, Jan