Microchip® Advanced Software Framework

reference_time.h File Reference

Link Loss Service Application declarations.

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

#include "ble_manager.h"

Data Structures

struct  gatt_rtu_handler
 

Macros

#define RTU_INVALID_CHAR_HANDLE   (0)
 
#define RTU_READ_OFFSET   (0)
 
#define RTU_TP_CP_READ_LENGTH   (20)
 
#define RTU_TP_STATE_READ_LENGTH   (2)
 

Typedefs

typedef struct gatt_rtu_handler gatt_rtu_handler_t
 

Functions

at_ble_status_t tis_rtu_update_read (at_ble_handle_t conn_handle, at_ble_handle_t char_handle, uint16_t length)
 Send the Read request to the current time characteristic Read value will be reported via AT_BLE_CHARACTERISTIC_READ_RESPONSE event. More...
 
int8_t tis_rtu_update_read_response (at_ble_characteristic_read_response_t *read_resp, gatt_rtu_handler_t *rtu_handler)
 Read response handler for read response. More...
 
at_ble_status_t tis_rtu_update_write (at_ble_handle_t conn_handle, at_ble_handle_t char_value_handle, uint8_t char_value)
 write Characteristic value giving its handle More...
 

#define RTU_INVALID_CHAR_HANDLE   (0)
#define RTU_READ_OFFSET   (0)

Referenced by tis_rtu_update_read().

#define RTU_TP_CP_READ_LENGTH   (20)
#define RTU_TP_STATE_READ_LENGTH   (2)

at_ble_status_t tis_rtu_update_read ( at_ble_handle_t  conn_handle,
at_ble_handle_t  char_handle,
uint16_t  length 
)

Send the Read request to the current time characteristic Read value will be reported via AT_BLE_CHARACTERISTIC_READ_RESPONSE event.

Parameters
[in]conn_handlehandle of the connection
[in]char_handlehandle of the characteristic
Returns
AT_BLE_SUCCESS operation completed successfully
AT_BLE_INVALID_PARAM Invalid arguments.
AT_BLE_FAILURE Generic error.

References at_ble_characteristic_read(), AT_BLE_INVALID_STATE, RTU_INVALID_CHAR_HANDLE, and RTU_READ_OFFSET.

Referenced by app_read_response_cb().

int8_t tis_rtu_update_read_response ( at_ble_characteristic_read_response_t read_resp,
gatt_rtu_handler_t rtu_handler 
)

Read response handler for read response.

Parameters
[in]read_valueread response data available form at_ble_characteristic_read_response_t
Returns
Current time value.
LLS_READ_RESP_INVALID if value are other than alert levels

Read response handler for read response.

References AT_BLE_SUCCESS, at_ble_characteristic_read_response_t::char_handle, at_ble_characteristic_read_response_t::char_value, DBG_LOG, at_ble_characteristic_read_response_t::status, and gatt_rtu_handler::tp_state_char_handle.

Referenced by time_info_characteristic_read_response(), and time_info_notification_handler().

at_ble_status_t tis_rtu_update_write ( at_ble_handle_t  conn_handle,
at_ble_handle_t  char_value_handle,
uint8_t  char_value 
)

write Characteristic value giving its handle

Parameters
[in]conn_handleconnection handle
[in]char_value_handlecharacteristic value handle
[in]char_valuecharacteristic new value
Returns
Current time value.
LLS_READ_RESP_INVALID if value are other than alert levels

References at_ble_characteristic_write(), AT_BLE_INVALID_STATE, and RTU_INVALID_CHAR_HANDLE.

Referenced by tip_app_custom_event().