如何使用白色列表进行扫描

19 posts / 0 new
Last post
liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
如何使用白色列表进行扫描

嗨对话框,

我正在尝试通过空中定义扫描包的功能,我已经检查了文档并使我的功能如下。我的问题,在哪里以及如何向扫描扫描我的白色列表?

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->interval = 4000; //10s
cmd->window = 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:
mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨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

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
谢谢你。还有一个问题

谢谢你。还有一个问题。
当我尝试从以下功能进行广播时:通过将不同的包广播到空中,每10ms。是否有可能使广播不同的包装快于10ms?如果我使它快速播放,则会有没有影响力使广播过程失败?接收侧扫描是否有问题?

void set_adv_func(struct gapm_start_advertise_cmd * cmd,uint8_t * data,uint8_t len)
{
if ( 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; //通道37

cmd-> info.host.mode = gap_gen_disoverable;//一般可发现模式

// /*-----------------------------------------------------------------------------------
// *设置广告数据和扫描响应数据
// *---------------------------------------------------------------------------------*/
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,数据,len);
cmd-> info.host.adv_data_len = len + 2;
cmd-> info.host.adv_data [0] = len + 1;
}

别的
{
#if DEBUG_LOG2
printf_string(“\ r \ nempty输入所以加载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;
}
//更新每个10 * 1ms的广播数据
ke_timer_set(app_dynamic_addata,task_app,1);
return;
}

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
Hi DIalog,

Hi DIalog,

I have tested the white list with the following code
在app_task.c中,我写了以下内容:

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);
}

当我尝试调用app_scan时,它第一次工作,第二次它不起作用,第三次工作....我发现它只找到了奇数时间。偶数,它不起作用。能否请你帮忙?

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨Liuluan002,

当你说“它不起作用”时,你是什么意思是,它在此时重新撤回任何设备广告,否则它不会返回任何东西?我正在使用扫描配置使用一个按钮通过外部中断发出扫描,设备似乎在每次按下返回白色列表中的设备(请通过使用广告指示user_on_adv_report_ind()函数中的断点检查它)。此外,我会建议您,不要在扫描请求功能中添加一个新设备。每次发出扫描时,我都认为您正在添加相同的设备(如果这可能导致您有任何问题,我不知道)。请查看app_white_list.c文件中的键盘参考设计,它使用白色列表功能,或许您会发现它有用。

Thanks MT_dialog

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
嗨对话框,

嗨对话框,

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”仍然返回任何内容。

Here is some part of my code

在app_task.c:

// device configuration updated
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);
}

别的
{
//scanning
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);
}
}
}
休息;

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);
}

在App.c中,我们有:

volatile uint8_t current_role = 1;// 0±í¾¾¾ú×ֹò¥£1±í¾¾ôú×Öé¨ãè
static struct stable gapm_set_dev_config_cmd * app_easy_gap_dev_config_create_msg(void)
{
// Allocate a message for 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->operation = GAPM_SET_DEV_CONFIG;

if(1 == current_role){

cmd->role = user_gapm_conf.role;
current_role = 0;

}别的{
cmd->role = GAP_CENTRAL_MST;
current_role = 1;
}
cmd-> seepent = user_gapm_conf.appearance;
cmd->appearance_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->superv_to = user_gapm_conf.superv_to;
cmd->flags = 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));
}
返回(set_dev_config_cmd);
}

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨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

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
嗨对话框,

嗨对话框,

我没有使用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)
{
// Allocate a message for 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->operation = 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-> seepent = user_gapm_conf.appearance;
cmd->appearance_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->superv_to = user_gapm_conf.superv_to;
cmd->flags = 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));
}
返回(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);
}
}
}
休息;

The following is the log

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A0 0201061B007F1000000001003E01003E01FF3C01003E01003E01FF3E02FF3E
T2 = 00000CFC
addr:80EACA000049 A0 0201061B00801000000001003D00013F01FE3D01003E02003E01003D01FE3C
t2 = 00000d0d.
ADDR:80EACA000049 A0 0201061B008110000000000001FF3D01013D02FE3E01FF3D02003E
T2=00000D1D
addr:80EACA000049 A0 0201061B00821000000002003D01FF3D01FF3E02003E01003E000000000000
T2=00000D2E
GAPM_RESET:

