#include "platform_files.h"
#include "bm_mode.h"
#include "event_mem.h"
#include "bm_application_mode.h"
#include "ble_api.h"
#include "platform.h"
#include "ble_manager.h"
|
static |
References ble_mgr_adv_report_event_t::addr, PACKED::addr, ADV_DIRECT_IND, ble_mgr_adv_report_event_t::adv_event_type, PACKED::adv_event_type, ADV_IND, BLE_CONN_WHITELIST_FILTER_DISABLED, ble_create_connection(), BLE_MATCHING_PARAM_NONE, ble_mgr_check_match_param(), ble_mgr_state, BLE_MGRSTATE_CONNECTING, BLE_SUCCESS, event_msg_t::data, ble_mgr_adv_report_event_t::data, PACKED::data, ble_mgr_adv_report_event_t::data_len, PACKED::data_len, ble_mgr_adv_report_match_param_t::matching_param, ble_mgr_adv_report_event_t::rssi, and PACKED::rssi.
ble_status_t ble_mgr_adv_start | ( | const uint8_t * | adv_data, |
uint8_t | adv_data_length, | ||
const uint8_t * | scan_resp_data, | ||
uint8_t | scan_reap_data_len | ||
) |
Set advertisement data, scan response data, advertisement parameters and start advertisement.
adv_data | Advertisement data. |
adv_data_length | Advertisement data length. |
scan_resp_data | Scan response data. |
scan_reap_data_len | Scan response data length. |
References ble_adv_data_set(), ble_adv_param_set(), ble_adv_start(), BLE_INVALID_COMMAND_PARAMETERS, ble_mgr_state, BLE_MGR_STATE_ADVERTISING, ble_scan_resp_data_set(), BLE_SUCCESS, BM_ADV_CONNECTABLE_UNDIRECTED, DBG_LOG, and NULL.
Referenced by app_disconnected_cb(), and main().
ble_status_t ble_mgr_adv_stop | ( | void | ) |
Stops ongoing advertisement.
None. |
References ble_adv_stop(), BLE_SUCCESS, and DBG_LOG.
Referenced by main().
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
ble_status_t ble_mgr_characteristic_indicate_set | ( | ble_handle_t | conn_handle, |
uint16_t | desc_handle, | ||
bool | enabled | ||
) |
Enable/disable characteristic indication.
conn_handle | Connection handle. |
desc_handle | Client characteristic config descriptor handle. |
enabled | Enable/disable the indication. |
References ble_characteristic_write_with_response(), BLE_GATT_INDICATE, and BLE_GATT_NONE.
ble_status_t ble_mgr_characteristic_notify_set | ( | ble_handle_t | conn_handle, |
uint16_t | desc_handle, | ||
bool | enabled | ||
) |
Enable/disable characteristic notification.
conn_handle | Connection handle. |
desc_handle | Client characteristic config descriptor handle. |
enabled | Enable/disable the notification. |
References ble_characteristic_write_with_response(), BLE_GATT_NONE, and BLE_GATT_NOTIFY.
Referenced by main().
bool ble_mgr_check_match_param | ( | ble_mgr_adv_report_event_t * | adv_report | ) |
Check against the matching parameter set by the user, it could be BLE address, RSSI threshold or advertisement payload.
adv_report | Advertisement report info got from scanning operation. |
References ble_mgr_adv_report_event_t::addr, ble_mgr_adv_report_match_param_t::addr, BLE_MATCHING_PARAM_ADDRESS, BLE_MATCHING_PARAM_PAYLOAD, BLE_MATCHING_PARAM_RSSI, ble_mgr_adv_report_event_t::data, ble_mgr_adv_report_match_param_t::data, ble_mgr_adv_report_match_param_t::data_len, ble_mgr_adv_report_match_param_t::data_start, ble_mgr_adv_report_match_param_t::matching_param, ble_mgr_adv_report_event_t::rssi, and ble_mgr_adv_report_match_param_t::rssi.
Referenced by ble_mgr_adv_report_cb().
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
ble_status_t ble_mgr_device_init | ( | void | ) |
Initialize platform, callback events and BLE interface.
None. |
References ble_init(), ble_mgr_init(), BLE_SUCCESS, BM_MODE_Init(), DBG_LOG, and platform_init().
Referenced by main().
|
static |
References BLE_SUCCESS.
|
static |
References BM_ADVERTISING_REPORT, BM_CLIENT_CHARACTERISTIC_VALUE_RECEIVED, BM_CLIENT_DISCOVER_ALL_SERVICES_RESULT, BM_CLIENT_DISCOVER_CHARACTERISTICS_DESCRIPTORS_RESULT, BM_CLIENT_DISCOVER_CHARACTERISTICS_RESULT, BM_CLIENT_EXECUTE_WRITE_RESPONSE, BM_CLIENT_PREPARE_WRITE_RESPONSE, BM_COMMAND_COMPLETE, BM_CONFIGURE_MODE_STATUS, BM_CONNECTION_PARAMTER_UPDATE, BM_DISCONNECT_COMPLETE, BM_ERROR, BM_EVENT_NONE, BM_LE_CONNECT_COMPLETE, BM_LE_END_TEST_RESULT, BM_PAIR_COMPLETE, BM_PASSKEY_REQUEST, BM_PASSKEY_YESNO_REQUEST, BM_SERVER_BLOB_READ_REQUEST, BM_SERVER_CHARACTERICTIC_VALUE_WRITE, BM_SERVER_CHARACTERISTIC_VALUE_READ, BM_SERVER_EXECUTE_WRITE_REQUEST, BM_SERVER_PREPARE_WRITE_REQUEST, BM_STATUS_REPORT, BM_TRANSPARENT_DATA_RECEIVED, event_t::event_id, event_t::event_msg, MAX_COMMON_EVENT_SUBSCRIBERS, MAX_GAP_EVENT_SUBSCRIBERS, MAX_GATT_CLIENT_EVENT_SUBSCRIBERS, MAX_GATT_SERVER_EVENT_SUBSCRIBERS, MAX_GATT_TRANSPARENT_SUBSCRIBERS, MAX_PAIRING_SUBSCRIBERS, and NULL.
Referenced by ble_mgr_get_event().
bool ble_mgr_events_register_callback | ( | ble_mgr_event_t | event_type, |
const void * | ble_event_handler | ||
) |
Register callback functions for BLE events.
event_type | Type of event, like GAP, GATT-Client, GATT-Server... etc. |
ble_event_handler | Function pointer to group of event handler callbacks. |
scan_resp_data | Scan response data. |
scan_reap_data_len | Scan response data length. |
References BLE_COMMON_EVENT_TYPE, BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, BLE_GATT_TP_EVENT_TYPE, BLE_PAIRING_EVENT_TYPE, MAX_COMMON_EVENT_SUBSCRIBERS, MAX_GAP_EVENT_SUBSCRIBERS, MAX_GATT_CLIENT_EVENT_SUBSCRIBERS, MAX_GATT_SERVER_EVENT_SUBSCRIBERS, MAX_GATT_TRANSPARENT_SUBSCRIBERS, MAX_PAIRING_SUBSCRIBERS, and NULL.
Referenced by app_init(), and ble_mgr_init().
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
event_status_t ble_mgr_get_event | ( | event_t * | event | ) |
Get BLE events and process them.
event | Carries event ID, parameters and length. |
References ble_event_get(), BLE_EVENT_SUCCESS, and ble_mgr_event_manager().
Referenced by main().
|
static |
Registers BLE manager event callbacks.
None. |
References BLE_COMMON_EVENT_TYPE, BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, BLE_GATT_SERVER_EVENT_TYPE, BLE_GATT_TP_EVENT_TYPE, ble_mgr_events_register_callback(), and BLE_PAIRING_EVENT_TYPE.
Referenced by ble_mgr_device_init().
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
void ble_mgr_peripheral_device_match_params | ( | ble_mgr_adv_report_match_param_t * | match_param | ) |
Sets a matching parameter to find and connect with the device.
match_param | Matching parameter, it could be BLE address, RSSI threshold or advertisement payload. |
Referenced by main().
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
ble_status_t ble_mgr_scan_start | ( | void | ) |
Sets BLE scan parameters and starts scanning.
None. |
References ble_mgr_state, BLE_MGR_STATE_SCANNING, BLE_SCAN_ACTIVE, BLE_SCAN_DUPLICATE_FILTER_ENABLED, BLE_SCAN_ENABLED, ble_scan_param_set(), ble_scan_start(), BLE_SUCCESS, DBG_LOG, DEFAULT_SCAN_INTERVAL, and DEFAULT_SCAN_WINDOW.
Referenced by app_disconnected_cb(), and main().
ble_status_t ble_mgr_scan_stop | ( | void | ) |
Stops the ongoing BLE scan.
None. |
References ble_mgr_state, BLE_MGR_STATE_INIT, BLE_SCAN_DISABLED, BLE_SCAN_DUPLICATE_FILTER_ENABLED, ble_scan_start(), BLE_SUCCESS, and DBG_LOG.
Referenced by app_disconnected_cb(), and main().
|
static |
References BLE_SUCCESS.
ble_status_t ble_mgr_start_connection | ( | ble_addr_t * | address | ) |
Initiate a connection based on remote device address.
address | Address of remote device. |
References BLE_CONN_WHITELIST_FILTER_DISABLED, ble_create_connection(), BLE_SUCCESS, and DBG_LOG.
|
static |
References BLE_SUCCESS.
|
static |
References BLE_SUCCESS.
ble_status_t ble_mgr_transparent_uart_disable | ( | ble_handle_t | conn_handle | ) |
Disables transparentUART with remote device.
conn_handle | Connection handle of remote device. |
References BLE_SUCCESS, ble_transparent_uart_enable(), PACKED::conn_handle, and DBG_LOG.
Referenced by app_disconnected_cb().
ble_status_t ble_mgr_transparent_uart_enable | ( | ble_handle_t | conn_handle | ) |
Enables transparentUART with remote device.
conn_handle | Connection handle of remote device. |
References BLE_SUCCESS, ble_transparent_uart_enable(), PACKED::conn_handle, and DBG_LOG.
Referenced by app_connected_cb().
ble_status_t ble_mgr_transparent_uart_send | ( | ble_handle_t | conn_handle, |
const uint8_t * | data, | ||
uint8_t | datalen | ||
) |
Sends transparentUART data to remote device.
conn_handle | Connection handle of remote device. |
data | Data that needs to be sent to remote device. |
datalen | Length of data that needs to be sent to remote device. |
References BLE_SUCCESS, ble_transparent_uart_data_send(), DBG_LOG, and DBG_LOG_CONT.
Referenced by app_send_transparent_uart_data().
|
static |
|
static |
ble_common_event_cb_t* ble_mgr_common_event_cb[MAX_COMMON_EVENT_SUBSCRIBERS] = {NULL, } |
|
static |
ble_gap_event_cb_t* ble_mgr_gap_event_cb[MAX_GAP_EVENT_SUBSCRIBERS] = {NULL, } |
|
static |
ble_gatt_client_event_cb_t* ble_mgr_gatt_client_event_cb[MAX_GATT_CLIENT_EVENT_SUBSCRIBERS] = {NULL, } |
|
static |
ble_gatt_server_event_cb_t* ble_mgr_gatt_server_event_cb[MAX_GATT_SERVER_EVENT_SUBSCRIBERS] = {NULL, } |
|
static |
ble_gatt_transparent_event_cb_t* ble_mgr_gatt_tp_event_cb[MAX_GATT_TRANSPARENT_SUBSCRIBERS] = {NULL, } |
ble_pairing_event_cb_t* ble_mgr_pairing_event_cb[MAX_PAIRING_SUBSCRIBERS] = {NULL, } |
|
static |
ble_mgr_state_t ble_mgr_state = BLE_MGR_STATE_INIT |
Referenced by ble_mgr_adv_report_cb(), ble_mgr_adv_start(), ble_mgr_connected_cb(), ble_mgr_scan_start(), and ble_mgr_scan_stop().
|
static |
event_t event_mem[MAX_EVENT_SIZE] |
Referenced by event_fifo_init().
uint32_t event_payload[MAX_EVENT_PAYLOAD_SIZE/4] |
at_ble_init_config_t pf_cfg |