This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2640R2F: Multiple BLE pairing devices using simple_serial_socket_client/server example

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Dear expert,

I'm working on CC2640R2F LP and using your simple_serial_socket_client/server example to transmit data to PC through UART. Now I would like to have multiple pairs of client and server working simultaneously.

1. Could you please tell me how does the client device automatically connect to the server device without knowing the server device MAC address?

2. Which variable should I change if I would like to have multiple devices which has their specific pair, working at the same time?

Thank you so much!

Best,

Jianlin 

  • Hi Jianlin,

    1. Please look at SimpleSerialSocketClient. When an advertisement packet is received ( SSSC_EVT_ADV_REPORT event), the client looks through the advertisement data to check whether or not it contains the SimpleStreamServerUUID (SimpleSerialSocketClient_findSerialStreamServer). 

    2. In order for the device to be able to connect to multiple peer devices you should set the BLE_MAX_NUM_CONNS define (in the predefined symbols opt file) accordingly. However to keep track of all the different connections you should also implement some kind of connections list. Please look at the multi_role example for an example of this.

  • Hello Marie,

    Thank you for your reply. 

    1. According to your reply, does it mean that for any device which has a UUID 0xC0C0 service, the SimpleSerialSocketClient can automatically connect to it?

    2. Thanks for introducing this method. But at this stage, I don't want to have multiple server connect to the same client. I only want to have SimpleSerialSocketClient 1 to connecting to SimpleSerialSocketServer 1 and SimpleSerialSocketClient 2 connecting to SimpleSerialSocketServer 2. To implement this and avoid two server device compete to connect with one client, which parameter should I change to allow multiple server-client pair working at the same time but only connect to each's assigned pair device?

    Best,

    Jianlin

  • Hi Jianlin,

    1. Any device which has a UUID 0xC0C0 service and advertises it (the UUID found in the advertising data), the SimpleSerialSocketClient can automatically connect to it.

    2. In this case it might be better to to use directed advertising so that SSSS1 is only communicationg with SSSC1 and SSSS2 is only communicating with SSSC2.