hi i am using nrf52840 s140 softdevice and 15.2 sdk.
can anyone tell how to add default services like hrs,battery and temperature in our own programs
hi i am using nrf52840 s140 softdevice and 15.2 sdk.
can anyone tell how to add default services like hrs,battery and temperature in our own programs
I would recommend you to go through these tutorials (uses SDK v15.0.0):
Number 2 is most relevant for you, initially it goes through some basic theory regarding GATT, services, characteristics and UUID's. Then it will guide you, step by step, through the making of custom services.
It is recommended to have gone through tutorial number 1 first, but not necessary. The last tutorial shows how to add characteristics to your custom services.
This approach will give you a good understanding of services, and you will be able to add the default services you mentioned.
If you have any more questions, please ask.
Best regards, Simon.
thanku simon iversen
and i got one more problem, when i connect to the advertising device its connected and when disconnect it and its stops advertising and when i reset means its again starts advertising. what is the solution
Taking a closer look at the BLE UART Emulation example will provide an answer to your question. If you take a closer look at the ble_advertising.h file (Advertising module), you can see that it includes an observer
. . . NRF_SDH_BLE_OBSERVER(_name ## _ble_obs, \ BLE_ADV_BLE_OBSERVER_PRIO, \ ble_advertising_on_ble_evt, &_name); . . .
Every time a BLE event happens (for example BLE_GAP_EVT_DISCONNECTED), the function ble_advertising_on_ble_evt(..) is called. Inside that function there is a switch case that will handle a disconnect event, and start advertising again through on_disconnected(..)-->ble_advertising_start(..)