Microchip® Advanced Software Framework

reference_time.c File Reference

Reference Time Update Service.

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

#include <string.h>
#include "at_ble_api.h"
#include "ble_manager.h"
#include "ble_utils.h"
#include "reference_time.h"

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 for time characteristic. 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...
 

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 
)
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().