implementing custom service

product details:

nRF52840 custom board

nRFConnectSDK 2.2.0

we want to implement custom service interacting with the Android app.

Where we will receive on command from Android app and we will do some processing and sending the data back to the android app.

For this what and all we need to do.

for ex: service

what characteristics and what descriptors are needed and their properties.

All we need to know is how to write custom service and for our requirement what we need to add.

Parents
  • Hi,

    Here in Norway we have had the Easter holidays, causing the delay in the answer. But we are all back in office now.

    To learn how to add new services to a BLE device, I recommend our Bluetooth Low Energy Fundamentals guide.

    Regards,
    Sigurd Hellesvik

  • Hi

    Sorry i was completely occupied with multiple objects. Did not get time to look into this.

    Got some breathing time. This we are planing initially as POC.

    THe requirement is: Custom service where

    1.From APP to NRF initially one request comes to send the data

    2.As the request comes the data will be sent from NRF to Android App.

    3.One main thing is this service and characteristics should run parallelly with the SMP service which as part of other PRIVATE case is handled.

    SO DFU and this custom service should work parallelly.

    For Both to work, how two services need to be implemented and what should be the custom service characteristics.

  • Hi

    Sorry, ithink misunderstood.

    I am asking about second picture where it is UART interface to iMX.

    In this case UARTE0 is needed and it uses uart0 and in actual communication case also

    #define UART_DEVICE_NODE DT_CHOSEN(zephyr_shell_uart)
    struct device *uart_dev = DEVICE_DT_GET(UART_DEVICE_NODE);

    uart0 is used.

    So we want both BLE and uart communication need to be worked.

    Please gothrough the code i ahve shared. YOu will have a clue what i am asking.

    This code is merging of two nRF connect SDK sample applications.

    C:\ncs\v2.2.0\nrf\samples\bluetooth\peripheral_uart

    and C:\ncs\v2.2.0\zephyr\samples\drivers\uart\echo_bot

    these two together should work on uart communication.

  • Srikara said:

    This code is merging of two nRF connect SDK sample applications.

    C:\ncs\v2.2.0\nrf\samples\bluetooth\peripheral_uart

    and C:\ncs\v2.2.0\zephyr\samples\drivers\uart\echo_bot

    The peripheral_uart sample already does UART for your.
    I do not think merging these two samples makes much sense.

    You have two alternatives, and I am not sure which one you need. Here they are, with suggested solutions:

    1. Receive data over UART from iMX and send directly over BLE without changing data:
      1. Run Peripheral UART sample as is. Minor changes needed.
    2. Receive data over UART from iMX. Do operations with data on nRF. Then send something else over BLE.
      1. Learn how to implement Bluetooth applications from DevAcademy Bluetooth course. Specifically its Lesson on Bluetooth and UART will be useful for you.

    Do I understand correctly? Does my suggestions make sense?

  • we need both, same customer may send the data from iMX and android app.

    If he is sending request from android app, he will receive response to android app.

    for example: read command is sent

    then all the nearby RFID tags details will be sent to android app

    If he is sending from iMX he will be received to iMX

    for example: read command is sent

    then all the nearby RFID tags details will be sent to iMx

    Like read we have lot of commands so usage may be iMX/Android app.

    This is our requirement. Will this can be done? If so How we will do it.

    You have two alternatives, and I am not sure which one you need. Here they are, with suggested solutions:

    1. Receive data over UART from iMX and send directly over BLE without changing data:
      1. Run Peripheral UART sample as is. Minor changes needed.
    2. Receive data over UART from iMX. Do operations with data on nRF. Then send something else over BLE.
      1. Learn how to implement Bluetooth applications from DevAcademy Bluetooth course. Specifically its Lesson on Bluetooth and UART will be useful for you.

    Based on our requirement i think this is not useful i Believe.

  • Srikara said:

    If he is sending request from android app, he will receive response to android app.

    for example: read command is sent

    then all the nearby RFID tags details will be sent to android app

    If he is sending from iMX he will be received to iMX

    for example: read command is sent

    then all the nearby RFID tags details will be sent to iMx

    Like read we have lot of commands so usage may be iMX/Android app.

    This is our requirement. Will this can be done? If so How we will do it.

    These sound like custom requirements for Bluetooth LE operations.
    I suggest that you take the DevAcademy Bluetooth Course and learn how to implement your own Bluetooth LE applications so you can make it custom to match your requirements.

    EDIT:
    And when I say "custom", I mean that we do not have any samples that does exactly this

  • These sound like custom requirements for Bluetooth LE operations.
    I suggest that you take the DevAcademy Bluetooth Course and learn how to implement your own Bluetooth LE applications so you can make it custom to match your requirements.

    Actually what i mean to say is uart0 is already engaged with iMX, and also uart0 is getting used in peripheral UART.

    So for both to work together it is not possible right?

    Because we have only one uart is exposed in our custom HW.

Reply
  • These sound like custom requirements for Bluetooth LE operations.
    I suggest that you take the DevAcademy Bluetooth Course and learn how to implement your own Bluetooth LE applications so you can make it custom to match your requirements.

    Actually what i mean to say is uart0 is already engaged with iMX, and also uart0 is getting used in peripheral UART.

    So for both to work together it is not possible right?

    Because we have only one uart is exposed in our custom HW.

Children
Related