hi dialog
I read “Bluetooth Low Energy The Developer-'s Handbook"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7.5. Finding Devices
A device uses the advertising channel to find another device, with one device advertising and another
device scanning, as illustrated in Figure 7–17. There are four types of advertising that can be
performed by devices: general, directed, nonconnectable, and discoverable.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
所以我明白了。广告风格:一般情况下,非定向connectable, and discoverable.
but I found that only three in the code.
@file app_template_proj.c
///////////////////////////////////////////////////////////////////////////////////////////////////////////
void app_adv_func(struct gapm_start_advertise_cmd *cmd)
{
.....
cmd->op.code = GAPM_ADV_UNDIRECT;//GAPM_ADV_UNDIRECT;//GAPM_ADV_NON_CONN;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
@file gapm_task.h
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GAP Manager operation type - application interface
enum gapm_operation
{
....
/* Advertise mode operations */
/* ************************************************ */
/// Start non connectable advertising
GAPM_ADV_NON_CONN,
/// Start undirected connectable advertising
GAPM_ADV_UNDIRECT,
/// Start directed connectable advertising
GAPM_ADV_DIRECT,
/* Scan mode operations */
/* ************************************************ */
....
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
sorry,i found
@file app_template_proj.c
///////////////////////////////////////////////////////////////////////////////////////////////////////////
void app_adv_func(struct gapm_start_advertise_cmd *cmd)
{
.....
cmd->op.code = GAPM_ADV_UNDIRECT;//GAPM_ADV_UNDIRECT;//GAPM_ADV_NON_CONN;
cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd->intv_min = APP_ADV_INT_MIN;
cmd->intv_max = APP_ADV_INT_MAX;
cmd->channel_map = APP_ADV_CHMAP;
cmd->info.host.mode = GAP_GEN_DISCOVERABLE;
...
}
@file gap.h
/// Advertising mode
enum gap_adv_mode
{
/// Mode in non-discoverable
GAP_NON_DISCOVERABLE,
/// Mode in general discoverable
GAP_GEN_DISCOVERABLE,
/// Mode in limited discoverable
GAP_LIM_DISCOVERABLE,
/// Broadcaster mode which is a non discoverable and non connectable mode.
GAP_BROADCASTER_MODE,
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////