Microchip® Advanced Software Framework

immediate_alert.h File Reference

Immediate Alert Service declarations.

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

#include "ble_manager.h"

Data Structures

struct  gatt_ias_char_handler
 

Macros

#define IAS_CHARACTERISTIC_COUNT   (1)
 count of characteristics in immediate alert service More...
 
#define IAS_CLIENT   0
 
#define IAS_INCLUDED_SERVICE_COUNT   (0)
 count of included service in immediate alert service More...
 
#define IAS_NO_SIGNED_WRITE   (false)
 
#define IAS_SERVER   0
 
#define IAS_WRITE_LENGTH   (1)
 
#define IAS_WRITE_OFFSET   (0)
 
#define IAS_WRITE_WITH_RESPONSE   (false)
 
#define INVALID_IAS_PARAM   (0xff)
 Invalid parameter written. More...
 
#define MAX_IAS_CHAR_SIZE   (1)
 

Typedefs

typedef struct
gatt_ias_char_handler 
gatt_ias_char_handler_t
 
typedef enum immediate_alert_level immediate_alert_level_t
 

Enumerations

enum  immediate_alert_level {
  IAS_NO_ALERT,
  IAS_MID_ALERT,
  IAS_HIGH_ALERT
}
 

Functions

at_ble_status_t ias_alert_level_write (at_ble_handle_t conn_handle, at_ble_handle_t char_handle, immediate_alert_level_t alert_level)
 write a characteristic to Immediate Alert Characteristics More...
 
at_ble_status_t ias_primary_service_define (gatt_service_handler_t *ias_primary_service)
 Defining Immediate alert service to the attribute data base. More...
 
uint8_t ias_set_alert_value (at_ble_characteristic_changed_t *change_params, gatt_service_handler_t *ias_handler)
 sets the alert value of the immediate alert service More...
 
void init_immediate_alert_service (gatt_service_handler_t *immediate_alert_serv)
 Initialize the Immediate alert service with default values. More...
 

#define IAS_CHARACTERISTIC_COUNT   (1)

count of characteristics in immediate alert service

Referenced by ias_primary_service_define().

#define IAS_CLIENT   0
#define IAS_INCLUDED_SERVICE_COUNT   (0)

count of included service in immediate alert service

Referenced by ias_primary_service_define().

#define IAS_NO_SIGNED_WRITE   (false)

Referenced by ias_alert_level_write().

#define IAS_SERVER   0
#define IAS_WRITE_LENGTH   (1)

Referenced by ias_alert_level_write().

#define IAS_WRITE_OFFSET   (0)

Referenced by ias_alert_level_write().

#define IAS_WRITE_WITH_RESPONSE   (false)

Referenced by ias_alert_level_write().

#define INVALID_IAS_PARAM   (0xff)
#define MAX_IAS_CHAR_SIZE   (1)

Enumerator
IAS_NO_ALERT 
IAS_MID_ALERT 
IAS_HIGH_ALERT 

at_ble_status_t ias_alert_level_write ( at_ble_handle_t  conn_handle,
at_ble_handle_t  char_handle,
immediate_alert_level_t  alert_level 
)

write a characteristic to Immediate Alert Characteristics

if with_response is True, write completion will be reported via AT_BLE_CHARACTERISTIC_WRITE_RESPONSE event

Parameters
[in]conn_handlehandle of the connection
[in]char_handlehandle of the characteristic
[in]alertlevel need to write
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

if with_response is True, write completion will be reported via AT_BLE_CHARACTERISTIC_WRITE_RESPONSE event

Parameters
[in]conn_handlehandle of the connection
[in]char_handlehandle of the characteristic
[in]alert_levelalert level need to write
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

References at_ble_characteristic_write(), IAS_NO_SIGNED_WRITE, IAS_WRITE_LENGTH, IAS_WRITE_OFFSET, and IAS_WRITE_WITH_RESPONSE.

Referenced by pxp_monitor_app_button_event(), and rssi_update().

at_ble_status_t ias_primary_service_define ( gatt_service_handler_t ias_primary_service)

Defining Immediate alert service to the attribute data base.

Parameters
[in]gatt_service_handler_tthe service info which has handle range,uuid and characteristic array fields
Precondition
Must be called after init_immediate_alert_service
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

Defining Immediate alert service to the attribute data base.

References at_ble_primary_service_define(), IAS_CHARACTERISTIC_COUNT, IAS_INCLUDED_SERVICE_COUNT, and NULL.

Referenced by fmp_target_service_define(), and pxp_service_define().

uint8_t ias_set_alert_value ( at_ble_characteristic_changed_t change_params,
gatt_service_handler_t ias_handler 
)

sets the alert value of the immediate alert service

Parameters
[in]gatt_service_handler_tthe service info which has handle range,uuid and characteristic array fields
[in]at_ble_characteristic_changed_tthe information of the characteristic changed.
Returns
ias alert value

sets the alert value of the immediate alert service

References at_ble_characteristic_changed_t::char_handle, at_ble_characteristic_changed_t::char_new_value, and INVALID_IAS_PARAM.

Referenced by fmp_target_char_changed_handler(), and pxp_reporter_char_changed_handler().

void init_immediate_alert_service ( gatt_service_handler_t immediate_alert_serv)

Initialize the Immediate alert service with default values.

Parameters
[in]gatt_service_handler_tthe service info which has handle range,uuid and characteristic array fields
Precondition
Must be called before ias_primary_service_define
Returns
void

Initialize the Immediate alert service with default values.

References ALERT_LEVEL_CHAR_UUID, AT_BLE_ATTR_NO_PERMISSIONS, AT_BLE_ATTR_WRITABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_WRITABLE_REQ_AUTHN_NO_AUTHR, AT_BLE_CHAR_WRITE_WITHOUT_RESPONSE, AT_BLE_UUID_16, immediate_alert_initial_value, IMMEDIATE_ALERT_SERVICE_UUID, and NULL.

Referenced by fmp_target_service_init(), and pxp_service_init().