Microchip® Advanced Software Framework

ancs_profile.h File Reference

Alert Notification Profile declarations.

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

Data Structures

struct  app_anp_data
 
struct  time_val
 time data structure More...
 

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   (0x1)
 
#define ANCS_CHAR_CONTROL_POINT   "\xD9\xD9\xAA\xFD\xBD\x9B\x21\x98\xA8\x49\xE1\x45\xF3\xD8\xD1\x69"
 
#define ANCS_CHAR_DATA_SOURCE   "\xFB\x7B\x7C\xCE\x6A\xB3\x44\xBE\xB5\x4B\xD6\x24\xE9\xC6\xEA\x22"
 
#define ANCS_CHAR_NOTIFICATION_SOURCE_UUID   "\xBD\x1D\xA2\x99\xE6\x25\x58\x8C\xD9\x42\x01\x63\x0D\x12\xBF\x9F"
 
#define ANP_ADV_DATA_APPEARANCE_DATA   ("\x00\x40")
 
#define ANP_ADV_DATA_APPEARANCE_LEN   (2)
 Appearance type & Length. More...
 
#define ANP_ADV_DATA_APPEARANCE_TYPE   (0x19)
 
#define ANP_ADV_DATA_NAME_DATA   ("AT-ANS")
 
#define ANP_ADV_DATA_NAME_LEN   (6)
 Advertisement Name Type Length & data. More...
 
#define ANP_ADV_DATA_NAME_TYPE   (0x9)
 
#define ANP_ADV_DATA_SERVSOLICITATION_128UUID_TYPE   (0x15)
 
#define ANP_ADV_DATA_SERVSOLICITATION_16UUID_TYPE   (0x14)
 
#define ANP_MAX_CHARACTERISTIC   (3)
 No of Characteristics and No of decriptors. More...
 
#define ANP_MAX_DESCRIPTOR   (3)
 
#define ANP_SOLICITATION_LEN   (16)
 ANCS Service Solicitation Info. More...
 
#define APP_ANP_ADV_TIMEOUT   (655)
 APP_ANP_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out. More...
 
#define APP_ANP_FAST_ADV   (160)
 Advertisement Interval. More...
 
#define AT_DISCOVER_SUCCESS   (10)
 
#define CATEGORY_ID_INCOMINGCALL   (1)
 Alert Types. More...
 
#define CATEGORY_ID_MISSEDCALL   (2)
 
#define END_HANDLE   (0xFFFF)
 
#define FALSE   (0)
 True False. More...
 
#define NOTIFICATION_ADDED   (0)
 Notification status. More...
 
#define NOTIFICATION_REMOVED   (2)
 
#define SCAN_RESP_LEN   (10)
 Scan Response length. More...
 
#define START_HANDLE   (0x1)
 start and end handle More...
 
#define TRUE   (1)
 

Typedefs

typedef struct app_anp_data app_anp_data_t
 
typedef struct time_val time_val_t
 time data structure More...
 

Enumerations

enum  ble_discovery_role {
  DISCOVER_IDLE = 0,
  DISCOVER_SERVICE,
  DISCOVER_INCLUDE_SERVICE,
  DISCOVER_CHARACTERISTIC,
  DISCOVER_DESCRIPTOR,
  DISCOVER_IDLE = 0,
  DISCOVER_SERVICE,
  DISCOVER_INCLUDE_SERVICE,
  DISCOVER_CHARACTERISTIC,
  DISCOVER_DESCRIPTOR,
  DISCOVER_COMPLETED,
  DISCOVER_IDLE = 0,
  DISCOVER_SERVICE,
  DISCOVER_INCLUDE_SERVICE,
  DISCOVER_CHARACTERISTIC,
  DISCOVER_DESCRIPTOR
}
 type of attribute discovery More...
 

Functions

void anp_client_adv (void)
 does all the profile initialization and starts the advertisement More...
 
void anp_client_char_changed_handler (at_ble_characteristic_changed_t *params)
 Handler for char changed handler. More...
 
at_ble_status_t anp_client_characteristic_found_handler (void *params)
 Handler for characteristic found event. More...
 
at_ble_status_t anp_client_connected_state_handler (void *params)
 Handler for connection event. More...
 
at_ble_status_t anp_client_descriptor_found_handler (void *params)
 Handler for descriptor found event. More...
 
at_ble_status_t anp_client_disconnected_event_handler (void *params)
 Handler for disconnection event. More...
 
