how to discovery two service in central_nus

hellow

     I built my own Bluetooth receiver to connect different products from my company. The data transfer services of the two products are different. I want to use one host client to connect different services. The problem now is that I have no problem connecting to nus service according to central_nus code. If I connect to another device (name: focus), its service is a private service of my own definition. The program will jump to the callback that didn't find the service, and then it won't find the service again, so I can't connect to this device (focus).

Whether a client connects to a routine of two different services, and if one connection fails, it can automatically connect to the other's routine. Could you give me a reference?

Parents
  • Hi SOK,

    Please take a look at peripheral_ancs_client sample. In the example you can find that after discover of gattp service it will start discover the ancs service: 

    Pay attention to how bt_gatt_dm_data_release() is called after discover_gattp_completed_cb(). You can read more in gatt_dm.h : 

  • hai Hung Bui:

     i have a new problem. When I use my own client to discover my own custom private matches and features. In the accept callback event of the tx feature, it only comes in once. I can confirm that I have implemented it exactly according to the dm module of nus. Does the client need to send an ack after receiving data from the server? Or there are no routines for clients to discover private service characteristics for reference.

Reply
  • hai Hung Bui:

     i have a new problem. When I use my own client to discover my own custom private matches and features. In the accept callback event of the tx feature, it only comes in once. I can confirm that I have implemented it exactly according to the dm module of nus. Does the client need to send an ack after receiving data from the server? Or there are no routines for clients to discover private service characteristics for reference.

Children
Related