Microchip® Advanced Software Framework

current_time.c File Reference

Current Time Service.

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

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

Functions

at_ble_status_t tis_current_time_noti (at_ble_handle_t conn_handle, at_ble_handle_t desc_handle, uint8_t *notify)
 write notification handler for Current Time Service More...
 
at_ble_status_t tis_current_time_read (at_ble_handle_t conn_handle, at_ble_handle_t char_handle)
 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_current_time_read_response (at_ble_characteristic_read_response_t *read_resp, gatt_cts_handler_t *cts_handler)
 Read response handler for read response for time characteristic. More...
 

at_ble_status_t tis_current_time_noti ( at_ble_handle_t  conn_handle,
at_ble_handle_t  desc_handle,
uint8_t *  notify 
)

write notification handler for Current Time Service

Parameters
[in]conn_handleread response data available form
[in]desc_handleread response data available form
[in]notifyread 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

References at_ble_characteristic_write(), AT_BLE_INVALID_STATE, CTS_INVALID_CHAR_HANDLE, and DBG_LOG.

Referenced by time_info_write_notification_handler().

at_ble_status_t tis_current_time_read ( at_ble_handle_t  conn_handle,
at_ble_handle_t  char_handle 
)

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, CTS_INVALID_CHAR_HANDLE, CTS_READ_LENGTH, and CTS_READ_OFFSET.

Referenced by app_read_response_cb(), and tip_app_custom_event().