Scan Parameters service.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include "scan_param.h"
Functions | |
at_ble_status_t | sps_char_changed_event (sps_gatt_service_handler_t *sps_service_handler, at_ble_characteristic_changed_t *char_handle) |
function to check the client characteristic configuration value. More... | |
static at_ble_status_t | sps_disconnected_event_handler (void *params) |
void | sps_init_service (sps_gatt_service_handler_t *sps_serv, uint16_t *scan_interval_window, uint8_t *scan_refresh) |
Initialize the service with its included service, characteristics, and descriptors. More... | |
at_ble_status_t | sps_primary_service_define (sps_gatt_service_handler_t *sps_service) |
defining a initialized service More... | |
at_ble_status_t | sps_scan_refresh_char_update (sps_gatt_service_handler_t *sps_serv, uint8_t scan_refresh_value) |
Function used to update the scan refresh characteristic value during connection. More... | |
Variables | |
at_ble_connected_t | ble_dev_info [BLE_MAX_DEVICE_CONNECTION] |
Initialize the service with its included service, characteristics, and descriptors. More... | |
static const ble_gap_event_cb_t | sps_gap_cb |
bool volatile | sps_notification_flag = false |
at_ble_status_t sps_char_changed_event | ( | sps_gatt_service_handler_t * | sps_service_handler, |
at_ble_characteristic_changed_t * | char_handle | ||
) |
function to check the client characteristic configuration value.
[in] | sps_service_handler | scan parameters service instance |
[in] | char_handle | characteristic changed at_ble_characteristic_changed_t |
References AT_BLE_SUCCESS, at_ble_characteristic_changed_t::char_handle, at_ble_characteristic_changed_t::char_len, at_ble_characteristic_changed_t::char_new_value, at_ble_characteristic_t::char_val_handle, at_ble_characteristic_t::client_config_handle, DBG_LOG, at_ble_characteristic_t::init_value, scan_interval_window, SCP_NOTIFICATION_ENABLE, sps_gatt_service_handler::serv_chars, and sps_notification_flag.
Referenced by sps_char_changed_cb().
|
static |
References ALL_UNUSED, AT_BLE_SUCCESS, and sps_notification_flag.
void sps_init_service | ( | sps_gatt_service_handler_t * | sps_serv, |
uint16_t * | scan_interval_window, | ||
uint8_t * | scan_refresh | ||
) |
Initialize the service with its included service, characteristics, and descriptors.
[in] | sps_serv | gatt service information |
[in] | scan_interval_window | used to know the gatt client scan interval window |
[in] | scan_refresh | application uses to get the updated scan interval window of the gatt client |
References AT_BLE_ATTR_NO_PERMISSIONS, AT_BLE_ATTR_READABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_WRITABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_WRITABLE_REQ_AUTHN_NO_AUTHR, AT_BLE_CHAR_NOTIFY, AT_BLE_CHAR_WRITE_WITHOUT_RESPONSE, AT_BLE_UUID_16, BLE_GAP_EVENT_TYPE, ble_mgr_events_callback_handler(), at_ble_characteristic_t::char_val_handle, at_ble_characteristic_t::client_config_handle, at_ble_characteristic_t::client_config_permissions, at_ble_characteristic_t::init_value, NULL, at_ble_characteristic_t::presentation_format, at_ble_characteristic_t::properties, REGISTER_CALL_BACK, scan_refresh, sps_gatt_service_handler::serv_chars, sps_gatt_service_handler::serv_handle, sps_gatt_service_handler::serv_uuid, at_ble_characteristic_t::server_config_handle, at_ble_characteristic_t::server_config_permissions, SPS_CHAR_SCAN_INT_VALUE_UUID, SPS_CHAR_SCAN_REFRESH_UUID, SPS_SERVICE_UUID, at_ble_uuid_t::type, at_ble_characteristic_t::user_desc, at_ble_characteristic_t::user_desc_handle, at_ble_characteristic_t::user_desc_len, at_ble_characteristic_t::user_desc_max_len, at_ble_characteristic_t::user_desc_permissions, at_ble_uuid_t::uuid, at_ble_characteristic_t::uuid, at_ble_characteristic_t::value_init_len, at_ble_characteristic_t::value_max_len, and at_ble_characteristic_t::value_permissions.
Referenced by main().
at_ble_status_t sps_primary_service_define | ( | sps_gatt_service_handler_t * | sps_service | ) |
defining a initialized service
[in] | sps_service | gatt service information |
References at_ble_primary_service_define(), NULL, sps_gatt_service_handler::serv_chars, sps_gatt_service_handler::serv_handle, and sps_gatt_service_handler::serv_uuid.
Referenced by main().
at_ble_status_t sps_scan_refresh_char_update | ( | sps_gatt_service_handler_t * | sps_serv, |
uint8_t | scan_refresh_value | ||
) |
Function used to update the scan refresh characteristic value during connection.
[in] | sps_serv | gatt service information |
[in] | info_data | sps_info_data, holds the new data information |
References at_ble_characteristic_value_set(), AT_BLE_FAILURE, at_ble_notification_send(), AT_BLE_SUCCESS, at_ble_characteristic_t::char_val_handle, DBG_LOG, DBG_LOG_DEV, at_ble_characteristic_t::init_value, scan_refresh_value, sps_gatt_service_handler::serv_chars, and sps_notification_flag.
Referenced by sps_custom_event().
at_ble_connected_t ble_dev_info[BLE_MAX_DEVICE_CONNECTION] |
Initialize the service with its included service, characteristics, and descriptors.
[in] | scan_param | gatt service information |
|
static |
Referenced by sps_char_changed_event(), sps_disconnected_event_handler(), and sps_scan_refresh_char_update().