您好对话支持!
我们希望在DA14580上实现角色交换:
当系统靴子开始在advisising模式下:GAP_PERITELAL_SLV可以从移动设备连接到从移动设备获取数据,我们做到了
cmd->操作= gapm_reset;
到堆栈并设置设备角色cmd->角色= gap_central_mst;
然后,将连接到第二SPS_DEVICE和数据之后的数据,之后将该设备1切换回GAP_PERITELAL_SLV以进行广告并再次等待连接。
我们使用SPS_DEVICE项目示例并修改以下内容:
1。尝试角色交换实施请起动最佳解决方案:
app.c.
static struct stable gapm_set_dev_config_cmd * app_easy_gap_dev_config_create_msg(void)
{
//分配用于GAP的消息
if(set_dev_config_cmd == null)
{
struct gapm_set_dev_config_cmd * cmd;
cmd = app_gapm_configure_msg_create();
set_dev_config_cmd = cmd;
cmd->操作= gapm_set_dev_config;
cmd->角色= user_gapm_conf.role;
memcpy(cmd-> irk.key,user_gapm_conf.irk,key_len * sizeof(uint8_t));
cmd-> seepent = user_gapm_conf.appearance;
cmd-> sepent_write_perm = user_gapm_conf.appearance_write_perm;
cmd-> name_write_perm = user_gapm_conf.name_write_perm;
cmd-> max_mtu = user_gapm_conf.max_mtu;
cmd-> con_intv_min = user_gapm_conf.con_intv_min;
cmd-> con_intv_max = user_gapm_conf.con_intv_max;
cmd-> con_latency = user_gapm_conf.con_latency;
cmd-> supmen_to = user_gapm_conf.superv_to;
cmd->标志= user_gapm_conf.flags;
cmd->操作= gapm_reset;// Marios编辑
cmd->角色= gap_central_mst;// Marios编辑
}
返回(set_dev_config_cmd);
}
2。尝试实施请起至最佳解决方案:
app.c.
volatile uint8_t current_role = 1;// Marios编辑15/11/2020
static struct stable gapm_set_dev_config_cmd * app_easy_gap_dev_config_create_msg(void)
{
//分配用于GAP的消息
if(set_dev_config_cmd == null)
{
struct gapm_set_dev_config_cmd * cmd;
cmd = app_gapm_configure_msg_create();
set_dev_config_cmd = cmd;
if(user_config)
{
cmd->操作= gapm_set_dev_config;
if( 1 == current_role ){
cmd->角色= user_gapm_conf.role; // cunent角色是gap_peripheral_slv系统开始广告!Marios编辑
current_role = 0;
}别的{
cmd->角色= gap_central_mst;// CURENT角色是GAP_CENTRAL_MST系统开始扫描!Marios编辑
current_role = 1;
}
cmd-> seepent = user_gapm_conf.appearance;
cmd-> sepent_write_perm = user_gapm_conf.appearance_write_perm;
cmd-> name_write_perm = user_gapm_conf.name_write_perm;
cmd-> max_mtu = user_gapm_conf.max_mtu;
cmd-> con_intv_min = user_gapm_conf.con_intv_min;
cmd-> con_intv_max = user_gapm_conf.con_intv_max;
cmd-> con_latency = user_gapm_conf.con_latency;
cmd-> supmen_to = user_gapm_conf.superv_to;
cmd->标志= user_gapm_conf.flags;
memcpy(cmd-> irk.key,user_gapm_conf.irk,key_len);
}
}
返回(set_dev_config_cmd);
}
我们正在等待您的预辅助寿命!
提前致谢,
Marios
嗨Marios:
Before getting into the details of your question, can you please provide the following information:
你使用da14580吗?
2.您使用的是哪个SDK版本?
Thanks,
tr_dialog.
你好tr_dialog!
是的,我正在使用da14580和sdk 5.0.4版本
是任何较新版本是否可移?
提前致谢,
Marios
嗨腻过,
我强烈建议不要修改DSP,因为它得到的支持是对话框。由于您想执行角色交换机,我的建议将从任何SDK BLE示例开始(例如Prox_reporter)。
请检查下面的机票以查找如何实现角色切换的准则:
https://support.dialog-semicondiondiondimicon.com/forums/post/dialog-martbond-bluetooth-low-energy-42-%e2%80%93-software/dynamic-adv-data-scan.
The DSPS is a dedicated reference design that emulates a serial cable communication and supports point to point connection. If you still need to do it in the DSPS, this will not be a straight-forward implementation, as you should port all the DSP functionality from the sps_device to sps_host and implement it by you own.
如果您正在启动新的设计/项目,我们将强烈建议首先以DA14531或DA14585 / 586产品和我们最新的SDK6.0.14开始,因为它更加提高。雷电竞官网登录我们有很多代码示例和改进的文档,还有软件路线图支持。DA14580产品系列和SDK5没有软件路线图支持。
请查看DA14531:
https://www.dialog-seminile.com/produ雷电竞官网登录cts/connectivity/bluetooth-low-energy/products/da14531
我们还有一个DA14531模块,即DA14531 SmartBond Tiny™模块!它具有很小的尺寸,功率非常低。按照下面的链接查找模块的数据表,文档和HW抵消:
https://www.dialog-seminile.com/produ雷电竞官网登录cts/bluetooth-module-da14531-smartbond-tiny.
The specific application might be much easier to be developed if the new CodeLess was used.
https://www.dialog-seminile.com/produ雷电竞官网登录cts/smartbond-codeless-commands.
它支持二进制MOPE,因此您可以具有DSP功能,并且您可以通过在命令中执行适当执行的角色切换。
http://lpccs-docs.dialog-semicondiond.com/um-140-da145x-codeless/binarymode.html.
http://lpccs-docs.dialog-semicondiond.com/um-140-da145x-codeless/demo.html.
谢谢,PM_DIALOG.