嗨对话框,
I am trying to define my function for the scanning the package over the air, I have checked the document and made my function as the following. My question, where and how should I degine my White List for the scanning?
void扫描仪(空白)
{
struct gapm_start_scan_cmd *cmd = KE_MSG_ALLOC(GAPM_START_SCAN_CMD,
task_gapm,task_app,
gapm_start_scan_cmd);
cmd-> op.code = gapm_scan_passive;
cmd->间隔= 4000;// 10s.
cmd->窗口= 4000;// 10s.
cmd->mode = GAP_GEN_DISCOVERY;
cmd-> filt_policy = scan_allow_adv_wlst;
cmd->filter_duplic = SCAN_FILT_DUPLIC_DIS;
ke_msg_send(cmd);
}
Device:

嗨Liuluan002,
请查看RW-BLE-GAP-IS用于GAPM_WHITE_LIST_MGT_CMD以此方式,您可以管理您在带列表中的设备。您可以使用以下代码段使用的内容
void manage_white_list(void)
{
UINT8_T WHITE_ADDR [6] = {0x01,0x00,0x00,0xca,0xea,0x80};
struct gapm_white_list_mgt_cmd *cmd = KE_MSG_ALLOC_DYN(GAPM_WHITE_LIST_MGT_CMD,
TASK_GAPM,
TASK_APP,
gapm_white_list_mgt_cmd,
sizeof(struct gap_bdaddr));
cmd->operation = GAPM_ADD_DEV_IN_WLIST;
cmd-> nb = 1;
Memcpy((void *)&cmd->设备[0] .addr,(void *)white_addr,bd_addr_len);
ke_msg_send(cmd);
}
Thanks MT_dialog
thank you. One more questions.
当我尝试从以下功能进行广播时:通过将不同的包广播到空中,每10ms。是否有可能使广播不同的包装快于10ms?如果我使它快速播放,则会有没有影响力使广播过程失败?接收侧扫描是否有问题?
void set_adv_func(struct gapm_start_advertise_cmd * cmd,uint8_t * data,uint8_t len)
{
如果(Len> 26)
{
len = 26;
}
cmd->op.code = GAPM_ADV_UNDIRECT;
cmd-> op.addr_src = gapm_public_addr;
cmd-> intv_min = 16;// 32 * 0.625 = 20ms;
cmd->intv_max = 16; //
cmd->channel_map = 0x01;//channel 37
cmd-> info.host.mode = gap_gen_disoverable;//一般可发现模式
// /*-----------------------------------------------------------------------------------
// * Set the Advertising Data and the Scan Response Data
// * -------------------------------------------------------------------- * /
cmd-> info.host.adata_len = app_add_data_max_size;
cmd->info.host.scan_rsp_data_len = 0; //no response to the scanning
如果((数据! = NULL)&& (len >0))
{
memcpy (cmd - > info.host.adv_data +2, data, len);
cmd-> info.host.adv_data_len = len + 2;
cmd->info.host.adv_data[0] = len + 1;
}
别的
{
#if DEBUG_LOG2
printf_string("\r\nEmpty input so load Data1:");
UART2_INIT(UART_BAUDRATE_115K2,3);
#万一
memcpy(cmd-> info.host.adv_data + 2,数据,26);
cmd->info.host.adv_data_len= len+2;
cmd->info.host.adv_data[0] = len + 1;
}
//update the data for broadcasting each 10*1ms
ke_timer_set(APP_DYNAMIC_ADV_DATA, TASK_APP, 1);
return;
}
嗨对话框,
我用以下代码测试了白色列表
In the app_task.c, I have write the following:
void app_scan(void)
{
manage_white_list();
struct gapm_start_scan_cmd *cmd = KE_MSG_ALLOC(GAPM_START_SCAN_CMD,
task_gapm,task_app,
gapm_start_scan_cmd);
cmd-> op.code = gapm_scan_passive;
cmd->interval= 4800;
cmd->window = 4800;
cmd->mode = GAP_GEN_DISCOVERY;
cmd-> filt_policy = scan_allow_adv_wlst,
cmd->filter_duplic = SCAN_FILT_DUPLIC_DIS;
//发送消息
ke_msg_send(cmd);
}
When I try to call the app_scan, the first time it works, the second time it does not works, the third time works.... I have found it only works for the odd times. For the even times, it does not works. Could you please help?
嗨Liuluan002,
What do you mean when you say that "it doesn't work", it retruns any device advertising at the moment or it doesn't return anything ? I am issuing scans via external interrupts using a button using your scan configuration, the device seems to be returning the device in the white list in every press (please check it by using a break point in the advertising indication user_on_adv_report_ind() function). Also i would advice you, not to place the addition of the a new device in the scan request function. Every time you are issuing a scan i suppose that you are adding the same device (i am not aware if this can cause you any trouble). Please have a look at the keyboard reference design in the app_white_list.c file, it uses the white list feature, perhaps you will find it usefull.
Thanks MT_dialog
嗨对话框,
I means "did not work" is the scanning do not returning back anything. If I put the function "manage_white_list()" into my "app_scan()" each time when it is running, the first time it is scanning fine, the second time after the timer reset "ke_timer_set(APP_SWITCH_ROLE_TIMER, TASK_APP, 250); and ke_timer_set(APP_SWITCH_ROLE_TIMER, TASK_APP, 20);" it seems the scanning returns back nothing. Also this keeps continue returning the next time works for scanning, the next next time did not works for scanning(this phenomenon keeps on continuing).
如果我只使用“manage_white_list()”函数一次,下次由timer“ke_timer_set(app_switch_role_timer,task_app,250);”并重新加载“app_scan()”函数,它将返回任何内容。接下来,当我再次执行GAPM_RESET时,然后使用“app_scan”仍然返回任何内容。
这是我的代码的一些部分
在app_task.c:
//设备配置更新
case GAPM_SET_DEV_CONFIG:
{
if(param->status != GAP_ERR_NO_ERROR)
{
ASSERT_ERR(0); // unexpected error
}
别的
{
if( 0 == current_role)
{
//Advertisement
EXECUTE_CALLBACK_VOID(app_on_set_dev_config_complete);
}
别的
{
//扫描
app_scan();
}
if( 0 == current_role)
{
ke_timer_set(app_switch_role_timer,task_app,20);
}
if( 1 == current_role)
{
ke_timer_set(app_switch_role_timer,task_app,250);
}
}
}
break;
void manage_white_list(void)
{
struct gapm_white_list_mgt_cmd *cmd = KE_MSG_ALLOC_DYN(GAPM_WHITE_LIST_MGT_CMD,
TASK_GAPM,
TASK_APP,
gapm_white_list_mgt_cmd,
sizeof(struct gap_bdaddr));
cmd->operation = GAPM_ADD_DEV_IN_WLIST;
cmd-> nb = 1;
Memcpy((void *)&cmd->设备[0] .addr,(void *)white_addr,bd_addr_len);
ke_msg_send(cmd);
}
volatile uint8_t white_flag;
void app_scan(void)
{
if( 0 == white_flag)
{
manage_white_list();
white_flag = 5;
}
struct gapm_start_scan_cmd *cmd = KE_MSG_ALLOC(GAPM_START_SCAN_CMD,
task_gapm,task_app,
gapm_start_scan_cmd);
cmd-> op.code = gapm_scan_passive;
cmd->interval= 4800;
cmd->window = 4800;
cmd->mode = GAP_GEN_DISCOVERY;
cmd-> filt_policy = scan_allow_adv_wlst,
cmd->filter_duplic = SCAN_FILT_DUPLIC_DIS;
ke_msg_send(cmd);
}
In app.c, we have:
volatile uint8_t current_role = 1; //0±íʾÔÚ×ö¹ã²¥£¬1±íʾÔÚ×öɨÃè
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->role = user_gapm_conf.role;
current_role = 0;
}else{
cmd->role = GAP_CENTRAL_MST;
current_role = 1;
}
cmd->appearance = 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);
}
别的
memcpy((void *)cmd,(void *)和default_set_dev_config,sizeof(struct gapm_set_dev_config_cmd));
}
return (set_dev_config_cmd);
}
嗨Liuluan002,
Since you are alternate between roles i am not sure that this is something caused by the white list, please remove the white list management and try to scan and get back whatever bd addresses you can find. When you are in your second attempt where you can't find any advertising by your device are you able to scan at all ? I mean from your code your device is configured as a peripheral every second time and peripherals cant scan at all (if theuser_gapm_conf.role is agap_peripheral_slv)。
Thanks MT_dialog
嗨对话框,
我没有使用Gap_peripheral_slv,当它扫描时,我的角色切换函数被写入以下内容:
volatile uint8_t current_role = 1; //0±íʾÔÚ×ö¹ã²¥£¬1±íʾÔÚ×öɨÃè
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->role = user_gapm_conf.role;
current_role = 0;
}else
{
cmd->role = GAP_CENTRAL_MST;
current_role = 1;
}
cmd->appearance = 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);
}
别的
memcpy((void *)cmd,(void *)和default_set_dev_config,sizeof(struct gapm_set_dev_config_cmd));
}
return (set_dev_config_cmd);
}
Now I trying to changing the code only running for the scanning, but sometimes it can not got anything during the period of scanning. However most time it can got the result from the scanning.
case GAPM_SET_DEV_CONFIG:
{
if(param->status != GAP_ERR_NO_ERROR)
{
ASSERT_ERR(0); // unexpected error
}
别的
{
if( 0 == current_role)
{
EXECUTE_CALLBACK_VOID(app_on_set_dev_config_complete);
}
别的
{
app_scan();
position11 ++;
}
if( 0 == current_role)
{
ke_timer_set(APP_SWITCH_ROLE_TIMER, TASK_APP, 0);
}
if( 1 == current_role)
{
ke_timer_set(app_switch_role_timer,task_app,250);
}
}
}
break;
以下是日志
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 A0 0201061B007F1000000001003E01003E01FF3C01003E01003E01FF3E02FF3E
T2=00000CFC
addr:80EACA000049 A0 0201061B00801000000001003D00013F01FE3D01003E02003E01003D01FE3C
T2=00000D0D
addr:80EACA000049 A0 0201061B00811000000001FF3D01013E00003E01003D02FE3E01FF3D02003E
t2 = 00000d1d.
ADDR:80EACA000049 A0 0201061B00821000000000000000000/201F00000000003D01FF3D01F0000
t2 = 00000d2e.
GAPM_RESET:
start adv A
BCT1 = 06.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 A0 0201061B00831000000001003E01FF3E02FF3E01003E01003D01003E01003E
T2=00000CE4
addr:80EACA000049 A0 0201061B00841000000001003D01003E02FF3F02013E01FF3E01003D01FF3E
T2=00000CF4
addr:80EACA000049 9F 0201061B00851000000001003D01003E01003F02FF3F01003D01003D02003D
t2 = 00000d05.
ADDR:80EACA000049 A0 0201061B0086100000000002FF3D01003D02FF3C01003D01003D00000000000000
T2=00000D16
GAPM_RESET:
start adv A
BCT1 = 07.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 9F 0201061B00871000000001003D02FF3E02FF3E01003D01FF3E01003E01FF3E
t2 = 00000ccc.
addr:80EACA000049 9F 0201061B00881000000001FF3D01FF3D01FF3E01013D02003D01FF3D01FF3E
t2 = 00000cdc.
ADDR:80EACA000049 9F 0201061B008910000003D01003D02003D02003D02003D02003D02003D02003D02003D01003D
T2=00000CED
ADDR:80EACA000049 9F 0201061B008A1000000000013D02003E01FF3F01003D01FF3C00000000000000
T2=00000CFD
GAPM_RESET:
start adv A
BCT1 = 08.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
GAPM_RESET:
start adv A
你好消息
BCT1 = 09年
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 A0 0201061B008F1000000001003D01003D01FF3E01FF3D02003C02FF3E01003D
T2=00000C98
ADDR:80EACA000049 A0 0201061003E01FF3E01FF3F01FF3D01003D01003E01003C
t2 = 00000ca9.
addr:80EACA000049 A0 0201061B00911000000002003D01003E01003E02FF3D02FF3F02FF3D01013D
t2 = 00000cb9.
ADDR:80EACA000049 A0 0201061B00921000000003D00003E02003F00013D00000000000000
t2 = 00000cca.
GAPM_RESET:
start adv A
BCT1 = 0A
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A0 020101000013D02013D02F3E02FE3E02003E01003E00003E
t2 = 00000c80.
ADDR:80EACA000049 A0 0201061FF3E01003D02004002FF3D01FF3E02FF3F01FF3E
T2=00000C90
addr:80EACA000049 A0 0201061B00951000000002003E01003E01FF3D01003D02003D02003E02FF3E
t2 = 00000ca1.
addr:80EACA000049 A0 0201061B00961000000001FF3F01003E01003D01003D02FE3B000000000000
t2 = 00000cb2.
GAPM_RESET:
start adv A
BCT1 = 0B.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A2 0201061B0097100003D01003E02003D01003F01003E
t2 = 00000c68.
addr:80EACA000049 A2 0201061B00981000000001003F01FF3E02003E02003D01FF3E01FF3E01003E
t2 = 00000c78.
addr:80EACA000049 A2 0201061B00991000000002003E01003D02003E01003E02003D01003E01003D
t2 = 00000c89.
ADDR:80EACA000049 A2 0201061B009A10000000000000000/201000000000000/201003D02003E02FF3E02003e
T2=00000C99
GAPM_RESET:
start adv A
BCT1 = 0C.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A2 0201061B009C10000003C2003CY02003E02003D
t2 = 00000c4f.
addr:80EACA000049 A2 0201061B009D1000000001003D02003E01003D01003D01003D01003D02FF3E
t2 = 00000c60.
addr:80EACA000049 A2 0201061B009E1000000001FF3E01003D01FF3E01003E02FF3D02FF3E01FF3E
t2 = 00000c70.
ADDR:80EACA000049 A2 0201061B009F10000000000000000/201F3E01003D0100000000000000
t2 = 00000c81.
GAPM_RESET:
start adv A
BCT1 = 0d.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A2 0201061B00A010000000000001003D02FF3E02FF3E02003D02003E01003F01003CE
t2 = 00000c37.
addr:80EACA000049 A2 0201061B00A11000000001013D01003E01003E02FF3D02003D01003E01FF3D
t2 = 00000c47.
addr:80EACA000049 A2 0201061B00A21000000001003D01FF3E02003E02013E01FF3E02003F01013E
t2 = 00000c58.
ADDR:80EACA000049 A2 0201061B00A31000000003CO2003D00000000000000
t2 = 00000c69.
GAPM_RESET:
start adv A
bct1 = 0e.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 A2 0201061B00A41000000002013D02FF3D01003D02003E01FF3E02003D01FF3E
t2 = 00000c1e.
ADDR:80EACA000049 A2 0201061B00A5100000000001003E02003E0190301003CE01003D01003D01003D01003D01003C
t2 = 00000c2f.
ADDR:80EACA000049 A2 0201061B00A6100000000001FF3E02013E01FF3F02FF3D01013E01FF3E01FF3E
t2 = 00000c40.
addr:80EACA000049 A2 0201061B00A71000000002003E01003D02003F02FF3E01FF3E000000000000
t2 = 00000c50.
GAPM_RESET:
start adv A
BCT1 = 0f.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A2 0201061B00A8100000000001FF3E02FF3D01003E02003E02003E
t2 = 00000c06.
addr:80EACA000049 A2 0201061B00A91000000002FF3D01003E01003D01003D02003E01013E02003D
T2 = 00000C17.
ADDR:80EACA000049 A2 0201061B00AA100000000003D01003D01003D01FF3E01FF3E00003C
t2 = 00000c27.
ADDR:80EACA000049 A2 0201061B00AB100000000001FF3E02003D02003D01003D01003D00000000000000
t2 = 00000c38.
GAPM_RESET:
start adv A
BCT1 = 10.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 A2 0201061B00AC10000003F02003D01FF3E02003D01003F02003D01003F02003d01003e02003e
T2 = 00000Bee.
addr:80EACA000049 A2 0201061B00AD1000000002FF3E02003E01FF3E02FF3E01003F02003E02003E
T2=00000BFE
addr:80EACA000049 A2 0201061B00AE1000000002003D01003E02003D01003E01FF3D02003D02003E
t2 = 00000c.
addr:80EACA000049 A2 0201061B00AF1000000001003F01FF3E01003D01003E02FF3E000000000000
t2 = 00000c20.
GAPM_RESET:
嗨对话框,
您有一个例子是否在白色列表中添加了3个地址?
怎么做?
Thank you
嗨Liuluan002,
根据BLE规格的最小广告间隔为20ms,堆栈不会让您在10ms中进行宣传。我假设您使用计时器停止广告,并在计时器经过时发出app_adv_start。与指定的间隔无关。如果你想要更快地进行Trasmit(你是出于BLE规范,我们无法知道可能发生的问题)您可以等待BLE广告活动完成,停止广告,更改字符串,并再次启动。您可以通过检查App_Asynch_trm()函数中的信标参考设计来检查这是如何完成的(跟踪广告事件的末尾)。
Thanks MT_dialog
也是当我试图用的时候the active scanning, the system will restart after a while of scanning. Also it pop up with some packages which is all zeros.
void app_scan(void)
{
struct gapm_start_scan_cmd *cmd = KE_MSG_ALLOC(GAPM_START_SCAN_CMD,
task_gapm,task_app,
gapm_start_scan_cmd);
cmd-> op.code = gapm_scan_passive;
cmd->op.code = GAPM_SCAN_ACTIVE;
cmd->间隔= 9600;
cmd->window = 9600;
cmd->mode = GAP_GEN_DISCOVERY;
cmd-> filt_policy = scan_allow_adv_wlst,
cmd->filter_duplic = SCAN_FILT_DUPLIC_DIS;
ke_msg_send(cmd);
}
以下是日志:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 B5 0201061B00CF10000000FFFEC300FEC2FEFEC3FFFEC2FFFEC3FFFEC4FFFEC2
t2 = 000009ca.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009da.
ADDR:80EACA000049 B4 0201061B00D010000000FEFEC3FFFDC4FFEC3FEFEC3FEFEC3FEFEC3FEFEC3
T2=000009EB
地址:80EACA000049 B4 00000000000000000000000000000000000000000000000000000000000000
T2=000009FC
ADDR:80EACA000049 B5 0201061B00D1100000000000FFEC3FFEC3FFFDC3FEFEC3FEFEC3FEFFC3FEFEC3
t2 = 00000a0e.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 00000a1e.
ADDR:80EACA000049 B5 0201061B00D210000000FEFEC3FFFDC3FFFEC2FFFDC3FFFEC300000000000000
t2 = 00000a2f.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000A40
GAPM_RESET:
start adv A
BCT1 = 14.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 B5 0201061B00D410000000FEFEC4FEFFC3FFFEC4FEFEC4FFFEC3FEFEC3FFFEC3
t2 = 000009d1.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009e2.
ADDR:80EACA000049 B5 0201061B00D510000000FEFEC3FFEC3FEFFC4FFFEC3FEFEC4FEFDC3FEFEC4
T2=000009F3
地址:80EACA000049 B4 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000A03.
GAPM_RESET:
start adv A
BCT1 = 15.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 B5 0201061B00D710000000FFFDC3FEFFC3FFFFC3FFFDC4FEFFC2FFFEC2FFFEC3
T2 = 00000999.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 000009AA.
ADDR:80EACA000049 B4 0201061B00D8100000000000FFC4FFEC4FEFEC3FEFEC4FFFEC3FFFEC3FEFFC3
t2 = 000009ba.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009cb.
ADDR:80EACA000049 B5 0201061B00D91000000000FFFC3FEFFC3FFEC3FEFEC3FFFEC4FEFDC4FFEC3
t2 = 000009dd.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=000009EE
ADDR:80EACA000049 B5 0201061B00DA1000000000FFC3FEFEC3FFFEC3FFEC3FFFFC400000000000000
T2=000009FE
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000A0F.
GAPM_RESET:
start adv A
BCT1 = 16.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
ADDR:80EACA000049 B5 0201061B00DB1000000000FFFFC4FEFEC3FEFDC3FEFDC3FEFEC3FEFEC2FEFEC3
T2=00000981
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 00000991.
addr:80EACA000049 B4 0201061B00DC10000000FEFEC4FEFDC3FFFEC3FFFEC3FEFEC3FEFDC3FFFEC3
t2 = 000009a2.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009b3.
ADDR:80EACA000049 B4 0201061B00DD10000000FEFFC3FEFEC3FFEC3FFFDC3FFFEC3FEFEC3FFEC2
T2 = 000009C5
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009d5.
ADDR:80EACA000049 B4 0201061B00DE10000000FEFDC3FFEC2FFEC3FEFFC4FEFEC300000000000000
t2 = 000009e6.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=000009F7
GAPM_RESET:
start adv A
BCT1 = 17.
GAPM_RESET:
开始扫描H.
Size white S
尺寸白色l = 00000009
addr:80EACA000049 B4 0201061B00DF10000000FEFEC3FFFEC3FFFEC3FEFEC3FEFEC4FFFEC2FFFEC3
T2=00000968
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=00000979
ADDR:80EACA000049 B5 0201061B00E010000000FEFEC3FFEC3FFFec4FFEC3FFEC3FFFEC3FEFEC2
T2=00000989
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 0000099A.
ADDR:80EACA000049 B4 0201061B00E11000000000FFFCC3FFEC3FEFDC2FEFFC300FEC3FFFDC4FFEC4
t2 = 000009ac.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 000009BD.
ADDR:80EACA000049 B4 0201061B00E21000000000FFC4FEFEC4FFEC3FEFEC3FEFDC4000000000000
t2 = 000009ce.
addr:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009de.
GAPM_RESET:
`device_init done
GAPM_RESET:
start adv A
GAPM_RESET:
嗨Liuluan002,
从您的初始代码中,我可以看到,每当您发出GAPM_RESET_CMD时,您正在更改user_gapm_conf.role之间的角色(如果不是gap_peripheral_slv的值是什么?重置。您提到的是,白色名单在每个奇数中都有工作,您可以获得一些数据,以缩小问题请不要使用白色列表,但尝试扫描目前广告的所有可用设备才能确保你确实扫描了。
The problem might be your UART printing as well (that is if you are using the arch_printf() function in order to print data), in the schedule_while_ble_on() in the arch_main.c file try to place the code in the snippet and remove the if (app_async_trm()) break; and the arch_printf_process();
if(app_asynch_trm()))
{
继续;
}
别的
{
ARCH_PRINTF_PROCESS();
break;
}
关于你的问题,有时你没有得到任何广告,你是否确定你的设备是广告的吗?而且我也注意到你的扫描窗口只要你的间隔长,这意味着你只听一个很长一段时间的广告频道,尝试减少你的窗口和你的间隔,以收听所有三个广告渠道经常在扫描时可能会在那个特定频道上进行混淆。此外,由于UART打印可能会发生这种情况,请尝试使用断点而不是UART打印来捕获广告迹象,以确保。最后或许在执行扫描时可能有两个空中活动,没有广告可以完整地联系您的接收器,因此您不会得到任何指示。
关于您获得的零,是从您发送到外围设备的扫描请求的数据,那些是外围设备的扫描响应数据。
Thanks MT_dialog
我删除了白色列表,and start to scanning and checking without package lost in the scanning period, seems it works. The problem i guess it is the function you have provide for white list may cause the problem.
Do you means 14583 may go into the mode not GAP_PERIPHERAL_SLV, and either not GAP_CENTRAL_MST, which do you means may triggers it can not scan anything from the broadcasting package?
如果我使用白色列表,它似乎有效为70%的时间,一些时期无法扫描任何内容。(现在它不是偶数和奇怪的问题)
I have tested the following code today, seems it does not helps to improve the package lost in the scanning.
if(app_asynch_trm()))
{
继续;
}
别的
{
ARCH_PRINTF_PROCESS();
break;
}
您是否有可能帮助我们检查一部分代码?我可以收到您的电子邮件并将其发送给您吗?
你的意思是gap_peripherwal_slv
嗨Liuluan002,
在您的设备中,您正在更改角色,从GAP_Central_mst到配置文件中定义的其他内容,您指示设备在获得重置后将其指示更改的其他角色是什么?此变量中的其他角色user_gapm_conf.role是什么?
if(user_config)
{
cmd->操作= gapm_set_dev_config;
if(1 == current_role){
cmd->role = user_gapm_conf.role;
current_role = 0;
}else
{
cmd->role = GAP_CENTRAL_MST;
current_role = 1;
}
Also regarding the white list, there is an implementation of the white list in the keyboard reference design in the app_white_list.c in the send_white_list_mgt_cmd() function, you can have a look at this.
Thanks MT_dialog
我认为它是Gap_peripheral_slv,我在user_config.h中找到了以下内容。
static const结构gapm_configuration user_gapm_conf = {
。role = GAP_PERIPHERAL_SLV,
.irk = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
/// Device Appearance (0x0000 - Unknown appearance)
//根据填写https://developer.bluetooth.org/gatt/characteristics/Pages/Characteristi...
.appearance = 0,
.appearance_write_perm = gapm_write_disable,
.name_write_perm = gapm_write_disable,
/// maximal mtu.
.max_mtu = 23,
/// Peripheral only: *****************************************************************
/// Slave preferred Minimum of connection interval measured in ble double slots (1.25ms)
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.con_intv_min = ms_to_doubleslots(10),
///从位于BLE双槽(1.25ms)中测量的连接间隔的最优选的最大值
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.con_intv_max = ms_to_doubleslots(20),
///从属喜欢连接延迟。它在跳过的连接事件中测量
。con_latency = 0,
/// Slave preferred Link supervision timeout measured in timer units (10 ms)
/// use the macro MS_TO_TIMERUNITS to convert from milliseconds (ms) to timer units
.superv_to = ms_to_timerUnits(1000),
///隐私设置位字段(0b1 =启用,0b0 =禁用)
/// - [位0]:隐私支持
/// - [位1]:多键支持(仅限外围设备);如果已启用,隐私标志是
/// 只读。
/// - [位2]:重新连接地址可见。
.flags = 0.
};
嗨Liuluan002,
要诚实地我没有明白你想要做什么,你正在执行角色切换到角色,一个是中心,另一个是外围设备,外围不能执行扫描过程。因此,由于您只是扫描为什么您需要此额外代码的角色切换。即使在attemp中切换到attemp以复制您的问题,我也使一个在按钮按下发出角色开关的设备,包括白色列表的扫描过程并没有显示任何类型的手机,并且始终返回正确的设备。请尝试制作一个简单的扫描仪,没有基于DSPS主机应用程序的角色切换,然后您可以应用白色列表并测试它。
Thanks MT_dialog
Hi,
我正在执行角色切换是因为我想制作一个用于扩展广播包的距离的转发器。当我从扫描中获取广告包时,我只需通过向下的角色交换机重复我。
嗨对话框,
您有一个例子是否在白色列表中添加了3个地址?
怎么做?
Thank you
嗨Liuluan002,
The only project that uses the white list, virtual or the actual white list of the BLE stack is the keyboard, there isn't any example that adds explictly 3 devices.
Thanks MT_dialog