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.
你有一些问题吗?如何继续连接两个外围设备ti一个中心?
Thanks for your help
Hi Guignier,
Can you please let us know more information like what SDK and what project are you using?
问候!
PY
Hi,
我正在使用sdk v_2.0.4.1(我正在使用外围端的ES3芯片)
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;
/* 地址 */
memcpy((void *)&cmd->对等体[0] .addr,
(void *)ptr_discovereddevice-> eport.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)
你好盖头,
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
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?
问候,
Regis
Hello Regis,
现在我们只有一个中央设备示例可用,即使用外部MCU的SDK3.0.4中的接近监视器。我们有一个无线充电解决方案,我们已经测试了多个连接。我将不得不与SW谈谈,了解他们在Proximity App中测试了多少奴隶:我们在我们的核心中跛行。
BR JE_Dialog
Hi,
是的,我知道芯片限于6个同时连接。在我的申请中,我只需要5个同时连接。
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.
问候,
Régis
Hi Regis,
Do you used the same BD address for those two peripherals?
问候!
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},
....
问候,
Regis
Hello Regis,
抱歉延迟响应:我可以确认我们已经测试了6个连接的中心角色(接近):这是运行外部MCU,而不是完全嵌入,并且仅在SDK3.0.2或更高版本上测试 - 因此需要生产硅。在最新的SDK中还有一个完全嵌入到DA14580中的核心角色的示例,dk_apps \ keil_projects \ antiput_eval \ antiput_eval_peripheral_fh。
我们可以使用生产设备交换您的开发板。与生产设备运行不同旧版本的工程芯片,使用特定的SDK工作将使事情更加复杂。如果您想交换开发板,请告诉我:我可以安排。
BR JE_Dialog
是的,我希望使用生产设备的电路板换我的开发板,因为我对此ES3芯片有很多问题。
What is the process to change my development boards?
问候,
Régis
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.
在这里,我有两个建议:
正如JE_DIALOG所建议的那样,我强烈建议您更改为最新的平台和SDK。新的硅和SDK更耗尽,并且还有更好的工具支持。
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.
问候!
PY