BLE Observer application.
Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "platform.h"
#include "timer_hw.h"
#include "at_ble_api.h"
#include "conf_extint.h"
#include "console_serial.h"
#include "ble_observer.h"
#include "ble_utils.h"
#include "ble_manager.h"
Macros | |
#define | APP_BUTTON_EVENT_ID (1) |
Button event ID. More... | |
Functions | |
static at_ble_status_t | ble_observer_custom_event (void *param) |
at_ble_status_t | ble_observer_scan_data_handler (void *param) |
Handler for AT_BLE_SCAN_REPORT event from stack. More... | |
at_ble_status_t | ble_observer_scan_info_handler (void *param) |
Handler for scan info event. More... | |
void | button_cb (void) |
int | main (void) |
Variables | |
user_custom_event_t | app_button_event |
volatile bool | app_init_done = false |
static const ble_custom_event_cb_t | ble_observer_custom_event_cb |
volatile bool | button_press = false |
static const ble_gap_event_cb_t | observer_app_gap_cb |
uint8_t | scan_device_count |
uint32_t | scan_response_count |
volatile uint8_t | scanning_state = false |
#define APP_BUTTON_EVENT_ID (1) |
Button event ID.
Referenced by ble_observer_custom_event().
|
static |
at_ble_status_t ble_observer_scan_data_handler | ( | void * | param | ) |
Handler for AT_BLE_SCAN_REPORT event from stack.
[in] | scan_info_data | scan information data |
[in] | scan_resp_count | number of scanned devices |
References ALL_UNUSED, AT_BLE_SUCCESS, DBG_LOG, and scan_device_count.
at_ble_status_t ble_observer_scan_info_handler | ( | void * | param | ) |
Handler for scan info event.
[in] | scan | information data |
References at_ble_addr_t::addr, at_ble_scan_info_t::adv_data, at_ble_scan_info_t::adv_data_len, ADV_INTERVAL_SIZE, ADVERTISING_INTERVAL, APPEARANCE, APPEARANCE_SIZE, AT_BLE_ADDRESS_PUBLIC, AT_BLE_ADDRESS_RANDOM_PRIVATE_NON_RESOLVABLE, AT_BLE_ADDRESS_RANDOM_PRIVATE_RESOLVABLE, AT_BLE_ADDRESS_RANDOM_STATIC, AT_BLE_ADV_TYPE_DIRECTED, AT_BLE_ADV_TYPE_NONCONN_UNDIRECTED, AT_BLE_ADV_TYPE_SCAN_RESPONSE, AT_BLE_ADV_TYPE_SCANNABLE_UNDIRECTED, AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_FAILURE, AT_BLE_SUCCESS, AT_BLE_UUID_128, AT_BLE_UUID_128_LEN, AT_BLE_UUID_16_LEN, AT_BLE_UUID_32_LEN, BREDR_NOT_SUPPORTED, COMPLETE_LIST_128BIT_SERV_UUIDS, COMPLETE_LIST_16BIT_SERV_UUIDS, COMPLETE_LIST_32BIT_SERV_UUIDS, COMPLETE_LOCAL_NAME, DBG_LOG, DBG_LOG_CONT, DBG_LOG_DEV, at_ble_scan_info_t::dev_addr, FLAGS, INCOMPLETE_LIST_128BIT_SERV_UUIDS, INCOMPLETE_LIST_16BIT_SERV_UUIDS, INCOMPLETE_LIST_32BIT_SERV_UUIDS, LE_BREDR_CAPABLE_CONTROLLER, LE_BREDR_CAPABLE_HOST, LE_GENERAL_DISCOVERABLE_MODE, LE_LIMITED_DISCOVERABLE_MODE, MANUFACTURER_SPECIFIC_DATA, at_ble_scan_info_t::rssi, scan_device_count, SHORTENED_LOCAL_NAME, TX_POWER_LEVEL, TX_POWER_LEVEL_SIZE, at_ble_addr_t::type, and at_ble_scan_info_t::type.
void button_cb | ( | void | ) |
References app_init_done, at_ble_event_user_defined_post(), and button_press.
int main | ( | void | ) |
user_custom_event_t app_button_event |
|
static |
Referenced by ble_observer_custom_event(), and button_cb().
|
static |
uint8_t scan_device_count |
Referenced by ble_observer_scan_data_handler(), and ble_observer_scan_info_handler().
uint32_t scan_response_count |
volatile uint8_t scanning_state = false |
Referenced by ble_observer_custom_event().