Very good job Colas71 and thanks your for your contribution.
I am not yet very comfortable with this Mbed BLE_API and the BLE. How can I add and assign a custum service with custom UUIDs and these characteristics.
Before your code I used ArduinoBLE.h
// BLE Battery Service
BLEService batteryService("180F");
// BLE Battery Level Characteristic
BLEUnsignedCharCharacteristic BatterieChar("2a19", BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
BLEUnsignedCharCharacteristic MouvementChar("2a20",BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
BLEUnsignedCharCharacteristic DetectionChar("2a21",BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
BLEUnsignedCharCharacteristic AlarmeChar("2a22",BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
BLE.setAdvertisedService(batteryService); // add the service UUID
batteryService.addCharacteristic(BatterieChar); // add the battery level characteristic
batteryService.addCharacteristic(MouvementChar);
batteryService.addCharacteristic(DetectionChar);
batteryService.addCharacteristic(AlarmeChar);
BLE.addService(batteryService); // Add the battery service
BatterieChar.writeValue(0); // set initial value for this characteristic
Thanks for your replies