gapm_cmp_evt_handler中的一个错误?

15 posts / 0 new
最后一篇
ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
gapm_cmp_evt_handler中的一个错误?

sdk5

I mean how to fetch the result from scanning completion?
案例Gapm_scan_active:
案例GAPM_SCAN_PASSIVE:
{
Execute_callback_void(app_on_scanning_completed);
}

设备:
joe.brackman
Offline
最后一次露面:4年6个月前
加入:2015-05-29 18:47
Have you read the Riviera

您是否阅读过Riviera Waves Gap Spec(RW-BLE-GAP-IS.PDF)?复制和粘贴:

4.2通用界面
The generic GAP Manager offers a set of commands that are completed with following command completed event
message.
4.2.1 GAPM_CMP_EVT.
参数:
类型参数说明
uint8_t operation GAPM operation code (see Table 23)
uint8_t操作状态状态(见表39)
描述:
这是GAP操作的通用完整事件。操作时所有操作都触发此事件
完成的
-----------------------------------------------------------------

因此,GAPM_CMP_EVT消息有两个参数:操作和状态。操作参数是刚刚完成的命令,并且状态是如何/为何完成。

Status codes:

价值错误描述
0x00 gap_err_no_error没有错误
0x40 GAP_ERR_INVALID_PARAM无效的参数集
0x41 GAP_ERR_PROTOCOL_PROBLEM Problem with protocol exchange, get unexpected response
0x42 GAP_ERR_NOT_SUPPORTED请求软件配置不支持
0x43 GAP_ERR_COMMAND_DISALLOWED Request not allowed in current state.
0x44 GAP_ERR_CANCELED请求的操作取消。
0x45 GAP_ERR_TIMEOUT Requested operation timeout.
0x46 GAP_ERR_DISCONCONCONCETTICTED在操作期间丢失的链接连接。
0x47 GAP_ERR_NOT_FOUND搜索算法完成,但找不到结果
0x48 GAP_ERR_REJECT请求由对等设备拒绝
0x49 GAP_ERR_PRIVACY_CFG_PB Problem with privacy configuration
0x4a gap_err_add_data_invalid复制或无效的广告数据
Table 39: GAP Error Codes

Beyond that, the GAPM_CMP_EVT message doesn't give any more info.

如果您对已收到的广告活动感兴趣,那就是GapM_Adv_Report_ind。

你的问题有点模糊;也许你可以解释你的意思是“获取结果。”。结果是什么?

Thanks.

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
谢谢回复。

谢谢回复。
after scanning, I want to get a list of devices which are found, furthermore , get the device name, rssi, address etc.
顺便说一下,我在gapm_adv_report_ind中设置了一个断点,但没有看到它被达到。

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
请注意,扫描是

请注意,扫描是观察者模式。
msg-> mode = gap_observer_mode;//GAP_GEN_DISCOVERY
msg->op.code = GAPM_SCAN_ACTIVE;
msg-> op.addr_src = gapm_public_addr;
msg-> filter_duplic = scan_filt_duplic_en;

mt_dialog.
Offline
最后一次露面:4周10小时前
职员
加入:2015-06-08 11:34
嗨Achao1104,

嗨Achao1104,

把你在gapm_adv_report_ind_断点handler() in the app_task.c file and you will be able to extract the members of the adv_report struct. If you still dont get an indication you can take the DSPS host implementation (make the changes you require) and place a break point at the same function, just to make sure that you successfully configured your host application.

谢谢mt_dialog.

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
实际上,我已经放了一个

实际上,我在app_task.c文件中的GapM_Adv_Report_ind_Handler()中放置了一个断点,但尚未达到。顺便说一下,我正在使用最新的SDK5,你能把我指向“DSPS主机实现”(文件夹路径),只需确保我们正在谈论同样的事情。

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
I downloaded dsps, the

I downloaded dsps, the difference is that I am using latest sd5, and **msg->mode = GAP_OBSERVER_MODE** mode, I didn't see the break point was reached. PLEASE help.

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
我也改变了差距的角色

