Battery service

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Battery service

714 Views
Chan_17
Contributor III

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. 

0 Kudos
Reply
4 Replies

690 Views
luis_maravilla
NXP Employee
NXP Employee

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

0 Kudos
Reply

646 Views
Chan_17
Contributor III

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?

 

 

 

0 Kudos
Reply

643 Views
Chan_17
Contributor III
1.we are using another KW45 as reciver so we wanted to recive battery service data from peripheral device to central. how to do it in central? i checked many examples there is not details about it. and in few examples they are calculating battery of central but they are not sending peripheral battery status to central.
2. one more question is if i want to send some commands to peripheral from central how to do it?
0 Kudos
Reply

610 Views
luis_maravilla
NXP Employee
NXP Employee

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

0 Kudos
Reply