Time Information Profile Application.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "platform.h"
#include "at_ble_api.h"
#include "tip_app.h"
#include "time_info.h"
#include "profiles.h"
#include "console_serial.h"
#include "timer_hw.h"
#include "conf_extint.h"
#include "ble_manager.h"
#include "ble_utils.h"
#include "current_time.h"
#include "next_dst.h"
#include "reference_time.h"
Macros | |
#define | APP_BUTTON_EVENT_ID (2) |
#define | APP_INVALID_EVENT_ID (0) |
#define | APP_TIMER_EVENT_ID (1) |
Functions | |
static at_ble_status_t | app_read_response_cb (void *param) |
Callback registered for characteristic read response. More... | |
void | button_cb (void) |
Button Press Callback. More... | |
int | main (void) |
Main Function for Time Information Callback. More... | |
void | timer_callback_handler (void) |
Timer Callback. More... | |
static at_ble_status_t | tip_app_custom_event (void *param) |
static at_ble_status_t | tip_disconnect_cb (void *params) |
static at_ble_status_t | tip_discovery_complete_cb (void *params) |
static at_ble_status_t | tip_encryption_status_changed_cb (void *params) |
static at_ble_status_t | tip_pair_done_cb (void *params) |
#define APP_BUTTON_EVENT_ID (2) |
Referenced by tip_app_custom_event().
#define APP_INVALID_EVENT_ID (0) |
#define APP_TIMER_EVENT_ID (1) |
|
static |
Callback registered for characteristic read response.
[in] | char_read_resp | at_ble_characteristic_read_response_t |
References AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_characteristic_read_response_t::char_handle, completed_prev_read, at_ble_characteristic_read_response_t::conn_handle, gatt_cts_handler::curr_char_handle, DBG_LOG_DEV, gatt_dst_handler::dst_char_handle, local_time_char_found, gatt_cts_handler::lti_char_handle, ref_time_char_found, gatt_cts_handler::rti_char_handle, status, time_update_state_char_found, time_with_dst_char_found, tis_current_time_read(), tis_dst_change_read(), tis_rtu_update_read(), and gatt_rtu_handler::tp_state_char_handle.
void button_cb | ( | void | ) |
Button Press Callback.
References app_init_done, at_ble_event_user_defined_post(), and button_pressed.
int main | ( | void | ) |
Main Function for Time Information Callback.
References app_init_done, BLE_CUSTOM_EVENT_TYPE, ble_device_init(), ble_event_task(), BLE_GAP_EVENT_TYPE, BLE_GATT_CLIENT_EVENT_TYPE, ble_mgr_events_callback_handler(), board_init(), DBG_LOG, hw_timer_init(), hw_timer_register_callback(), NULL, REGISTER_CALL_BACK, serial_console_init(), system_init(), time_info_init(), and timer_callback_handler().
void timer_callback_handler | ( | void | ) |
|
static |
References APP_BUTTON_EVENT_ID, app_exec_flag, AT_BLE_FAILURE, AT_BLE_SUCCESS, button_pressed, completed_prev_read, gatt_cts_handler::curr_char_handle, current_time_char_found, DBG_LOG, DBG_LOG_DEV, delay_ms, discovery_flag, status, time_info_service_discovery(), time_info_write_notification_handler(), tis_current_time_read(), tis_rtu_update_write(), and gatt_rtu_handler::tp_control_char_handle.
|
static |
References app_exec_flag, AT_BLE_SUCCESS, completed_prev_read, DBG_LOG_DEV, and discovery_flag.
|
static |
|
static |
References app_exec_flag, AT_BLE_SUCCESS, DBG_LOG_DEV, and at_ble_encryption_status_changed_t::status.
|
static |
References app_exec_flag, AT_BLE_SUCCESS, DBG_LOG_DEV, and at_ble_pair_done_t::status.
user_custom_event_t app_custom_event[2] |
To keep the app executing continuously.
Referenced by tip_app_custom_event(), tip_disconnect_cb(), tip_encryption_status_changed_cb(), and tip_pair_done_cb().
ble_connected_dev_info_t ble_dev_info[BLE_MAX_DEVICE_CONNECTION] |
Initialize the service with its included service, characteristics, and descriptors.
Peer Connected device info
[in] | scan_param | gatt service information |
Referenced by app_read_response_cb(), tip_app_custom_event(), and tip_disconnect_cb().
gatt_cts_handler_t cts_handle |
CTS Service Handle.
volatile bool current_time_char_found |
Referenced by tip_app_custom_event(), tip_disconnect_cb(), and tip_discovery_complete_cb().
gatt_dst_handler_t dst_handle |
Next DST Change Service Handle.
volatile bool local_time_char_found |
volatile bool ref_time_char_found |
gatt_rtu_handler_t rtu_handle |
Reference Time Update Service Handle.
volatile bool time_update_cp_char_found |
Referenced by time_info_characteristic_found_handler(), and time_info_disconnected_event_handler().
volatile bool time_update_state_char_found |
volatile bool time_with_dst_char_found |
|
static |
|
static |
|
static |