我也改变了差距的角色_OBSERVER_SCA to GAP_CENTRAL_MST and backwards, but still not work. please help, it has taken me days, please help.
static const结构gapm_configuration user_gapm_conf = {
//.ROLE = GAP_OBSERVER_SCA,
.role = GAP_CENTRAL_MST,
.irk = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
///设备外观(0x0000 - 未知外观)
//Fill in according tohttps://developer.bluetooth.org/gatt/characteristics/pages/charracteristi ...
.appearance = 0,
.appearance_write_perm = gapm_write_disable,
.name_write_perm = gapm_write_disable,
/// maximal mtu.
.max_mtu = 23,

here is sending:
app_easy_timer(300, scan_cb);
struct gapm_start_scan_cmd * msg =(struct gapm_start_scan_cmd *)ke_msg_alloc(gapm_start_scan_cmd,task_gapm,task_app,gapm_start_scan_cmd);
// Maximal peer connection
//msg->mode = GAP_GEN_DISCOVERY ; //
msg-> mode = gap_observer_mode;
msg-> op.code = gapm_scan_passive;
msg-> op.addr_src = gapm_public_addr;
msg-> filter_duplic = scan_filt_duplic_en;
msg->间隔= 100;
msg->窗口= 5000;
ke_msg_send(msg);

void scan_cb(void)
{
struct gapm_cancel_cmd *cmd =(struct gapm_cancel_cmd *) KE_MSG_ALLOC(GAPM_CANCEL_CMD, TASK_GAPM, TASK_APP, gapm_cancel_cmd);
cmd->操作= gapm_scan_passive;//设置GAPM_SCAN_PASSIVE.
KE_MSG_SEND(CMD); //发送消息

}

static const struct app_callbacks user_app_callbacks = {
.app_on_connection = null,
.app_on_disconnect = NULL,
.app_on_update_params_rejected = NULL,
.app_on_update_params_complete = null,
.app_on_set_dev_config_complete = default_app_on_set_dev_config_complete,
.app_on_adv_undirect_complete = null,
.app_on_adv_direct_complete = NULL,
.app_on_db_init_complete = default_app_on_db_init_complete,
.app_on_scanning_completed = user_scanning_completed,
.app_on_adv_report_ind = user_adv_report_ind,
#if(ble_app_sec)
.app_on_pairing_request = null,
.app_on_tk_exch_nomitm = null,
.app_on_irk_exch = null,
.app_on_csrk_exch = null,
.app_on_ltk_exch = null,
.app_on_pairing_succeded = NULL,
.app_on_encrypt_ind = NULL,
.app_on_mitm_passcode_req = null,
.app_on_encrypt_req_ind = NULL,
#endif // (BLE_APP_SEC)
};

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
in advertise side:

in advertise side:

// ---------------------------------------------------------------------------
//-------------NON-CONNECTABLE & UNDIRECTED ADVERTISE RELATED COMMON --
///广告服务数据
/// Advertising AD type flags, shall not be set in advertising data
#define user_advertise_data“\ x03”\
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\
avad_uuid_device_information_service.

///广告数据长度 - 最多28个字节,保留3个字节以设置
#define USER_ADVERTISE_DATA_LEN (sizeof(USER_ADVERTISE_DATA)-1)
///广告名称
#define USER_DEVICE_NAME ("a")
///广告名称Length
#define USER_DEVICE_NAME_LEN (sizeof(USER_DEVICE_NAME)-1)
/// Scan response data
#define USER_ADVERTISE_SCAN_RESPONSE_DATA ""
/// Scan response data length- maximum 31 bytes
#define USER_ADVERTISE_SCAN_RESPONSE_DATA_LEN (sizeof(USER_ADVERTISE_SCAN_RESPONSE_DATA)-1)

// ---------------------------------------------------------------------------
//-------------DIRECTED ADVERTIZE---RELATED----------------------------

static const struct advertis_configuration user_directed_advertise_conf = {
/// Advertise operation type.
.Advertise_operation = Adv_Direct,
///自己的BD地址源:
.address_src = gapm_public_addr,
///广告频道地图
.channel_map = 0x7,
};

static const struct inction_advertise_configuration user_directed_advertise_target_address_conf = {
///设备的BD地址
.ddr = {0x1,0x2,0x3,0x4,0x5,0x6},
///设备的地址类型0 = public / 1 =私有随机
.addr_type = 0.
};

// ---------------------------------------------------------------------------
// ------------------- param更新--------------------------

static const struct connection_param_configuration user_connection_param_conf = {
///在BLE双槽(1.25ms)中测量的连接间隔最小值
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.intv_min = ms_to_doubleslots(10),
///在BLE双槽(1.25ms)中测量的连接间隔最大值
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.intv_max = ms_to_doubleslots(20),
/// Latency measured in connection events
.latency = 0,
/// Supervision timeout measured in timer units (10 ms)
///使用宏观MS_TO_TIMERUNITS从毫秒(MS)转换为定时器单位
.time_out = ms_to_timerUnits(1250),
/// Minimum Connection Event Duration measured in ble double slots (1.25ms)
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.ce_len_min = MS_TO_DOUBLESLOTS(0),
/// Maximum Connection Event Duration measured in ble double slots (1.25ms)
///使用宏观MS_TO_DOUBLESLOTS从毫秒(MS)转换为双插槽
.ce_len_max = MS_TO_DOUBLESLOTS(0),
};

// ---------------------------------------------------------------------------
// ------------------- - - GAPM ---相关-----------------------------------

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,0x00,0x00,0x00},
///设备外观(0x0000 - 未知外观)
//Fill in according tohttps://developer.bluetooth.org/gatt/characteristics/pages/charracteristi ...
.appearance = 0,
.appearance_write_perm = gapm_write_disable,
.name_write_perm = gapm_write_disable,
/// maximal mtu.
.max_mtu = 23,
///仅限外围设备:*******************************************************************
///在BLE双槽(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),
/// Slave preferred Connection latency. It is measured in connection events skipped
.con_latency = 0,
/// Slave preferred Link supervision timeout measured in timer units (10 ms)
///使用宏观MS_TO_TIMERUNITS从毫秒(MS)转换为定时器单位
.superv_to = MS_TO_TIMERUNITS(1000),
///隐私设置位字段(0b1 =启用,0b0 =禁用)
/// - [bit 0]: Privacy Support
/// - [位1]:多键支持(仅限外围设备);如果已启用,隐私标志是
/// 只读。
/// - [位2]:重新连接地址可见。
.flags = 0
};

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
请帮忙

