–
AT_BLE_ADV_NON_DISCOVERABLE
–
AT_BLE_ADV_GEN_DISCOVERABLE
–
AT_BLE_ADV_LIM_DISCOVERABLE
–
AT_BLE_ADV_BROADCASTER_MODE
•
peer_addr
– Specify peer address, when advertising type is
AT_BLE_ADV_TYPE_DIRECTED
.
•
filtered
–
–
AT_BLE_ADV_FP_ANY
– Allow scan and connection requests from anyone.
–
AT_BLE_ADV_FP_FILTER_SCANREQ
– Allow scan request from White List devices only.
–
AT_BLE_ADV_FP_FILTER_CONNREQ
– Allow connection request from White List devices
only.
–
AT_BLE_ADV_FP_FILTER_BOTH
– Allow scan and connection requests from White List
devices only.
•
interval
– Advertisement interval (in 0.625 ms units).
•
timeout
– Advertising timeout between 0x0001 and 0x028F in scale of seconds. This parameter
must be set to '0', if type equals
AT_BLE_ADV_TYPE_DIRECTED
•
disable_randomness
– When disabled, advertisements are performed at the exact interval
without adding random 10 ms tempo.
Return
– Execution Status
3.1.4
Advertisement Process
In this assignment, the advertisement process is performed in the following configuration:
•
Undirected (Type :
AT_BLE_ADV_TYPE_UNDIRECTED
)
•
Discoverable (Mode :
AT_BLE_ADV_GEN_DISCOVERABLE
)
•
No peer Address (
peer_addr = NULL
)
•
No filtering (filtered =
AT_BLE_ADV_FP_ANY
)
•
Advertisement interval 1s (interval = 1600)
•
Maximum timeout (timeout : 655)
•
Randomness enabled (
disable_randomness = FALSE
)
3.1.4.1
Starting the Advertisement Process
1.
Open
startup_template.c
file.
2.
Declare the following
ble_status
global variable in
startup_template.c
as volatile.
#include <asf.hgt>
#include "platform.h"
#include "at_ble_api.h"
#include "profiles.h"
#include "console_serial.h"
#include "timer_hw.h"
#include "conf_extint.h"
#include "ble_manager.h"
#include "ble_utils.h"
#include "conf_serialdrv.h"
#include "startup_template.h"
volatile at_ble_status_t ble_status
;
3.
Declare the following
adv_data
global variable in
startup_template.c
as static.
static uint8_t adv_data[] = {
0x08,// AD2 Length = 8 (A AD)
0x09,// AD2 Type = Complete local Name
ATBTLC1000
Establishing Connection with Central Device
©
2017 Microchip Technology Inc.
Training Manual
DS00002599A-page 23