开始adv A.

BCT1= 06

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A0 0201061B00831000000001003E01FF3E02FF3E01003E01003D01003E01003E
t2 = 00000ce4.
ADDR:80EACA000049 A0 0201061003D01003E02FF3F01003D01FF3E01003D01FF3E
t2 = 00000cf4.
ADDR:80EACA000049 9F 0201061B0085100000000001003D02FF3F01003D01003D02003D
T2=00000D05
ADDR:80EACA000049 A0 0201061B0086100000000002FF3D01003D02FF3C01003D01003D00000000000000
t2 = 00000d16
GAPM_RESET:

开始adv A.

BCT1= 07

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 9F 0201061B0087100000000001003D02FF3E02FF3E01003D01FF3E01003E01FF3E
T2=00000CCC
ADDR:80EACA000049 9F 0201061B0088100000000001FF3D01FF3D01FF3D01F02003D01FF3D01FF30
T2=00000CDC
addr:80EACA000049 9F 0201061B00891000000001003E02003D01003D01003D02003E02003D01003D
t2 = 00000ced.
addr:80EACA000049 9F 0201061B008A1000000001013D02003E01FF3F01003D01FF3C000000000000
t2 = 00000cfd.
GAPM_RESET:

开始adv A.

BCT1= 08

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

GAPM_RESET:

开始adv A.

你好消息

BCT1 = 09.

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 A0 0201061B008F100000000001003D01003D01FF3E01FF3D02003C02FF3E01003D
T2=00000C98
addr:80EACA000049 A0 0201061B00901000000001003E01FF3E01FF3F01FF3D01003D01003E01003E
T2=00000CA9
ADDR:80EACA000049 A0 0201061B00911003CA02FF3D02F3F02FF3D01013D
T2=00000CB9
addr:80EACA000049 A0 0201061B00921000000002003E01003D00003E02003F00013D000000000000
T2=00000CCA
GAPM_RESET:

开始adv A.

BCT1= 0A

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A0 0201061B00931000000000013D02013D02FF3E02FE3E02003E01003E00003E
t2 = 00000c80.
addr:80EACA000049 A0 0201061B00941000000001FF3E01003D02004002FF3D01FF3E02FF3F01FF3E
T2=00000C90
addr:80EACA000049 A0 0201061B00951000000002003E01003E01FF3D01003D02003D02003E02FF3E
T2=00000CA1
addr:80EACA000049 A0 0201061B00961000000001FF3F01003E01003D01003D02FE3B000000000000
T2=00000CB2
GAPM_RESET:

开始adv A.

BCT1= 0B

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A2 0201061B00971000000002FE3B02003E02003D01003E02FF3E01003F01003E
t2 = 00000c68.
addr:80EACA000049 A2 0201061B00981000000001003F01FF3E02003E02003D01FF3E01FF3E01003E
t2 = 00000c78.
addr:80EACA000049 A2 0201061B00991000000002003E01003D02003E01003E02003D01003E01003D
t2 = 00000c89.
ADDR:80EACA000049 A2 0201061B009A10000000000000000/201000000000000/201003D02003E02FF3E02003e
T2=00000C99
GAPM_RESET:

开始adv A.

BCT1= 0C

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A2 0201061B009C1000000002003E02003E01003E02003E02003E01003E02003D
t2 = 00000c4f.
ADDR:80EACA000049 A2 0201061B009D1000000003D01003D01003D01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d01003d02ff3d02ff3d02ff3
t2 = 00000c60.
addr:80EACA000049 A2 0201061B009E1000000001FF3E01003D01FF3E01003E02FF3D02FF3E01FF3E
t2 = 00000c70.
addr:80EACA000049 A2 0201061B009F1000000001003E01FF3E01003D01003E01003D000000000000
t2 = 00000c81.
GAPM_RESET:

