LE Audio device as central and peripheral simultaneously

My question is related to LE Audio, i guess, since i have no previous experience from it. Is it possible to have a device as a peripheral for mobile phone sending data to some characteristics and same time as a central to another nRF5340 streaming LE Audio (CIS)?

Device A and B are nRF5340. Device A generating and streaming audio to device B. Audio stream could be e.g. a mic(s) or line(s) in. There is no audio stream from device A to mobile phone. Also device A is generating and sending data to a mobile phone. Data could be e.g. temp, status, voltage etc.

I'm just wondering for example how much resources this LE Audio (CIS) takes.

  • No worries, we can resume this whenever you get a chance or would like to.

    You are correct that you can call bt_gatt_service_register multiple times, so that should not cause any issue itself, but it could be a symptom of something else being wrong in the code.
    Please share more of the project or changes that you have made if you would like us to take a closer look at what might be going on here.

    Best regards,
    Karl

  • Hello,

    i added the NUS service to the nrf5340_audio example act as Gateway. I also can connect to the device using NRFConnect application, but no services or characteristics appear on the NrfConnect app.

    if i comment 1.mcs service in line 726 and reflash the Gateway, the NUS service appear on NrfConnect app. any suggestion?

    nrf5340_audio_01.zip

    In the fuction bt_mcs_init() located in  \v2.6.0\zephyr\subsys\bluetooth\audio\mcs.c
    when i comment  bt_gatt_service_register(&mcs), the nrfconnect app could show the NUS services.

    Is it MCS service take too much room which cause the NUS service can not be registered?
  • Hello,

    Thank you for your patience with this.

    MaxLi said:
    Is it MCS service take too much room which cause the NUS service can not be registered?

    This should not be a problem, no.
    Do you receive an error message from the bt_nus_init call when MCS is already initialized?
    I think the sequencing here could be the issue, as described in the bt_gatt_service_register API reference documentation.

    Best regards,
    Karl

  • it seems bt_nus_init() only register callback and  return 0 directly. nus service was static register with marco BT_GATT_SERVICE_DEFINE.

    the mcs service was registed with bt_gatt_service_register() fuction in line 1348 of  .

    my question is whether static and dynamic registration of services can coexist?



  • Hello,

    MaxLi said:
    it seems bt_nus_init() only register callback and  return 0 directly. nus service was static register with marco BT_GATT_SERVICE_DEFINE.

    Have you also added the nus files and kconfigs to your project?

    MaxLi said:
    my question is whether static and dynamic registration of services can coexist?

    Yes, you my have static and dynamic registration of services in your application.
    You will just need to make sure that your call to bt_gatt_service_register for the dynamic part does not violated the sequence order as described in the API reference documentation.
    If you do dynamically change your services you will also need to use the 'services changed' service to alert a peer that it needs to do a new discovery (since all services and characteristics are discovered and cached upon connection).

    Best regards,
    Karl

Related