Connect two Peripherals to one Central

12 posts / 0 new
Last post
Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Connect two Peripherals to one Central

Hello,

I'm trying to connect two different Peripherals, with the same characteristics, to one Central.

The connection with the first Peripheral is OK.

When I try to connect the second Peripheral, it's not possible. I have always the same dest_id than the first connection in the GAPC _CONNECTION_REQ_IND handler and the state for thid dest_id is already set to APP_CONNECTABLE.

The connection is done with GAPM_CONNECTION_DIRECT.

Have you some issues for this problem? How proceed to connect two peripherals ti one central?

Thanks for your help

PY_Dialog
Offline
Last seen:2 years 10 months ago
Staff
加入:2014-08-25 09:59
Hi Guignier,

Hi Guignier,

Can you please let us know more information like what SDK and what project are you using?

Regards!
PY

Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Hi,

Hi,

I'm using the SDK v_2.0.4.1 (I'm using ES3 chips for the peripherical side)

My project is based on fh_proxr project for peripherals and monitor fe_usb for the central.

I use the same function with each peripheral to connect. (see code below)

void ConnectToDevice(uint8_t param_in_index)
{
struct gapm_adv_report_ind* ptr_discoveredDevice;

ptr_discoveredDevice = &(BTLE_Peripheral_a[param_in_index].attribute);

/* Prepare the Start Connection Command. */
struct gapm_start_connection_cmd* cmd = KE_MSG_ALLOC(GAPM_START_CONNECTION_CMD,
TASK_GAPM,
TASK_APP,
gapm_start_connection_cmd);

cmd->nb_peers = 1;
cmd->con_latency = 0;

cmd->ce_len_min = 0;
cmd->ce_len_max = 5;

cmd->con_intv_max = 100;
cmd->con_intv_min = 100;

cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd->op.code = GAPM_CONNECTION_DIRECT;

/* Address */
memcpy((void *) &cmd->peers[0].addr,
(void *) ptr_discoveredDevice->report.adv_addr.addr,
BD_ADDR_LEN);

/* Address type */
cmd->peers[0].addr_type = GAPM_PUBLIC_ADDR;

cmd->scan_interval = 0x180;
cmd->scan_window = 0x160;
cmd->superv_to = 0x1F4;// 500 -> 5000 ms ;

/* Send the Start Connection Command. */
ke_msg_send(cmd);
}

When the connection to the second device is initiated, the callback (see code below) for GAPC_CONNECTION_REQ_IND tells me that the DEST_ID is already connected. This DEST_ID is identical to the first connection Althoughthe information senfding for the second connection are different from the first connection (bd_adress ...)

// Callback GAPC_CONNECTION_REQ_IND

static int gapc_connection_req_ind_handler (const ke_msg_id_t msgid,
const struct gapc_connection_req_ind * param,
ke_task_id_t const DEST_ID,
ke_task_id_t src_id const)
{
if (ke_state_get (DEST_ID) == APP_CONNECTABLE)

JE_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
加入:2013-12-05 14:02
Hello Guigner,

Hello Guigner,

Is there any reason why you are using ES3 ? this was pre-produciton release Silicon. I would suggest that you move to the production version (DA14580-01) and supported (mature) SDK like 3.0.4. There was a major leap in quality from the pre-release SDK (2xx) to the SDK3.04 to suppor production SIlicon, as well as more features and tools support. I can organise a swap of your development boards : let me know which ones you have and i will send you a message to organise that.

BR JE_Dialog

Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Hi,

Hi,

We are using ES3 because we started a research project a several months ago. At this time, only ES3 chips are available and we received several ES3 chip. So we have mounted our PCBs with these chips.

I have also several demo boards with ES4 chips and I have the same problem but also with SDK 2xx. Have you a sample project or the manner to connect several peripherals to one central with SDK 3.0.4?

Regards,

Regis

JE_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
加入:2013-12-05 14:02
Hello Regis,

Hello Regis,

现在我们只有一个中央设备的例子available, thats a proximity monitor in SDK3.0.4 with external MCU. We have a wireless charging solution where we have tested multiple connections . I will have to talk to the SW to understand how many simultaneous slaves they have tested in the proximity app : we are limted to 6 in our core .

BR JE_Dialog

Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Hi,

Hi,

Yes, I know that the chip is limited to 6 simultaneous conections. In my application, I need only 5 simultaneous conections.

If you also can have some informations about the manner to connect several peripherals or if my manner posted in my third reply is correct or not.

Regards,

Régis

PY_Dialog
Offline
Last seen:2 years 10 months ago
Staff
加入:2014-08-25 09:59
Hi Regis,

Hi Regis,

Do you used the same BD address for those two peripherals?

Regards!
PY

Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Hi PY,

Hi PY,

No I used different BD address for each device.

I have defined my BD address like this with a compilation option for each different device.

#if defined(CFG_IBFC_IMPLANT_ID1)
.NVDS_TAG_DEVICE_NAME="Device_1",
.DEVICE_NAME_TAG_LEN = 8,
.NVDS_TAG_BD_ADDRESS={0xCD, 0xCD, 0x45, 0x55, 0x89, 0x01},
#elif defined(CFG_IBFC_IMPLANT_ID2)
.NVDS_TAG_DEVICE_NAME="Device_2",
.DEVICE_NAME_TAG_LEN = 8,
.NVDS_TAG_BD_ADDRESS={0xCD, 0xCD, 0x45, 0x55, 0x89, 0x02},
....

Regards,

Regis

JE_Dialog
Offline
Last seen:2 days 6 hours ago
Staff
加入:2013-12-05 14:02
Hello Regis,

Hello Regis,

Sorry for delay in response : i can confirm that we have tested the central role (proximity) with 6 connections : this is running an external MCU though , not fully embedded and only tested on SDK3.0.2 or later - therefore requiring production silicon. In the latest SDK there is also an example of a central role that is fully embedded into the DA14580 , the dk_apps\keil_projects\throughput_eval\throughput_eval_peripheral_fh .

We can swap out your development boards for the versions with the production device.. running different older versions of engineering silicon that worked with specific SDK's will make things more complex here. Let me know if you want to swap your development boards : I can arrange that .

BR JE_Dialog

Guignier
Offline
Last seen:3 years 1 month ago
加入:2014-06-10 09:39
Yes, I would like swap my

Yes, I would like swap my development board with a board with production devices because i have a lot of problems with this ES3 chips.

What is the process to change my development boards?

Regards,

Régis

PY_Dialog
Offline
Last seen:2 years 10 months ago
Staff
加入:2014-08-25 09:59
Hi Regis,

Hi Regis,

Seems you have already used difference identifications for the link. So it should not be problems in this field. We have tried to connect two or more peripherals to one central and got no problem.
在这里,我有两个建议:
1. Just as JE_Dialog suggested, I strongly advise you change to the newest platform and SDK. The new silicon and SDK is more rubust and also better supported with tools.
We can not do test based on previous version.
2. As for your code, I can not try it as a whole. But in gapc_connection_req_ind_handler(), the DEST_ID should be different because it based on different connections. I'm not sure whether you have stored the right condix before for each connection. Please check that.

Regards!
PY