开始adv A.

BCT1= 0D

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 A2 0201061B00A010000000000001003D02FF3E02FF3E02003D02003E01003F01003CE
T2=00000C37
ADDR:80EACA000049 A2 0201061B00A1100000000000013d01003e01003d01003e01ff3d01003e01003d01003e01ff3d
T2=00000C47
ADDR:80EACA000049 A2 0201061B00A2100000000000013D01F3E02003E02012003F013CE
t2 = 00000c58.
ADDR:80EACA000049 A2 0201061B00A31000000003CO2003D00000000000000
t2 = 00000c69.
GAPM_RESET:

开始adv A.

BCT1= 0E

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 A2 0201061B00A4100000000002003D02003CA01FF3E02003D01FF3E
t2 = 00000c1e.
addr:80EACA000049 A2 0201061B00A51000000001003E02003E01FF3E01003E01003D01003D01013E
T2=00000C2F
ADDR:80EACA000049 A2 0201061B00A6100000000001FF3E02013E01FF3F02FF3D01013E01FF3E01FF3E
T2=00000C40
ADDR:80EACA000049 A2 0201061B00A71000000003D02003F01003D02003F02FF3E01FF3E00000000000000
t2 = 00000c50.
GAPM_RESET:

开始adv A.

BCT1= 0F

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 A2 0201061B00A81000000001FF3E02FF3D01003E02003E02FF3D02003D02003E
T2=00000C06
地址:80EACA000049 A2 0201061B00A91000000002FF3D01003E01003D01003D02003E01013E02003D
T2 = 00000C17.
ADDR:80EACA000049 A2 0201061B00AA100000000003D01003D01003D01FF3E01FF3E00003C
t2 = 00000c27.
ADDR:80EACA000049 A2 0201061B00AB100000000001FF3E02003D02003D01003D01003D00000000000000
T2=00000C38
GAPM_RESET:

开始adv A.

BCT1= 10

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 A2 0201061B00AC10000003F02003D01FF3E02003D01003F02003D01003F02003d01003e02003e
T2=00000BEE
ADDR:80EACA000049 A2 0201061B00AD1000000002FF3E02003E01FF3E02003E01003F02003E02003E
t2 = 00000bfe.
ADDR:80EACA000049 A2 0201061B00AE100000000002003D01003E01FF3D02003D02003C
T2=00000C0F
addr:80EACA000049 A2 0201061B00AF1000000001003F01FF3E01003D01003E02FF3E000000000000
t2 = 00000c20.
GAPM_RESET:

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
嗨对话框,

嗨对话框,

Do you have an example for adding 3 addresses into the white list?
怎么做?

谢谢

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨Liuluan002,

最小间隔根据广告BLE spec is 20ms, the stack wont let you advertise in 10ms. I assume that you stop the advertsing using the timer and you issue an app_adv_start when the timer elapses. That has nothing to do with the specified interval. If you want to trasmit faster (you are out of the BLE spec so we aren't able to know what problems might occur) you could wait for a BLE advertising event to finish, stop the advertising, change the string, and start once more. You can check how this is done (track the end of an advertising event) by checking the beacon reference design in the app_asynch_trm() function.

Thanks MT_dialog

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
Also When I try to test with

Also When I try to test with 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);
}

The following is the Log:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 B5 0201061B00CF10000000FFFEC300FEC2FEFEC3FFFEC2FFFEC3FFFEC4FFFEC2
t2 = 000009ca.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009da.
addr:80EACA000049 B4 0201061B00D010000000FEFEC3FFFDC4FFFEC3FEFEC3FEFEC3FEFEC3FEFEC3
T2=000009EB
addr:80EACA000049 B4 00000000000000000000000000000000000000000000000000000000000000
T2=000009FC
addr:80EACA000049 B5 0201061B00D110000000FFFEC3FFFEC3FFFDC3FEFEC3FEFEC3FEFFC3FEFEC3
t2 = 00000a0e.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 00000a1e.
addr:80EACA000049 B5 0201061B00D210000000FEFEC3FFFDC3FFFEC2FFFDC3FFFEC3000000000000
t2 = 00000a2f.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000A40
GAPM_RESET:

