This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to create custom service?

image descriptionhow to create custom service in order to send dummy message, not from the console, I have to make one char arr[]="hello" this is a fixed string, then where i have add this string as data and what are the parameters are required to create simple custom service? please tell me the stepwise procedure to do this.

I don't want to send the data by this type of window as a shown in the below picture and also by mobile app.

I am following below programs:

ble_ap_uart_s132_pca10040(periphral) ble_app_uart_c_s132_pca10040(central)

Parents
  • Steps:

    1. Learn how BLE works (see all Tutorials in "Bluetooth low energy" here).
    2. Try to make Nordic BLE UART Service examples work (you need two dev kits obviously but it works on all nRF51/52/52840 variants, just pick right nRF5 SDK version). GAP Peripheral part is in examples\ble_peripheral\ble_app_uart path while GAP Central example is in examples\ble_central\ble_app_uart_c path.
    3. Send whatever strings you need.
    4. Profit.

    If you fail in any step, please first go back to step 1) and if not resolved then search carefully through all 23k+ Q&S on this forum. If still not resolved then you are most then welcome to paste new question (please give us then detailed description what HW+SW set-up you have, what is your goal, what steps you've done, what is the result what was your expectation instead).

  • @endnode

    Yes.

    That's actually what I do in a lot of cases.

    I already have a manually generated adv packet, as I'm trying to squeeze as much data as possible into the packet, so that the Android (or iOS) App's don't need to connect, as connecting flattens the battery if it happens a lot.

    BTW. I originally started programming nRF using mbed and it has some nice features which generate the adv packet in a more modular fashion, where you can call functions to add another 16 bit service or the name or manufacturer data to the adv packet before its finally passed to the API

    I should probably write something similar myself, but as usual, I never have the time and its quicker to manually create it ;-)

Reply
  • @endnode

    Yes.

    That's actually what I do in a lot of cases.

    I already have a manually generated adv packet, as I'm trying to squeeze as much data as possible into the packet, so that the Android (or iOS) App's don't need to connect, as connecting flattens the battery if it happens a lot.

    BTW. I originally started programming nRF using mbed and it has some nice features which generate the adv packet in a more modular fashion, where you can call functions to add another 16 bit service or the name or manufacturer data to the adv packet before its finally passed to the API

    I should probably write something similar myself, but as usual, I never have the time and its quicker to manually create it ;-)

Children
No Data
Related