This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

basic central tutorial please

Dear all

I am looking for a tutorial like this https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/ble-central-tutorial

It sounds quite helpful, but it is a bit old and tools are outdated and functions look different, some links are not available anymore, could someone point me to a newer one please? I am new and use VS Code and latest nrf connect, and aim to develop a generic central application to make connection and exchange data. 

Thank you .

Ping

  • Thank you, Kenneth

    I will have a look.

    Ping

  • Thanks, Kenneth

    Read the first link and have a few questions to ask:

    1. About the security feature, it seems that the central set a higher security level immediately after connection, is this optional or mandatory? 

    2. Is it determined by peripheral or by central only?

    3. About service discovery - gatt_discovery, if central doesn't know anything (service ID) before doing discovery, how this can be done? I am aiming to do a generic central and presume it knows nothing and all information can be found by doing some sort of service discovery, am I right?

    Thank you!

    Ping

  • 1. Optional.

    2. It is common that a central take the initiative to establish an encrypted link (by bonding/pairing), but it can be initiated by a security request also from the peripheral. It's also possible that neither want to bond or encrypt the link.

    3. It is common that the database discovery done by either peers are generic, there are software modules that can do this for you. I believe the central examples show how this can be done, though it can also be done by a peripheral.

    Kenneth

  • hello, Kenneth

    Thanks for your reply!

    About 3 - SDP, I tried a few examples and had a bit of understanding, but I am still not sure the completer procedure to exchange data between connected peers, here is the procedure by my understanding and questions too, correct me if I am wrong please. 

    1. Central does active scan and get peripheral's service UUID it advertises, the UUID can be passed to bt_gatt_dm_start() function and find all services, so peripheral must advertising its service UUID, some peripheral advertising more than 1 UUID, is this right? in the case of it advertise more than 1 service UUID, gatt_discovery() need to do discover for each UUID? 

    2. Central initiate connection and then call gatt_discovery() function using the service UUID it scanned, and here is the print out of the central uart sample by bt_gatt_dm_data_print(dm) function.

    ATT[1]:     UUID: 0x2803    Handle: 0x0011    Value:
    
    Characteristic: 0x6e400003-b5a3-f393-e0a9-e50e24dcca9e    Properties: 0x0010
    
    ATT[2]:     UUID: 0x6e400003-b5a3-f393-e0a9-e50e24dcca9e    Handle: 0x0012    Value:
    
    ATT[3]:     UUID: 0x2902    Handle: 0x0013    Value:
    
        CCCD
    
    ATT[4]:     UUID: 0x2803    Handle: 0x0014    Value:
    
    Characteristic: 0x6e400002-b5a3-f393-e0a9-e50e24dcca9e    Properties: 0x000C
    
    ATT[5]:     UUID: 0x6e400002-b5a3-f393-e0a9-e50e24dcca9e    Handle: 0x0015    Value: 
    

    3. Then probably need to define client to get the handles? like this bt_nus_handles_assign(dm, nus)? But different client seems have different client definition, the BAS service client have a different definition with NUS, so I am not sure how to make the client generic to access handles for all? please advise.

    Thank you for your patience .

    Ping

Related