Phone Alert Status Profile declarations.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | char_info |
struct | desc_info |
struct | pas_service_handler |
struct | serv_info |
Macros | |
#define | AD_TYPE_128BIT_UUID_LEN (16) |
#define | AD_TYPE_16BIT_UUID_LEN (2) |
ADV type UUID Type & Length. More... | |
#define | AD_TYPE_32BIT_UUID_LEN (4) |
#define | ADV_TYPE_LEN (0x01) |
#define | ALERT_STATUS_UUID (0x2a3f) |
characteristic uuids More... | |
#define | ANP_MAX_DESCRIPTOR (2) |
#define | APP_PAS_ADV_TIMEOUT (655) |
APP_PAS_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out. More... | |
#define | APP_PAS_FAST_ADV (1600) |
Advertisement Interval. More... | |
#define | CLIENT_CONF_CHAR_DESCRIPTOR_UUID (0x2902) |
#define | END_HANDLE (0xffff) |
#define | FALSE (0) |
True False. More... | |
#define | PAS_ADV_DATA_NAME_DATA ("ATMEL-PAS") |
#define | PAS_ADV_DATA_NAME_LEN (9) |
Advertisement Name Type Length & data. More... | |
#define | PAS_ADV_DATA_NAME_TYPE (0x09) |
#define | PAS_ADV_DATA_UUID_LEN (2) |
The length of 16bit uuid. More... | |
#define | PAS_ADV_DATA_UUID_TYPE (0x3) |
#define | PAS_MAX_CHARACTERISTIC (3) |
No of Characteristics and No of descriptors. More... | |
#define | PAS_SERVICE_UUID (0x180E) |
#define | RINGER_CONTROL_POINT_UUID (0x2a40) |
#define | RINGER_SETTING_UUID (0x2a41) |
#define | SCAN_RESP_LEN (10) |
Scan Response length. More... | |
#define | START_HANDLE (0x0001) |
start and end handle More... | |
#define | TP_ADV_DATA_SERVSOLICITATION_128UUID_TYPE (0x15) |
#define | TP_ADV_DATA_SERVSOLICITATION_16UUID_TYPE (0x14) |
TIP Service Solicitation Info. More... | |
#define | TRUE (1) |
#define | UUID_128BIT_LEN (16) |
#define | UUID_16BIT_LEN (2) |
UUID Type & Length. More... | |
#define | UUID_32BIT_LEN (4) |
Typedefs | |
typedef struct char_info | char_info_t |
typedef struct desc_info | desc_info_t |
typedef void(* | notification_callback_t )(uint8_t *, uint8_t) |
typedef struct pas_service_handler | pas_service_handler_t |
typedef void(* | read_callback_t )(uint8_t *, uint8_t) |
typedef struct serv_info | serv_info_t |
Functions | |
void | pas_client_adv (void) |
sets the advertisement data and triggers advertisement More... | |
at_ble_status_t | pas_client_char_read_response_handler (void *event_params) |
called by the ble manager after receiving the read response event More... | |
at_ble_status_t | pas_client_char_write_response_handler (void *event_params) |
invoked by ble manager for setting the write response handler More... | |
at_ble_status_t | pas_client_characteristic_found_handler (void *params) |
characteristic found handler invoked by ble manager More... | |
at_ble_status_t | pas_client_descriptor_found_handler (void *param) |
client descriptor found handler invoked by ble manager More... | |
at_ble_status_t | pas_client_disconnected_event_handler (void *params) |
disconnected event handler invoked by ble manager More... | |
at_ble_status_t | pas_client_discovery_complete_handler (void *params) |
Discovery Complete handler invoked by ble manager. More... | |
at_ble_status_t | pas_client_enable_char_notification (bool char_id, bool enable) |
invoked by ble manager for setting the notification of characteristics More... | |
void | pas_client_init (void *params) |
invoked by ble manager for initializing the profile More... | |
at_ble_status_t | pas_client_notification_handler (void *params) |
invoked by ble manager on receiving notification More... | |
at_ble_status_t | pas_client_read_alert_status_char (void) |
invoked by ble manager to read the alert status characteristic More... | |
at_ble_status_t | pas_client_read_ringer_setting_char (void) |
invoked by ble manager to read the write status characteristic More... | |
at_ble_status_t | pas_client_service_discovery (void *params) |
to perform the service discovery More... | |
at_ble_status_t | pas_client_service_found_handler (void *params) |
Service found handler invoked by ble manager. More... | |
at_ble_status_t | pas_client_start_service_discovery (void) |
starts the service discovery More... | |
at_ble_status_t | pas_client_write_notifications (void *params) |
invoked by ble manager for setting the notification More... | |
at_ble_status_t | pas_client_write_ringer_control_point (uint8_t ringer) |
invoked by ble manager to read the write ringer control point characteristic More... | |
void | pas_data_init (void) |
void | register_alert_status_notification_callback (notification_callback_t app_notify_cb) |
register the call back for notification of alert status More... | |
void | register_alert_status_read_callback (read_callback_t app_read_cb) |
register the call back for reading alert status More... | |
void | register_ringer_setting_notification_callback (notification_callback_t app_notify_cb) |
register the call back for notification of ringer setting More... | |
void | register_ringer_setting_read_callback (read_callback_t app_read_cb) |
register the call back for reading ringer setting More... | |
#define AD_TYPE_128BIT_UUID_LEN (16) |
#define AD_TYPE_16BIT_UUID_LEN (2) |
ADV type UUID Type & Length.
#define AD_TYPE_32BIT_UUID_LEN (4) |
#define ADV_TYPE_LEN (0x01) |
#define ALERT_STATUS_UUID (0x2a3f) |
characteristic uuids
Referenced by pas_client_characteristic_found_handler().
#define ANP_MAX_DESCRIPTOR (2) |
#define APP_PAS_ADV_TIMEOUT (655) |
APP_PAS_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out.
#define APP_PAS_FAST_ADV (1600) |
Advertisement Interval.
This is the reference manual for the Time Information Profile
Referenced by pas_client_adv().
#define CLIENT_CONF_CHAR_DESCRIPTOR_UUID (0x2902) |
Referenced by pas_client_descriptor_found_handler().
#define END_HANDLE (0xffff) |
#define FALSE (0) |
True False.
#define PAS_ADV_DATA_NAME_DATA ("ATMEL-PAS") |
#define PAS_ADV_DATA_NAME_LEN (9) |
Advertisement Name Type Length & data.
#define PAS_ADV_DATA_NAME_TYPE (0x09) |
#define PAS_ADV_DATA_UUID_LEN (2) |
The length of 16bit uuid.
#define PAS_ADV_DATA_UUID_TYPE (0x3) |
#define PAS_MAX_CHARACTERISTIC (3) |
No of Characteristics and No of descriptors.
#define PAS_SERVICE_UUID (0x180E) |
Referenced by pas_client_service_found_handler(), and pas_client_start_service_discovery().
#define RINGER_CONTROL_POINT_UUID (0x2a40) |
Referenced by pas_client_characteristic_found_handler().
#define RINGER_SETTING_UUID (0x2a41) |
Referenced by pas_client_characteristic_found_handler().
#define SCAN_RESP_LEN (10) |
Scan Response length.
#define START_HANDLE (0x0001) |
start and end handle
#define TP_ADV_DATA_SERVSOLICITATION_128UUID_TYPE (0x15) |
#define TP_ADV_DATA_SERVSOLICITATION_16UUID_TYPE (0x14) |
TIP Service Solicitation Info.
#define TRUE (1) |
#define UUID_128BIT_LEN (16) |
Referenced by ancs_enable().
#define UUID_16BIT_LEN (2) |
UUID Type & Length.
#define UUID_32BIT_LEN (4) |
typedef struct char_info char_info_t |
typedef struct desc_info desc_info_t |
typedef void(* notification_callback_t)(uint8_t *, uint8_t) |
typedef struct pas_service_handler pas_service_handler_t |
typedef void(* read_callback_t)(uint8_t *, uint8_t) |
typedef struct serv_info serv_info_t |
void pas_client_adv | ( | void | ) |
sets the advertisement data and triggers advertisement
[in] | none |
References APP_PAS_FAST_ADV, AT_BLE_ADV_FP_ANY, AT_BLE_ADV_GEN_DISCOVERABLE, at_ble_adv_start(), AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_SUCCESS, DBG_LOG, and NULL.
Referenced by app_disconnected_event_handler(), and main().
at_ble_status_t pas_client_char_read_response_handler | ( | void * | event_params | ) |
called by the ble manager after receiving the read response event
[in] | characteristic | read response parameters |
References pas_service_handler::alert_status_char, alert_status_read_cb, AT_BLE_SUCCESS, at_ble_characteristic_read_response_t::char_len, at_ble_characteristic_read_response_t::char_offset, at_ble_characteristic_read_response_t::char_value, DBG_LOG_DEV, params, pas_service_handler::ringer_setting_char, ringer_setting_read_cb, status, and char_info::value_handle.
at_ble_status_t pas_client_char_write_response_handler | ( | void * | event_params | ) |
invoked by ble manager for setting the write response handler
[in] | at_ble_characteristic_write_response_t | response data contains status and handle |
References pas_service_handler::alert_status_desc, AT_BLE_SUCCESS, at_ble_characteristic_write_response_t::char_handle, DBG_LOG, DBG_LOG_DEV, desc_info::desc_handle, params, pas_service_handler::ringer_setting_desc, status, and at_ble_characteristic_write_response_t::status.
at_ble_status_t pas_client_characteristic_found_handler | ( | void * | params | ) |
characteristic found handler invoked by ble manager
[in] | at_ble_characteristic_found_t | when a characteristic is found in peer device |
References pas_service_handler::alert_status_char, ALERT_STATUS_UUID, AT_BLE_SUCCESS, char_info::char_handle, at_ble_characteristic_found_t::char_handle, at_ble_characteristic_found_t::char_uuid, at_ble_characteristic_found_t::conn_handle, DBG_LOG_DEV, DBG_LOG_PTS, char_info::discovery, char_info::properties, at_ble_characteristic_found_t::properties, pas_service_handler::ringer_control_point_char, RINGER_CONTROL_POINT_UUID, pas_service_handler::ringer_setting_char, RINGER_SETTING_UUID, at_ble_uuid_t::type, at_ble_uuid_t::uuid, char_info::value_handle, and at_ble_characteristic_found_t::value_handle.
at_ble_status_t pas_client_descriptor_found_handler | ( | void * | param | ) |
client descriptor found handler invoked by ble manager
[in] | at_ble_descriptor_found_t | invoked when a descriptor is found in peer device |
References pas_service_handler::alert_status_char, pas_service_handler::alert_status_desc, AT_BLE_SUCCESS, AT_BLE_UUID_16, char_info::char_handle, CLIENT_CONF_CHAR_DESCRIPTOR_UUID, DBG_LOG_DEV, DBG_LOG_PTS, desc_info::desc_handle, at_ble_descriptor_found_t::desc_handle, at_ble_descriptor_found_t::desc_uuid, desc_info::discovery, params, pas_service_handler::ringer_control_point_char, pas_service_handler::ringer_setting_char, pas_service_handler::ringer_setting_desc, at_ble_uuid_t::type, and at_ble_uuid_t::uuid.
at_ble_status_t pas_client_disconnected_event_handler | ( | void * | params | ) |
disconnected event handler invoked by ble manager
[in] | at_ble_disconnected_t | contains the disconnection info |
References ALL_UNUSED, and AT_BLE_SUCCESS.
at_ble_status_t pas_client_discovery_complete_handler | ( | void * | params | ) |
Discovery Complete handler invoked by ble manager.
[in] | at_ble_discovery_complete_t | disconnected handler |
References AT_BLE_ATT_ATTRIBUTE_NOT_FOUND, at_ble_characteristic_discover_all(), at_ble_descriptor_discover_all(), AT_BLE_DISC_ALL_CHAR, AT_BLE_DISC_BY_UUID_SVC, AT_BLE_DISC_DESC_CHAR, at_ble_disconnect(), AT_BLE_SUCCESS, AT_BLE_TERMINATED_BY_USER, pas_service_handler::conn_handle, DBG_LOG, DBG_LOG_DEV, serv_info::discovery, char_info::discovery, serv_info::end_handle, NULL, pas_client_write_notifications(), pas_service_handler::pas_service_info, pas_service_handler::ringer_control_point_char, serv_info::start_handle, status, and at_ble_discovery_complete_t::status.
at_ble_status_t pas_client_enable_char_notification | ( | bool | char_id, |
bool | enable | ||
) |
invoked by ble manager for setting the notification of characteristics
[in] | char_id | represents the characteristic,0 for alert status,1 for ringer setting |
[in] | enable | weather notifications has to enabled or disabled.1 for enable 0 for disable |
[in] | char_id | represents the characteristic,1 for alert status,0 for ringer setting |
[in] | enable | weather notifications has to enabled or disabled.1 for enable 0 for disable |
References pas_service_handler::alert_status_desc, pas_service_handler::conn_handle, desc_info::desc_handle, pas_char_write_notification(), and pas_service_handler::ringer_setting_desc.
Referenced by pas_client_write_notifications().
void pas_client_init | ( | void * | params | ) |
invoked by ble manager for initializing the profile
[in] | none |
References AT_BLE_SUCCESS, ble_advertisement_data_set(), BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, ble_mgr_events_callback_handler(), DBG_LOG, pas_data_init(), REGISTER_CALL_BACK, status, and UNUSED.
Referenced by main().
at_ble_status_t pas_client_notification_handler | ( | void * | params | ) |
invoked by ble manager on receiving notification
[in] | at_ble_notification_recieved_t | notification information containing handle data |
References pas_service_handler::alert_status_char, alert_status_notification_cb, AT_BLE_SUCCESS, at_ble_notification_recieved_t::char_handle, at_ble_notification_recieved_t::char_len, at_ble_notification_recieved_t::char_value, DBG_LOG_DEV, pas_service_handler::ringer_setting_char, ringer_setting_notification_cb, and char_info::value_handle.
at_ble_status_t pas_client_read_alert_status_char | ( | void | ) |
invoked by ble manager to read the alert status characteristic
invoked by ble manager to read the alert status characteristic
References pas_service_handler::alert_status_char, pas_service_handler::conn_handle, pas_read_alert_status_char(), and char_info::value_handle.
Referenced by main().
at_ble_status_t pas_client_read_ringer_setting_char | ( | void | ) |
invoked by ble manager to read the write status characteristic
invoked by ble manager to read the write status characteristic
References pas_service_handler::conn_handle, pas_read_ringer_setting_char(), pas_service_handler::ringer_setting_char, and char_info::value_handle.
Referenced by main().
at_ble_status_t pas_client_service_discovery | ( | void * | params | ) |
to perform the service discovery
[in] | connection | parameters |
References AT_BLE_SUCCESS, pas_service_handler::conn_handle, at_ble_connected_t::conn_status, at_ble_connected_t::handle, and pas_client_start_service_discovery().
at_ble_status_t pas_client_service_found_handler | ( | void * | params | ) |
Service found handler invoked by ble manager.
[in] | at_ble_primary_service_found_t | invoked when a primary service is found in peer device |
References AT_BLE_SUCCESS, AT_BLE_UUID_16, DBG_LOG, DBG_LOG_PTS, serv_info::discovery, serv_info::end_handle, at_ble_primary_service_found_t::end_handle, pas_service_handler::pas_service_info, PAS_SERVICE_UUID, at_ble_primary_service_found_t::service_uuid, serv_info::start_handle, at_ble_primary_service_found_t::start_handle, at_ble_uuid_t::type, and at_ble_uuid_t::uuid.
at_ble_status_t pas_client_start_service_discovery | ( | void | ) |
starts the service discovery
References AT_BLE_FAILURE, at_ble_primary_service_discover_by_uuid(), AT_BLE_SUCCESS, AT_BLE_UUID_16, pas_service_handler::conn_handle, DBG_LOG, DBG_LOG_DEV, GATT_DISCOVERY_ENDING_HANDLE, GATT_DISCOVERY_STARTING_HANDLE, PAS_SERVICE_UUID, at_ble_uuid_t::type, and at_ble_uuid_t::uuid.
Referenced by main(), and pas_client_service_discovery().
at_ble_status_t pas_client_write_notifications | ( | void * | params | ) |
invoked by ble manager for setting the notification
References ALL_UNUSED, AT_BLE_SUCCESS, DBG_LOG, pas_client_enable_char_notification(), and status.
Referenced by pas_client_discovery_complete_handler().
at_ble_status_t pas_client_write_ringer_control_point | ( | uint8_t | ringer | ) |
invoked by ble manager to read the write ringer control point characteristic
invoked by ble manager to read the write ringer control point characteristic
References pas_service_handler::conn_handle, pas_char_set_ringer_control_point(), pas_service_handler::ringer_control_point_char, and char_info::value_handle.
Referenced by main().
void pas_data_init | ( | void | ) |
Referenced by pas_client_init().
void register_alert_status_notification_callback | ( | notification_callback_t | app_notify_cb | ) |
register the call back for notification of alert status
[in] | notification_callback_t | type application callback |
References alert_status_notification_cb.
Referenced by main().
void register_alert_status_read_callback | ( | read_callback_t | app_read_cb | ) |
register the call back for reading alert status
[in] | read_callback_t | type application callback |
References alert_status_read_cb.
Referenced by main().
void register_ringer_setting_notification_callback | ( | notification_callback_t | app_notify_cb | ) |
register the call back for notification of ringer setting
[in] | notification_callback_t | type application callback |
References ringer_setting_notification_cb.
Referenced by main().
void register_ringer_setting_read_callback | ( | read_callback_t | app_read_cb | ) |
register the call back for reading ringer setting
[in] | read_callback_t | type application callback |
References ringer_setting_read_cb.
Referenced by main().