请帮忙

mt_dialog.
Offline
最后一次露面:4周10小时前
职员
加入:2015-06-08 11:34
嗨achao,

嗨achao,

DSP在SDK 3中实现,在SDK 5中没有实现扫描仪,I VE更改了App_scanning()函数以在GAP_OBSEREVER_MODE下运行,我能够捕获广告指示。请您在if语句中将断点放在eAvm_adv_report_ind_handler()中并再次检查。另外请尝试禁用重复的数据包过滤以检查是否为您提供任何问题。关于扫描仪的行为除了设置扫描参数,您是否设置了设备的配置(角色)以充当中央?如果您无法使用DSP应用程序捕获广告指示,则广告可能出现问题。请尝试使用DSPS主机应用程序运行简单的外设应用程序并捕获广告字符串。

This is what i ve tested with the SDK5 template:

1) Go to user_config.h and change the .role to GAP_OBSERVER_SCA

2)在user_callback_config中更改默认on_config_complete函数,使用将开始扫描的自定义函数。

3) Take the scanning function directly from dsps application.

4)我能够抓住广告迹象

您还可以使用Smart Spippets工具检查您的应用程序是否扫描。

谢谢mt_dialog.

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
谢谢,你能给我发电子邮件吗?

谢谢,你能给我发电子邮件吗?codes?
bld2014@sohu.com.

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
by the way,i can get

by the way,i can get advertise message by using sniffer tool,so it shouldnot be advertise side problem, i will check the snippet tool,happy weekend and thanks

ACHAO1104.
Offline
最后一次露面:5年2个月前
掌握
加入:2015-12-24 10:56
谢谢,最后,得到它的工作

谢谢,最后,得到它的工作。
还有一个问题:
如果我改变了“msg->窗口= 5;”(设置为5,工作)到“msg->窗口= 50;”或者“msg-> window = 500”,它没有捕获adv指示,但立即调用user_scanning_completed(在用户回调文件中定义),为什么?窗口在这里是什么意思?

app_easy_timer(300, scan_cb);
struct gapm_start_scan_cmd * msg =(struct gapm_start_scan_cmd *)ke_msg_alloc(gapm_start_scan_cmd,task_gapm,task_app,gapm_start_scan_cmd);
// Maximal peer connection
msg-> mode = gap_observer_mode;
msg-> op.code = gapm_scan_passive;
msg-> op.addr_src = gapm_public_addr;
//msg->filter_duplic = SCAN_FILT_DUPLIC_EN;
msg->filter_duplic = SCAN_FILT_DUPLIC_DIS;
msg->间隔= 10;
msg->window = 5;
ke_msg_send(msg);

mt_dialog.
Offline
最后一次露面:4周10小时前
职员
加入:2015-06-08 11:34
嗨Achao1104,

嗨Achao1104,

The window indicates how long the scanner will scan and it must less than the interval (how often your device will scan), if you set your window larger than your interval (interval 10, window 50 or 500) wont get anything. The interval is your scan window plus the time that your device will stay idle between scanning different channels.

谢谢mt_dialog.