Using the mbed os ble functionality (cordio) works fine with a Nano Sense BLE board. The code compiles for the Nicla, but I can't see the device while scanning.
I am using the following code to setup advertising
// Setup advertising
ble::AdvertisingParameters adv_parameters(
ble::advertising_type_t::CONNECTABLE_NON_SCANNABLE_UNDIRECTED, // Advertising type
ble::adv_interval_t(ble::millisecond_t(200)), // Min Advertising time in ms
ble::adv_interval_t(ble::millisecond_t(500)), // Max Advertising time in ms
false // Legacy PDU : Need to be OFF in Long Range Mode
);
adv_parameters.setPhy(ble::phy_t::LE_1M, ble::phy_t::LE_CODED); // Set advertising radio modulation
adv_parameters.setTxPower(8); // Set radio output power (max is 8 dB)
_gap.setPreferredPhys(&CodedPHY, &CodedPHY); // Set preferred connection phy
_adv_data_builder.clear();
_adv_data_builder.setFlags();
_adv_data_builder.setName("BL-" SENSOR_NAME);
_gap.setAdvertisingParameters(ble::LEGACY_ADVERTISING_HANDLE, adv_parameters);
_gap.setAdvertisingPayload(ble::LEGACY_ADVERTISING_HANDLE, _adv_data_builder.getAdvertisingData());
// Start advertising
_gap.startAdvertising(ble::LEGACY_ADVERTISING_HANDLE);