Hi Team,
we wanted to use battery service in eatt_central_freertos .
since battery service not implemented in central what are the changes we should do in central? is there any documents for the same?
we tried to implement as same as serviceA and serviceB are already implemented in central .
but we are not getting battery data.
Hello, hope you are doing well,
For any modification or implementation using the BLE examples from the SDK; I would recommend the Bluetooth Low Energy Application Developer’s Guide and Bluetooth Low Energy Demo Applications User’s Guide
There you can find more information about how the services works on our BLE examples.
I would recommend checking the Chapter 7.1.2 Declaring a service and 7.1.2.1 Service declaration macros in the Bluetooth Low Energy Application Developer’s Guide
I would recommend you setting the Primary Service information for Battery service in gatt_db.h
PRIMARY_SERVICE(service_battery, gBleSig_BatteryService_d)
CHARACTERISTIC(char_battery_level, gBleSig_BatteryLevel_d, (gGattCharPropNotify_c | gGattCharPropRead_c))
VALUE(value_battery_level, gBleSig_BatteryLevel_d, (gPermissionFlagReadable_c), 1, 0x5A)
DESCRIPTOR(desc_bat_level, gBleSig_CharPresFormatDescriptor_d, (gPermissionFlagReadable_c), 7, 0x04, 0x00, 0xAD, 0x27, 0x01, 0x01, 0x00)
CCCD(cccd_battery_level)
Also, you can consult as reference how other examples for BLE in the SDK implements the battery service, for example hid_device or temperature_sensor.
Hope this helps.
Best Regards
Luis
Hi Luis,
Thanks for replying,
Since i am trying to use default sig defined battery service, The KW45 examples available in wireless folder all having battery service details in peripheral examples but there is no details in central, how to recive that battery data and print.Even i checked KW38 examples also but battery recive details not available (central).
So i want how to recive battery details in Central?
Hello,
The handling of the Battery service is not implemented on the central example. This is something every customer would need to implement.
The QN9080 SDK has an example [qn908xcdk_wireless_examples_bluetooth_private_profile_server_freertos] that uses Battery service and can send data from the client to server. If you need to consult an example I would recommend this.
I would recommend checking this community post in order to implement a custom profile or modifying the Battery service in the temperature profile and print it.
KW38 Custom Profile - NXP Community, keep on mind that this example is done on the KW38, but the process is more or less the same for KW45
Let me know if this information for sending from peripheral to Central is what you refer to send commands
Thank you for your interest in NXP Semiconductor products.
Best Regards
Luis