开始adv A.

BCT1= 14

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 B5 0201061B00D410000000FEFEC4FEFFC3FFEC4FEFEC4FFFEC3FEFEC3FFEC3
t2 = 000009d1.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009e2.
addr:80EACA000049 B5 0201061B00D510000000FEFEC3FFFEC3FEFFC4FFFEC3FEFEC4FEFDC3FEFEC4
T2=000009F3
addr:80EACA000049 B4 00000000000000000000000000000000000000000000000000000000000000
T2=00000A03
GAPM_RESET:

开始adv A.

BCT1= 15

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 B5 0201061B00D71000000000FFFDC3FEFFC3FFFFC3FFFDC4FEFFC2FFCEC2FFFEC3
T2=00000999
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 000009AA.
ADDR:80EACA000049 B4 0201061B00D8100000000000FFC4FFEC4FEFEC3FEFEC4FFFEC3FFFEC3FEFFC3
t2 = 000009ba.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009cb.
ADDR:80EACA000049 B5 0201061B00D91000000000FFFC3FEFFC3FFEC3FEFEC3FFFEC4FEFDC4FFEC3
t2 = 000009dd.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=000009EE
ADDR:80EACA000049 B5 0201061B00DA1000000000FFC3FEFEC3FFFEC3FFEC3FFFFC400000000000000
T2=000009FE
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000A0F.
GAPM_RESET:

开始adv A.

BCT1= 16

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

addr:80EACA000049 B5 0201061B00DB10000000FFFFC4FEFEC3FEFDC3FEFDC3FEFEC3FEFEC2FEFEC3
T2 = 00000981.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=00000991
addr:80EACA000049 B4 0201061B00DC10000000FEFEC4FEFDC3FFFEC3FFFEC3FEFEC3FEFDC3FFFEC3
T2=000009A2
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009b3.
addr:80EACA000049 B4 0201061B00DD10000000FEFFC3FEFEC3FFFEC3FFFDC3FFFEC3FEFEC3FFFEC2
T2 = 000009C5
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009d5.
addr:80EACA000049 B4 0201061B00DE10000000FEFDC3FFFEC2FFFEC3FEFFC4FEFEC3000000000000
t2 = 000009e6.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=000009F7
GAPM_RESET:

开始adv A.

BCT1= 17

GAPM_RESET:

start scan H

Size white S
尺寸白色l = 00000009

ADDR:80EACA000049 B4 0201061B00DF10000000FEFEC3FFFEC3FFEC3FEFEC3FEFEC4FFFEC2FFEC3
T2 = 00000968.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 00000979.
ADDR:80EACA000049 B5 0201061B00E010000000FEFEC3FFEC3FFFec4FFEC3FFEC3FFFEC3FEFEC2
t2 = 00000989.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2=0000099A
addr:80EACA000049 B4 0201061B00E110000000FFFFC3FFFEC3FEFDC2FEFFC300FEC3FFFDC4FFFEC4
t2 = 000009ac.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
T2 = 000009BD.
addr:80EACA000049 B4 0201061B00E210000000FFFEC4FEFEC4FFFEC3FEFEC3FEFDC4000000000000
t2 = 000009ce.
地址:80EACA000049 B5 00000000000000000000000000000000000000000000000000000000000000
t2 = 000009de.
GAPM_RESET:

