Microchip® Advanced Software Framework

scan_param.h File Reference

Scan Parameters Service declarations.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include "at_ble_api.h"
#include "ble_manager.h"

Data Structures

struct  sps_gatt_service_handler
 

Macros

#define SCP_NOTIFICATION_ENABLE   0x01
 

Typedefs

typedef struct
sps_gatt_service_handler 
sps_gatt_service_handler_t
 

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...
 
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...
 

#define SCP_NOTIFICATION_ENABLE   0x01

Referenced by sps_char_changed_event().

at_ble_status_t sps_char_changed_event ( sps_gatt_service_handler_t sps_service_handler,
at_ble_characteristic_changed_t char_handle 
)
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.

Parameters
[in]sps_servgatt service information
[in]scan_interval_windowused to know the gatt client scan interval window
[in]scan_refreshapplication uses to get the updated scan interval window of the gatt client
Returns
none

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

Parameters
[in]sps_servicegatt service information
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

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.

Parameters
[in]sps_servgatt service information
[in]info_datasps_info_data, holds the new data information
Returns
none

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().