at_ble_status_t anp_client_discovery_complete_handler (void *params)
 Handler for discovery complete event. More...
 
void anp_client_init (void *params)
 Function used for profile initialization and also enable the advertisement. More...
 
at_ble_status_t anp_client_notification_handler (void *params)
 Handler for notification event. More...
 
at_ble_status_t anp_client_service_found_handler (void *params)
 Handler for service found event. More...
 
at_ble_status_t anp_client_write_notification_handler (void *param)
 Handler for enabling the notification. More...
 
at_ble_status_t anp_client_write_response_handler (void *params)
 Handler for write response. More...
 
void anp_info_init (void)
 Initialize the profile specific information. 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   (0x1)
#define ANCS_CHAR_CONTROL_POINT   "\xD9\xD9\xAA\xFD\xBD\x9B\x21\x98\xA8\x49\xE1\x45\xF3\xD8\xD1\x69"
#define ANCS_CHAR_DATA_SOURCE   "\xFB\x7B\x7C\xCE\x6A\xB3\x44\xBE\xB5\x4B\xD6\x24\xE9\xC6\xEA\x22"
#define ANCS_CHAR_NOTIFICATION_SOURCE_UUID   "\xBD\x1D\xA2\x99\xE6\x25\x58\x8C\xD9\x42\x01\x63\x0D\x12\xBF\x9F"
#define ANP_ADV_DATA_APPEARANCE_DATA   ("\x00\x40")
#define ANP_ADV_DATA_APPEARANCE_LEN   (2)

Appearance type & Length.

#define ANP_ADV_DATA_APPEARANCE_TYPE   (0x19)
#define ANP_ADV_DATA_NAME_DATA   ("AT-ANS")
#define ANP_ADV_DATA_NAME_LEN   (6)

Advertisement Name Type Length & data.

#define ANP_ADV_DATA_NAME_TYPE   (0x9)
#define ANP_ADV_DATA_SERVSOLICITATION_128UUID_TYPE   (0x15)
#define ANP_ADV_DATA_SERVSOLICITATION_16UUID_TYPE   (0x14)
#define ANP_MAX_CHARACTERISTIC   (3)

No of Characteristics and No of decriptors.

#define ANP_MAX_DESCRIPTOR   (3)
#define ANP_SOLICITATION_LEN   (16)

ANCS Service Solicitation Info.

#define APP_ANP_ADV_TIMEOUT   (655)

APP_ANP_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out.

Referenced by anp_client_adv().

#define APP_ANP_FAST_ADV   (160)

Advertisement Interval.

Preface

This is the reference manual for the Time Information Profile

Referenced by anp_client_adv().

#define AT_DISCOVER_SUCCESS   (10)
#define CATEGORY_ID_INCOMINGCALL   (1)

Alert Types.

Referenced by anp_client_notification_handler().

#define CATEGORY_ID_MISSEDCALL   (2)
#define END_HANDLE   (0xFFFF)
#define NOTIFICATION_ADDED   (0)

Notification status.

Referenced by anp_client_notification_handler().

#define NOTIFICATION_REMOVED   (2)
#define SCAN_RESP_LEN   (10)

Scan Response length.

#define START_HANDLE   (0x1)

typedef struct app_anp_data app_anp_data_t
typedef struct time_val time_val_t

time data structure

type of attribute discovery

Enumerator
DISCOVER_IDLE 

Discovery Disable.

DISCOVER_SERVICE 

Discover Service.

DISCOVER_INCLUDE_SERVICE 

Discover Include Service.

DISCOVER_CHARACTERISTIC 

Discover Characteristic.

DISCOVER_DESCRIPTOR 

Discover Descriptor.

DISCOVER_IDLE 

Discovery Disable.

DISCOVER_SERVICE 

Discover Service.

DISCOVER_INCLUDE_SERVICE 

Discover Include Service.

DISCOVER_CHARACTERISTIC 

Discover Characteristic.

DISCOVER_DESCRIPTOR 

Discover Descriptor.

DISCOVER_COMPLETED 
DISCOVER_IDLE 

Discovery Disable.

DISCOVER_SERVICE 

Discover Service.

DISCOVER_INCLUDE_SERVICE 

Discover Include Service.

DISCOVER_CHARACTERISTIC 

Discover Characteristic.

DISCOVER_DESCRIPTOR 

Discover Descriptor.