`device_init完成

GAPM_RESET:

开始adv A.

GAPM_RESET:

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨Liuluan002,

From your initial code i can see that whenever you issue a GAPM_RESET_CMD you are changing roles between the user_gapm_conf.role (what is the value of this if not GAP_PERIPHERAL_SLV ? ) and GAP_CENTRAL_MST depending on the current_role variable that changes to the opposite role every time you have a reset. You mentioned that the white list works in every odd number and you get some data back, in order to narrow down the problem please dont use the white list but try to scan all the available devices that are advertising at the moment in order to make sure that you are scanning indeed.

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())
{
continue;
}
别的
{
ARCH_PRINTF_PROCESS();
休息;
}

Regarding your issue that sometimes you dont get any advertising, are you certain that your device is advertising ? and also i ve noticed that your scanning window is as long as your interval, that means that you listen to only one advertising channel for a quite long period, try to reduce your window and your interval in order to listen to all three channels of advertising frequently since there might be confilicts at that particular channel at the time you are scanning. Also as i allready mention this might occur due to UART printing, please try to catch the advertising indications using break points instead of UART printing in order to be sure. Finally perhaps at the time you are performing the scanning there is two much air activity and no advertising can reach your receiver intact so you dont get any indications.

About the zeros you are getting, are data from the scan request you are sending to the peripheral, those are the scan response data of your peripheral device.

Thanks MT_dialog

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
我删除了白色列表,

我删除了白色列表,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.

您是否意味着14583可以进入模式而不是GAP_PERITELAL_SLV,并且不是GAP_CENTRAL_MST,您意味着可能触发它无法从广播包中扫描任何内容?

如果我使用白色列表,它似乎有效为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())
{
continue;
}
别的
{
ARCH_PRINTF_PROCESS();
休息;
}

您是否有可能帮助我们检查一部分代码?我可以收到您的电子邮件并将其发送给您吗?

What do you means by GAP_PERIPHERAL_SLV

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨Liuluan002,

在您的设备中,您正在更改角色,从GAP_Central_mst到配置文件中定义的其他内容,您指示设备在获得重置后将其指示更改的其他角色是什么?此变量中的其他角色user_gapm_conf.role是什么?

if(user_config)
{
cmd->operation = 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;
}

还有关于白色列表,在send_white_list_mgt_cmd()函数中,键盘参考设计中的白色列表中的白色列表的实现,您可以看看这个。

Thanks MT_dialog

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
我认为这是差距

我认为这是差距_PERIPHERAL_SLV, which I have found in the user_config.h as the following.
static const struct 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: *****************************************************************
///在BLE双槽(1.25ms)中测量的连接间隔的从属的最低限度
/// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
.con_intv_min = MS_TO_DOUBLESLOTS(10),
/// Slave preferred Maximum of connection interval measured in ble double slots (1.25ms)
/// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
.con_intv_max = ms_to_doubleslots(20),
/// Slave preferred Connection latency. It is measured in connection events skipped
.con_latency = 0,
///从机器单元(10 ms)测量的Slave优选链接监控超时
///使用宏观MS_TO_TIMERUNITS从毫秒(MS)转换为定时器单位
.superv_to = MS_TO_TIMERUNITS(1000),
/// Privacy settings bit field (0b1 = enabled, 0b0 = disabled)
/// - [位0]:隐私支持
/// - [位1]:多键支持(仅限外围设备);如果已启用,隐私标志是
/// read only.
/// - [bit 2]: Reconnection address visible.
.flags = 0
};

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨Liuluan002,

To be honest i haven't understand what you are trying to do, you are performing role switching between to roles the one is central and the other is a peripheral, the peripheral cant execute the scanning procedure. So since you are only scanning why you need this extra code of the role switching. Even with the role switching in an attemp to replicate your problem i ve made a device that issues a role switch on a button press, the scanning procedure included the white list didn't show any kind of manfunctions and always returned the proper device. Please try to make a simple scanner with no role switching based on the DSPS host application and then you can apply the white list and test it.

Thanks MT_dialog

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
你好,

你好,

I am doing the role switching is because I want to make a repeater for extending the distance for broadcasting the package. When I got the advertisement package from scanning, I just repeat me in the next role switch by broadcasting it out .

liuluan002
离线
Last seen:4个月1周前
加入:2015-11-27 14:24
嗨对话框,

嗨对话框,

Do you have an example for adding 3 addresses into the white list?
怎么做?

谢谢

mt_dialog.
离线
Last seen:3周5天前
Staff
加入:2015-06-08 11:34
嗨Liuluan002,

嗨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