Microchip® Advanced Software Framework

link_loss.h File Reference

Link Loss Service declarations.

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

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

Data Structures

struct  gatt_lls_char_handler
 

Macros

#define INVALID_LLS_PARAM   (0xff)
 
#define LLS_CHARACTERISTIC_COUNT   (1)
 count of characteristics in linkloss service More...
 
#define LLS_CLIENT   0
 
#define LLS_INCLUDED_SERVICE_COUNT   (0)
 count of included service in Linkloss service More...
 
#define LLS_SERVER   0
 

Typedefs

typedef struct
gatt_lls_char_handler 
gatt_lls_char_handler_t
 
typedef enum linkloss_alert_level linkloss_alert_level_t
 

Enumerations

enum  linkloss_alert_level {
  LLS_NO_ALERT,
  LLS_MILD_ALERT,
  LLS_HIGH_ALERT
}
 

Functions

void init_linkloss_service (gatt_service_handler_t *linkloss_serv)
 Initialize the linkloss service with default values. More...
 
at_ble_status_t lls_primary_service_define (gatt_service_handler_t *lls_service)
 Defining linkloss service to the attribute data base. More...
 
uint8_t lls_set_alert_value (at_ble_characteristic_changed_t *change_params, gatt_service_handler_t *lls_handler)
 sets the alert value of the Linkloss service More...
 

#define INVALID_LLS_PARAM   (0xff)
#define LLS_CHARACTERISTIC_COUNT   (1)

count of characteristics in linkloss service

Referenced by lls_primary_service_define().

#define LLS_CLIENT   0
#define LLS_INCLUDED_SERVICE_COUNT   (0)

count of included service in Linkloss service

Referenced by lls_primary_service_define().

#define LLS_SERVER   0

Enumerator
LLS_NO_ALERT 
LLS_MILD_ALERT 
LLS_HIGH_ALERT 

void init_linkloss_service ( gatt_service_handler_t linkloss_serv)

Initialize the linkloss 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 lls_primary_service_define
Returns
void

Initialize the linkloss service with default values.

References ALERT_LEVEL_CHAR_UUID, AT_BLE_ATTR_NO_PERMISSIONS, AT_BLE_ATTR_READABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_READABLE_REQ_AUTHN_NO_AUTHR, AT_BLE_ATTR_WRITABLE_NO_AUTHN_NO_AUTHR, AT_BLE_ATTR_WRITABLE_REQ_AUTHN_NO_AUTHR, AT_BLE_CHAR_READ, AT_BLE_CHAR_WRITE, AT_BLE_UUID_16, LINK_LOSS_SERVICE_UUID, and linkloss_initial_value.

Referenced by pxp_service_init().

at_ble_status_t lls_primary_service_define ( gatt_service_handler_t lls_service)

Defining linkloss 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_linkloss_service
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_FAILURE Generic error.

Defining linkloss service to the attribute data base.

References at_ble_primary_service_define(), LLS_CHARACTERISTIC_COUNT, and LLS_INCLUDED_SERVICE_COUNT.

Referenced by pxp_service_define().

uint8_t lls_set_alert_value ( at_ble_characteristic_changed_t change_params,
gatt_service_handler_t lls_handler 
)

sets the alert value of the Linkloss 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 Linkloss service

References at_ble_characteristic_changed_t::char_handle, at_ble_characteristic_changed_t::char_new_value, DBG_LOG, INVALID_LLS_PARAM, lls_gs_str, and LLS_HIGH_ALERT.

Referenced by pxp_reporter_char_changed_handler().