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

ATT_MTU Throuput Example Setup GATTS & GATTC

Hello Community,

I have been trying to avoid asking this question here (it may be trivial) but I guess the answer will help other people as well. 

In the ATT_MTU throughput example (SDK15.2.0 and previous ones) one unit is set as Central and the other as Peripheral. 

The 'tester' board is the Central and is doing all the transmission of the data while the 'responder' board is the peripheral that receives the data. 

What I cannot understand is why both devices are initialized as client and server at the same time. (?) 

I can see that the 'tester' (aka Client) is using functions in amts.c to notify the 'responder' (aka server) while the latter is using amtc.c routines to receive them.

Obviously the case is that the client can send data to the server and the other way round but why should each unit run both client_init and server_init routines?

Thank you for your answers.

  • Hello Hung Bui,

    Did that. The effect is very strange. 

    In the first kit I downloaded the ATT_MTU example as is.

    In the second kit I removed all references to client initialization and the BLE observer and also commented out the ble_db_discovery_start()

    Now the result is that the test does not fail but also it does not start. 

    This is the 1st dev kit:

    throughput example:~$ run
    [00:00:00.000,152] <info> app: Preparing the test.
    [00:00:00.000,183] <info> app: Starting advertising.
    [00:00:00.000,335] <info> app: Starting scanning.
    [00:00:00.038,146] <info> app: Connected as a peripheral.
    [00:00:00.038,208] <info> app: Discovering GATT database...
    [00:00:00.038,238] <info> app: Sending PHY Update, 2 Mbps.
    [00:00:00.054,321] <info> app: ATT MTU exchange completed. MTU set to 247 bytes.
    [00:00:00.004,486] <info> app: PHY update accepted. PHY set to 2 Mbps.
    [00:00:00.006,439] <info> app: Data length updated to 27 bytes.
    [00:00:00.028,839] <info> app: AMT service discovered at peer.
    throughput example:~$

    and this is the 2nd kit

    [00:00:00.000,183] <info> app: ATT MTU example started.
    [00:00:00.000,213] <info> app: Press button 3 on the board connected to the PC.
    [00:00:00.000,213] <info> app: Press button 4 on other board.
    [00:00:00.130,279] <info> app: This board will act as responder.
    [00:00:00.130,279] <info> app: Starting advertising.
    [00:00:00.130,432] <info> app: Starting scanning.
    [00:00:00.055,358] <info> app: Device "Nordic_ATT_MTU" found, sending a connection request.
    [00:00:00.094,085] <info> app: Connected as a central.
    [00:00:00.010,070] <info> app: ATT MTU exchange completed. MTU set to 247 bytes.
    [00:00:00.060,516] <info> app: PHY update accepted. PHY set to 2 Mbps.
    [00:00:00.069,946] <info> app: Data length updated to 27 bytes.
    [00:00:00.092,437] <info> app: Notifications enabled.
    throughput example:~$

    for some reason although the 2nd board is configured responder, when it is connected it assumes the central role. This happens although I have not initialized client_init().

    This is strange but I don't want to bother you anymore. It is enough that you explained why you are initializing client and server at the same time and also that the database discovery only needs to run from the client. 

    Thank you for your help.

Related