void anp_client_adv ( void  )

does all the profile initialization and starts the advertisement

Note
Called by the ble_manager

does all the profile initialization and starts the advertisement

void anp_client_char_changed_handler ( at_ble_characteristic_changed_t params)

Handler for char changed handler.

Parameters
[in]characteristicchanged event parameter containing details like characteristic handle,value
Note
Called by the ble_manager after receiving characteristic change event
at_ble_status_t anp_client_characteristic_found_handler ( void *  params)

Handler for characteristic found event.

Parameters
[in]characteristicfound event parameter containing details like characteristic handle,uuid
Note
Called by the ble_manager after receiving characteristic found event

Handler for characteristic found event.

Parameters
[in]at_ble_characteristic_found_tconsists the characteristic handle,value handle
Returns
none
at_ble_status_t anp_client_connected_state_handler ( void *  params)

Handler for connection event.

Parameters
[in]connectedevent parameter containing details like handle
Note
Called by the ble_manager after receiving connection event

References ancs_enable(), ancs_prf::ancs_serv, at_ble_primary_service_discover_by_uuid(), AT_BLE_SUCCESS, app_anp_data::conn_params, DBG_LOG, app_anp_data::devicedb, END_HANDLE, at_ble_connected_t::handle, at_ble_primary_service_found_t::service_uuid, START_HANDLE, and status.

at_ble_status_t anp_client_descriptor_found_handler ( void *  params)

Handler for descriptor found event.

Parameters
[in]descriptorfound event parameter containing details like descriptor handle,uuid
Note
Called by the ble_manager after receiving descriptor found event

Handler for descriptor found event.

Parameters
[in]at_ble_descriptor_found_tconsists the descriptor handle
at_ble_status_t anp_client_disconnected_event_handler ( void *  params)

Handler for disconnection event.

Parameters
[in]disconnectedevent parameter containing details like handle
Note
Called by the ble_manager after receiving disconnection event

Handler for disconnection event.

Parameters
[in]at_ble_disconnected_tconsists connection handle and reason return none
at_ble_status_t anp_client_discovery_complete_handler ( void *  params)

Handler for discovery complete event.

Parameters
[in]discoverycomplete event which contains result of discovery event
Note
Called by the ble_manager after receiving discovery complete event

Handler for discovery complete event.

Parameters
[in]at_ble_discovery_complete_twhich consists of discovery status handle and params
Returns
none
void anp_client_init ( void *  params)

Function used for profile initialization and also enable the advertisement.

Note
Called by the ble_manager

Function used for profile initialization and also enable the advertisement.

Function used for profile initialization and also enable the advertisement.

Parameters
[in]voidparams passed by the blemanager,app may use it or may not
Returns
none
at_ble_status_t anp_client_notification_handler ( void *  params)

Handler for notification event.

Parameters
[in]notificationreceived parameter containing the notification value
Note
Called by the ble_manager after receiving the notification

Handler for notification event.

Parameters
[in]at_ble_notification_recieved_tconsists the char handle
at_ble_status_t anp_client_service_found_handler ( void *  params)

Handler for service found event.

Parameters
[in]servicefound event parameter containing details like service handle,uuid
Note
Called by the ble_manager after receiving service found event

Handler for service found event.

Parameters
[in]at_ble_primary_service_found_twhich consists of starting and ending handle of service
Returns
none
at_ble_status_t anp_client_write_notification_handler ( void *  param)

Handler for enabling the notification.

Note
Called by the ble_manager for enabling the notification in the gatt server

References at_ble_characteristic_write(), AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_descriptor_found_t::conn_handle, data, DBG_LOG, at_ble_descriptor_found_t::desc_handle, FALSE, ancs_prf::notification_source_desc, TRUE, and UNUSED.

Referenced by anp_client_read_response_handler(), and anp_custom_event().

at_ble_status_t anp_client_write_response_handler ( void *  params)

Handler for write response.

Parameters
[in]writeresponse parameter contating the result of write request
Note
Called by the ble_manager after receiving write response event
Parameters
[in]writeresponse parameter contacting the result of write request
Note
Called by the ble_manager after receiving write response event

Handler for write response.

Parameters
[in]at_ble_characteristic_write_response_tconsists the char
Returns
none
void anp_info_init ( void  )

Initialize the profile specific information.

Initialize the profile specific information.

Initialize the profile specific information.

Parameters
[in]none
Returns
none