Eddystone Beacons Support.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include "eddystone.h"
Data Structures | |
struct | esuid_data_t |
Eddystone-UID beacon data. More... | |
struct | esurl_data_t |
Eddystone-URL beacon data. More... | |
Macros | |
#define | CONVERT_MS_TO_625_US_UNIT(x) ((x * 16)/10) |
Convert ms to 0.625ms units; Required to set advertisement intervals. More... | |
#define | EDDYSTONE_FRAME_HEADER_LEN (8) |
#define | EDDYSTONE_FRAME_TYPE_OFFSET (8) |
#define | EDDYSTONE_HEADER(adv_data, index) |
#define | EDDYSTONE_MAX_URL_ENC_LEN (18) |
#define | EDDYSTONE_SERV_DATA_LEN_OFFSET (4) |
Eddystone specific defines. More... | |
#define | EDDYSTONE_TX_POWER_MODES_NUM (4) |
#define | ESURL_CONF_CHAR_UUID_DIFF_OFFSET (12) |
Eddystone URL configuration service defines. More... | |
#define | ESURL_LOCK_CODE_MAX_SIZE (16) |
#define | ESURL_URI_FLAG_SIZE (1) |
#define | HIGH_BYTE(x) (uint8_t)((((uint16_t)x) >> 8) & 0xFF) |
#define | LOCKED (1) |
Possible lock states. More... | |
#define | LOW_BYTE(x) (uint8_t)(((uint16_t)x) & 0xFF) |
Extract LSB and MSB from 16-bit value. More... | |
#define | UNLOCKED (0) |
Typedefs | |
typedef struct esuid_data_t | esuid_data_t |
Eddystone-UID beacon data. More... | |
typedef struct esurl_data_t | esurl_data_t |
Eddystone-URL beacon data. More... | |
Enumerations | |
enum | esurl_conf_char_uuid_value_t { UUID_CHAR_LOCK_STATE = 0x81, UUID_CHAR_LOCK = 0x82, UUID_CHAR_UNLOCK = 0x83, UUID_CHAR_URI_DATA = 0x84, UUID_CHAR_FLAGS = 0x85, UUID_CHAR_ADV_TX_POWER = 0x86, UUID_CHAR_TX_POWER_MODE = 0x87, UUID_CHAR_BEACON_PERIOD = 0x88, UUID_CHAR_RESET = 0x89, UUID_CHAR_RESERVED = 0x90 } |
One byte of the UUID value that changes for each characteristics of the URL configuration service. More... | |
Functions | |
static at_ble_status_t | eddystone_adv_start (uint8_t *adv_data) |
Starts the Eddystone advertisement. More... | |
at_ble_status_t | eddystone_adv_stop (void) |
Stop the Eddystone advertisement. More... | |
static at_ble_status_t | eddystone_create_tlm_frame (uint8_t *adv_data, eddystone_tlm_data_t *tlm_data) |
Creates Eddystone-TLM frame from battery voltage value, beacon temperature, advertisement PDU count and 100ms counter. More... | |
static at_ble_status_t | eddystone_create_uid_frame (uint8_t *adv_data) |
Creates Eddystone-UID frame from 16-byte beacon ID and calibrated TX power value. More... | |
static at_ble_status_t | eddystone_create_url_frame (uint8_t *adv_data) |
Creates Eddystone-URL frame from URI data and advertised TX power value. More... | |
eddystone_mode_t | eddystone_get_mode (void) |
Get current mode of the Eddystone beacon. More... | |
at_ble_status_t | eddystone_init (void) |
Initializes all Eddystone parameters. More... | |
at_ble_status_t | eddystone_set_beacon_id (beacon_id_t *uid) |
Update the Eddystone UID value. More... | |
at_ble_status_t | eddystone_set_beacon_interval (uint16_t beacon_interval_ms) |
Update the beacon interval value. More... | |
at_ble_status_t | eddystone_set_encoded_url (uint8_t *url_val, uint8_t len) |
Update Eddystone URL in the encoded form. More... | |
at_ble_status_t | eddystone_set_power_mode (eddystone_tx_power_mode_t tx_power_mode) |
Update the advertised TX power mode in Eddystone-URL. More... | |
at_ble_status_t | eddystone_set_uid_calib_tx_power (int8_t tx_power_0m, at_ble_tx_power_level_t radio_tx_power) |
Update the calibrated TX power present in the Eddystone-UID frame. More... | |
at_ble_status_t | eddystone_tlm_frame_send (eddystone_tlm_data_t *tlm_data) |
Start sending the Eddystone TLM frames. More... | |
at_ble_status_t | eddystone_uid_frame_send () |
Start sending the Eddystone UID frames. More... | |
at_ble_status_t | eddystone_url_frame_send () |
Start sending the Eddystone URL frames. More... | |
static void | esuid_data_reset (void) |
Functions to reset the UID and URL related parameters to default values. More... | |
at_ble_status_t | esurl_char_changed_event (void *params) |
Event handling callback functions. More... | |
at_ble_status_t | esurl_conf_adv_start (uint16_t adv_interval) |
Start the advertisement for Eddystone configuration service. More... | |
static at_ble_status_t | esurl_conf_chars_reset (void) |
Resets all the configuration service characteristics to their default values. More... | |
at_ble_status_t | esurl_conf_service_init (esurl_conf_gatt_service_t *serv) |
Initialize the Eddystone URL configuration service. More... | |
static void | esurl_data_reset (void) |
Resets the URL related parameters to their default values. More... | |
at_ble_status_t | esurl_dev_connected_event (void *params) |
Callback to handle the device connected event. More... | |
at_ble_status_t | esurl_dev_disconnected_event (void *params) |
Callback to handle the device disconnected event. More... | |
at_ble_status_t | esurl_paired_event (void *params) |
Callback to handle the device paired event. More... | |
at_ble_status_t | esurl_read_authorize_event (void *params) |
at_ble_status_t | esurl_write_authorize_event (void *params) |
Callback to handle write authorization for the URL configuration characteristics. More... | |
Variables | |
volatile uint32_t | eddystone_100ms_counter = 0 |
100ms counter value used in the creation of TLM frame. More... | |
static volatile uint8_t | eddystone_adv_enabled = 0 |
static uint8_t | es_adv_data [AT_BLE_ADV_MAX_SIZE] |
static at_ble_handle_t | es_conf_conn_handle |
volatile eddystone_mode_t | es_mode = EDDYSTONE_BEACON_MODE |
static uint8_t | es_scan_data [AT_BLE_ADV_MAX_SIZE] |
static uint8_t | es_url_adv_data [AT_BLE_ADV_MAX_SIZE] |
esuid_data_t | esuid_data |
Eddystone-UID related data. More... | |
static uint8_t | esurl_conf_char_initialized = 0 |
const ble_gap_event_cb_t | esurl_conf_gap_cb |
Eddystone GAP events handler initialization. More... | |
const ble_gatt_server_event_cb_t | esurl_conf_gatt_server_cb |
Eddystone GATT server events handler initialization. More... | |
esurl_conf_gatt_service_t | esurl_conf_service |
Eddystone-URL configuration service information. More... | |
esurl_data_t | esurl_data |
Eddystone-URL related data. More... | |
#define CONVERT_MS_TO_625_US_UNIT | ( | x | ) | ((x * 16)/10) |
Convert ms to 0.625ms units; Required to set advertisement intervals.
Referenced by eddystone_adv_start().
#define EDDYSTONE_FRAME_HEADER_LEN (8) |
Referenced by eddystone_create_url_frame().
#define EDDYSTONE_FRAME_TYPE_OFFSET (8) |
Referenced by eddystone_adv_start().
#define EDDYSTONE_HEADER | ( | adv_data, | |
index | |||
) |
Referenced by eddystone_create_tlm_frame(), eddystone_create_uid_frame(), and eddystone_create_url_frame().
#define EDDYSTONE_MAX_URL_ENC_LEN (18) |
Referenced by eddystone_create_url_frame(), and eddystone_set_encoded_url().
#define EDDYSTONE_SERV_DATA_LEN_OFFSET (4) |
Eddystone specific defines.
Referenced by eddystone_adv_start(), eddystone_create_tlm_frame(), eddystone_create_uid_frame(), and eddystone_create_url_frame().
#define EDDYSTONE_TX_POWER_MODES_NUM (4) |
Referenced by esurl_conf_chars_reset(), esurl_conf_service_init(), and esurl_write_authorize_event().
#define ESURL_CONF_CHAR_UUID_DIFF_OFFSET (12) |
Eddystone URL configuration service defines.
Referenced by esurl_conf_service_init().
#define ESURL_LOCK_CODE_MAX_SIZE (16) |
Referenced by esurl_conf_service_init(), and esurl_write_authorize_event().
#define ESURL_URI_FLAG_SIZE (1) |
Referenced by esurl_write_authorize_event().
#define HIGH_BYTE | ( | x | ) | (uint8_t)((((uint16_t)x) >> 8) & 0xFF) |
Referenced by eddystone_create_tlm_frame(), eddystone_set_beacon_interval(), and esurl_data_reset().
#define LOCKED (1) |
Possible lock states.
Referenced by esurl_write_authorize_event().
#define LOW_BYTE | ( | x | ) | (uint8_t)(((uint16_t)x) & 0xFF) |
Extract LSB and MSB from 16-bit value.
Referenced by eddystone_create_tlm_frame(), eddystone_set_beacon_interval(), and esurl_data_reset().
#define UNLOCKED (0) |
Referenced by esurl_write_authorize_event().
typedef struct esuid_data_t esuid_data_t |
Eddystone-UID beacon data.
typedef struct esurl_data_t esurl_data_t |
Eddystone-URL beacon data.
One byte of the UUID value that changes for each characteristics of the URL configuration service.
|
static |
Starts the Eddystone advertisement.
References adv_data, at_ble_adv_data_update_on_the_fly_t::adv_data, at_ble_adv_data_update_on_the_fly_t::adv_data_len, ADV_DATA_PRESENT, AT_BLE_ADV_BROADCASTER_MODE, at_ble_adv_data_set(), at_ble_adv_data_update_on_the_fly(), AT_BLE_ADV_FP_ANY, at_ble_adv_start(), AT_BLE_ADV_TYPE_NONCONN_UNDIRECTED, AT_BLE_FAILURE, AT_BLE_SUCCESS, esurl_data_t::beacon_period, convert_byte_array_to_16_bit(), CONVERT_MS_TO_625_US_UNIT, DBG_LOG, eddystone_adv_enabled, EDDYSTONE_BEACON_MODE, EDDYSTONE_FRAME_TYPE_OFFSET, EDDYSTONE_IDLE_MODE, EDDYSTONE_SERV_DATA_LEN_OFFSET, EDDYSTONE_TLM, EDDYSTONE_TOTAL_TLM_FRAME_LENGTH, EDDYSTONE_TOTAL_UID_FRAME_LENGTH, EDDYSTONE_UID, EDDYSTONE_URL, es_mode, length, NULL, and at_ble_adv_data_update_on_the_fly_t::presence_bit_mask.
Referenced by eddystone_tlm_frame_send(), eddystone_uid_frame_send(), and eddystone_url_frame_send().
at_ble_status_t eddystone_adv_stop | ( | void | ) |
Stop the Eddystone advertisement.
Stop transmitting Eddystone beacons.
References at_ble_adv_stop(), AT_BLE_FAILURE, AT_BLE_SUCCESS, eddystone_adv_enabled, EDDYSTONE_IDLE_MODE, and es_mode.
Referenced by eddystone_tlm_frame_send(), eddystone_uid_frame_send(), eddystone_url_frame_send(), and esurl_conf_adv_start().
|
static |
Creates Eddystone-TLM frame from battery voltage value, beacon temperature, advertisement PDU count and 100ms counter.
References at_ble_get_adv_cnt(), AT_BLE_SUCCESS, eddystone_tlm_data_t::battery_voltage_mV, eddystone_100ms_counter, EDDYSTONE_HEADER, EDDYSTONE_SERV_DATA_LEN_OFFSET, EDDYSTONE_TLM, EDDYSTONE_TLM_FRAME_VERSION, HIGH_BYTE, LOW_BYTE, and eddystone_tlm_data_t::temperature.
Referenced by eddystone_tlm_frame_send().
|
static |
Creates Eddystone-UID frame from 16-byte beacon ID and calibrated TX power value.
It also set the radio TX power of the device
References AT_BLE_SUCCESS, at_ble_tx_power_set(), esuid_data_t::beacon_id, EDDYSTONE_HEADER, EDDYSTONE_SERV_DATA_LEN_OFFSET, EDDYSTONE_UID, esuid_data_t::radio_tx_power, esuid_data_t::tx_power_0m, and beacon_id_t::value.
Referenced by eddystone_uid_frame_send().
|
static |
Creates Eddystone-URL frame from URI data and advertised TX power value.
It also sets the radio TX power of the device
References esurl_data_t::adv_tx_power_level, AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_tx_power_set(), DBG_LOG, EDDYSTONE_FRAME_HEADER_LEN, EDDYSTONE_HEADER, EDDYSTONE_MAX_URL_ENC_LEN, EDDYSTONE_SERV_DATA_LEN_OFFSET, EDDYSTONE_URL, esurl_data_t::radio_tx_power_level, esurl_data_t::tx_power_mode, esurl_data_t::uri_data, and esurl_data_t::uri_len.
Referenced by eddystone_url_frame_send().
eddystone_mode_t eddystone_get_mode | ( | void | ) |
Get current mode of the Eddystone beacon.
Obtain the current mode of the Eddystone beacon.
References es_mode.
Referenced by eddystone_custom_event(), and main().
at_ble_status_t eddystone_init | ( | void | ) |
Initializes all Eddystone parameters.
Eddystone initialization; all UID and URL data are reset to default values.
References AT_BLE_SUCCESS, esuid_data_reset(), and esurl_data_reset().
Referenced by eddystone_app_init().
at_ble_status_t eddystone_set_beacon_id | ( | beacon_id_t * | uid | ) |
Update the Eddystone UID value.
Update the Eddystone-UID (beacon ID).
References AT_BLE_SUCCESS, esuid_data_t::beacon_id, beacon_id_t::instance_id, and beacon_id_t::namespace_id.
at_ble_status_t eddystone_set_beacon_interval | ( | uint16_t | beacon_interval_ms | ) |
Update the beacon interval value.
Update the beacon interval.
Restart sending the Eddystone frames to use the updated beacon interval
References at_ble_characteristic_value_set(), AT_BLE_FAILURE, esurl_data_t::beacon_period, CHAR_BEACON_PERIOD, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, esurl_conf_char_initialized, HIGH_BYTE, and LOW_BYTE.
at_ble_status_t eddystone_set_encoded_url | ( | uint8_t * | url_val, |
uint8_t | len | ||
) |
Update Eddystone URL in the encoded form.
Update the Eddystone URL value.
References at_ble_characteristic_value_set(), AT_BLE_FAILURE, CHAR_URI_DATA, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, EDDYSTONE_MAX_URL_ENC_LEN, esurl_conf_char_initialized, esurl_data_t::uri_data, and esurl_data_t::uri_len.
at_ble_status_t eddystone_set_power_mode | ( | eddystone_tx_power_mode_t | tx_power_mode | ) |
Update the advertised TX power mode in Eddystone-URL.
Update the TX power mode to be advertised.
References at_ble_characteristic_value_set(), AT_BLE_FAILURE, CHAR_TX_POWER_MODE, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, esurl_conf_char_initialized, and esurl_data_t::tx_power_mode.
at_ble_status_t eddystone_set_uid_calib_tx_power | ( | int8_t | tx_power_0m, |
at_ble_tx_power_level_t | radio_tx_power | ||
) |
Update the calibrated TX power present in the Eddystone-UID frame.
Update the calibrated TX power value present in the Eddystone-UID frame.
References AT_BLE_SUCCESS, esuid_data_t::radio_tx_power, and esuid_data_t::tx_power_0m.
at_ble_status_t eddystone_tlm_frame_send | ( | eddystone_tlm_data_t * | tlm_data | ) |
Start sending the Eddystone TLM frames.
Start sending Eddystone TLM beacons continuously The TLM frame is created out of battery voltage value, beacon temperature, advertisement PDU count and time since boot up.
References AT_BLE_SUCCESS, eddystone_adv_start(), eddystone_adv_stop(), eddystone_create_tlm_frame(), EDDYSTONE_URL_CONFIG_MODE_ADV, es_adv_data, and es_mode.
Referenced by main().
at_ble_status_t eddystone_uid_frame_send | ( | void | ) |
Start sending the Eddystone UID frames.
Start sending Eddystone UID beacons continuously The UID frame is created out of parameters like Beacon ID and calibrated tx power at 0m.
References AT_BLE_SUCCESS, eddystone_adv_start(), eddystone_adv_stop(), eddystone_create_uid_frame(), EDDYSTONE_URL_CONFIG_MODE_ADV, es_adv_data, and es_mode.
Referenced by eddystone_app_init(), and main().
at_ble_status_t eddystone_url_frame_send | ( | void | ) |
Start sending the Eddystone URL frames.
Start sending Eddystone URL beacons continuously The URL frame is created out of encoded URL and advertised tx power level at 0m.
References at_ble_disconnect(), AT_BLE_SUCCESS, AT_BLE_TERMINATED_BY_USER, eddystone_adv_start(), eddystone_adv_stop(), eddystone_create_url_frame(), EDDYSTONE_URL_CONFIG_MODE_ADV, EDDYSTONE_URL_CONFIG_MODE_CONNECTED, es_conf_conn_handle, es_mode, and es_url_adv_data.
Referenced by eddystone_app_init(), eddystone_custom_event(), esurl_dev_disconnected_event(), and main().
|
static |
Functions to reset the UID and URL related parameters to default values.
Resets the UID related parameters to their default values.
References esuid_data_t::beacon_id, CONF_ES_CALIB_TX_PWR_0m, CONF_ES_INSTANCE_ID, CONF_ES_NAMESPACE_ID, CONF_ES_RADIO_TX_PWR_0m, esuid_data, beacon_id_t::instance_id, beacon_id_t::namespace_id, esuid_data_t::radio_tx_power, and esuid_data_t::tx_power_0m.
Referenced by eddystone_init().
at_ble_status_t esurl_char_changed_event | ( | void * | params | ) |
Event handling callback functions.
Callback to handle Characteristics changed event.
References AT_BLE_FAILURE, at_ble_characteristic_changed_t::char_handle, at_ble_characteristic_changed_t::char_len, at_ble_characteristic_changed_t::char_offset, and DBG_LOG.
at_ble_status_t esurl_conf_adv_start | ( | uint16_t | adv_interval | ) |
Start the advertisement for Eddystone configuration service.
Start the Eddystone-URL configuration service.
References esurl_data_t::adv_tx_power_level, ADV_TYPE_SIZE, at_ble_adv_data_set(), AT_BLE_ADV_FP_ANY, AT_BLE_ADV_GEN_DISCOVERABLE, at_ble_adv_start(), AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_SUCCESS, at_ble_tx_power_set(), AT_BLE_UUID_128_LEN, COMPLETE_LIST_128BIT_SERV_UUIDS, COMPLETE_LOCAL_NAME, CONF_ES_CONF_ADV_DATA_COMPLETE_LOCAL_NAME, eddystone_adv_enabled, eddystone_adv_stop(), EDDYSTONE_URL_CONF_SERVICE_UUID, EDDYSTONE_URL_CONFIG_MODE_ADV, es_adv_data, es_mode, es_scan_data, ESURL_CONF_ADV_TIMEOUT, NULL, esurl_data_t::radio_tx_power_level, TX_POWER_LEVEL, TX_POWER_LEVEL_SIZE, and TX_POWER_MODE_MEDIUM.
Referenced by eddystone_custom_event().
|
static |
Resets all the configuration service characteristics to their default values.
References esurl_data_t::adv_tx_power_level, at_ble_characteristic_value_set(), AT_BLE_FAILURE, AT_BLE_SUCCESS, esurl_data_t::beacon_period, CHAR_ADV_TX_POWER_LEVELS, CHAR_BEACON_PERIOD, CHAR_LOCK_STATE, CHAR_TX_POWER_MODE, CHAR_URI_DATA, CHAR_URI_FLAGS, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, EDDYSTONE_TX_POWER_MODES_NUM, esurl_data_reset(), esurl_data_t::lock_state, esurl_data_t::tx_power_mode, esurl_data_t::uri_data, esurl_data_t::uri_flags, and esurl_data_t::uri_len.
Referenced by esurl_write_authorize_event().
at_ble_status_t esurl_conf_service_init | ( | esurl_conf_gatt_service_t * | serv | ) |
Initialize the Eddystone URL configuration service.
Eddystone URL Configuration Service and Characteristics initialization.
References esurl_data_t::adv_tx_power_level, 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_REQ_AUTHR, AT_BLE_ATTR_WRITABLE_REQ_AUTHN_REQ_AUTHR, AT_BLE_CHAR_READ, AT_BLE_CHAR_WRITE, at_ble_primary_service_define(), AT_BLE_SUCCESS, AT_BLE_UUID_128, AT_BLE_UUID_128_LEN, esurl_data_t::beacon_period, BLE_PAIR_ENABLE, CHAR_ADV_TX_POWER_LEVELS, CHAR_BEACON_PERIOD, CHAR_LOCK, CHAR_LOCK_STATE, CHAR_RESET, CHAR_TX_POWER_MODE, CHAR_UNLOCK, CHAR_URI_DATA, CHAR_URI_FLAGS, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, at_ble_characteristic_t::client_config_handle, at_ble_characteristic_t::client_config_permissions, CONF_ES_DEFAULT_URL_SIZE, EDDYSTONE_TX_POWER_MODES_NUM, EDDYSTONE_URI_DATA_MAX_SIZE, EDDYSTONE_URL_CONF_SERVICE_UUID, esurl_conf_char_initialized, ESURL_CONF_CHAR_NUM, ESURL_CONF_CHAR_UUID_DIFF_OFFSET, esurl_data_reset(), ESURL_LOCK_CODE_MAX_SIZE, esurl_conf_gatt_service_t::handle, at_ble_characteristic_t::init_value, esurl_data_t::lock_code, esurl_data_t::lock_code_len, esurl_data_t::lock_state, NULL, at_ble_characteristic_t::presentation_format, at_ble_characteristic_t::properties, at_ble_characteristic_t::server_config_handle, at_ble_characteristic_t::server_config_permissions, esurl_data_t::tx_power_mode, at_ble_uuid_t::type, esurl_data_t::uri_data, esurl_data_t::uri_flags, at_ble_characteristic_t::user_desc, at_ble_characteristic_t::user_desc_handle, at_ble_characteristic_t::user_desc_len, at_ble_characteristic_t::user_desc_max_len, at_ble_characteristic_t::user_desc_permissions, esurl_conf_gatt_service_t::uuid, at_ble_uuid_t::uuid, at_ble_characteristic_t::uuid, UUID_CHAR_ADV_TX_POWER, UUID_CHAR_BEACON_PERIOD, UUID_CHAR_FLAGS, UUID_CHAR_LOCK, UUID_CHAR_LOCK_STATE, UUID_CHAR_RESET, UUID_CHAR_TX_POWER_MODE, UUID_CHAR_UNLOCK, UUID_CHAR_URI_DATA, at_ble_characteristic_t::value_init_len, at_ble_characteristic_t::value_max_len, and at_ble_characteristic_t::value_permissions.
Referenced by eddystone_app_init().
|
static |
Resets the URL related parameters to their default values.
References esurl_data_t::adv_tx_power_level, esurl_data_t::beacon_period, CONF_ES_DEFAULT_ADV_TX_PWR_HIGH, CONF_ES_DEFAULT_ADV_TX_PWR_LOW, CONF_ES_DEFAULT_ADV_TX_PWR_LOWEST, CONF_ES_DEFAULT_ADV_TX_PWR_MEDIUM, CONF_ES_DEFAULT_BEACON_PERIOD_MS, CONF_ES_DEFAULT_LOCK_CODE, CONF_ES_DEFAULT_LOCK_CODE_SIZE, CONF_ES_DEFAULT_LOCK_STATE, CONF_ES_DEFAULT_RADIO_TX_PWR_HIGH, CONF_ES_DEFAULT_RADIO_TX_PWR_LOW, CONF_ES_DEFAULT_RADIO_TX_PWR_LOWEST, CONF_ES_DEFAULT_RADIO_TX_PWR_MEDIUM, CONF_ES_DEFAULT_URL, CONF_ES_DEFAULT_URL_SIZE, EDDYSTONE_URI_FLAG, HIGH_BYTE, esurl_data_t::lock_code, esurl_data_t::lock_code_len, esurl_data_t::lock_state, LOW_BYTE, esurl_data_t::radio_tx_power_level, esurl_data_t::tx_power_mode, TX_POWER_MODE_HIGH, TX_POWER_MODE_LOW, TX_POWER_MODE_LOWEST, TX_POWER_MODE_MEDIUM, esurl_data_t::uri_data, esurl_data_t::uri_flags, and esurl_data_t::uri_len.
Referenced by eddystone_init(), esurl_conf_chars_reset(), and esurl_conf_service_init().
at_ble_status_t esurl_dev_connected_event | ( | void * | params | ) |
Callback to handle the device connected event.
References AT_BLE_SUCCESS, at_ble_connected_t::conn_status, eddystone_adv_enabled, EDDYSTONE_URL_CONFIG_MODE_CONNECTED, es_conf_conn_handle, es_mode, and at_ble_connected_t::handle.
at_ble_status_t esurl_dev_disconnected_event | ( | void * | params | ) |
Callback to handle the device disconnected event.
References AT_BLE_SUCCESS, DBG_LOG, EDDYSTONE_IDLE_MODE, eddystone_url_frame_send(), and es_mode.
at_ble_status_t esurl_paired_event | ( | void * | params | ) |
Callback to handle the device paired event.
References AT_BLE_SUCCESS, and DBG_LOG.
at_ble_status_t esurl_read_authorize_event | ( | void * | params | ) |
at_ble_status_t esurl_write_authorize_event | ( | void * | params | ) |
Callback to handle write authorization for the URL configuration characteristics.
References esurl_data_t::adv_tx_power_level, AT_BLE_ATT_INSUFF_AUTHOR, AT_BLE_ATT_INVALID_ATTRIBUTE_VAL_LEN, AT_BLE_ATT_WRITE_NOT_PERMITTED, at_ble_characteristic_value_set(), AT_BLE_FAILURE, AT_BLE_SUCCESS, at_ble_write_authorize_reply(), esurl_data_t::beacon_period, CHAR_ADV_TX_POWER_LEVELS, CHAR_BEACON_PERIOD, at_ble_characteristic_write_request_t::char_handle, CHAR_LOCK, CHAR_LOCK_STATE, CHAR_RESET, CHAR_TX_POWER_MODE, CHAR_UNLOCK, CHAR_URI_DATA, CHAR_URI_FLAGS, at_ble_characteristic_t::char_val_handle, esurl_conf_gatt_service_t::chars, convert_16_bit_to_byte_array(), convert_byte_array_to_16_bit(), DBG_LOG, EDDYSTONE_BEACON_INTERVAL_MS_MAX, EDDYSTONE_BEACON_INTERVAL_MS_MIN, EDDYSTONE_TX_POWER_MODES_NUM, esurl_conf_chars_reset(), ESURL_LOCK_CODE_MAX_SIZE, ESURL_URI_FLAG_SIZE, at_ble_characteristic_write_request_t::length, esurl_data_t::lock_code, esurl_data_t::lock_code_len, esurl_data_t::lock_state, LOCKED, esurl_data_t::tx_power_mode, TX_POWER_MODE_HIGH, TX_POWER_MODE_LOWEST, UNLOCKED, esurl_data_t::uri_data, esurl_data_t::uri_flags, esurl_data_t::uri_len, and at_ble_characteristic_write_request_t::value.
volatile uint32_t eddystone_100ms_counter = 0 |
100ms counter value used in the creation of TLM frame.
This counter variable needs to be updated by the application for every 100ms
Referenced by eddystone_create_tlm_frame(), and timer_callback_handler().
|
static |
Referenced by eddystone_adv_start(), eddystone_adv_stop(), esurl_conf_adv_start(), and esurl_dev_connected_event().
|
static |
Referenced by eddystone_tlm_frame_send(), eddystone_uid_frame_send(), and esurl_conf_adv_start().
|
static |
Referenced by eddystone_url_frame_send(), and esurl_dev_connected_event().
volatile eddystone_mode_t es_mode = EDDYSTONE_BEACON_MODE |
|
static |
Referenced by esurl_conf_adv_start().
|
static |
Referenced by eddystone_url_frame_send().
esuid_data_t esuid_data |
Eddystone-UID related data.
Referenced by esuid_data_reset().
|
static |
const ble_gap_event_cb_t esurl_conf_gap_cb |
Eddystone GAP events handler initialization.
Eddystone GAP events callback handler.
Referenced by eddystone_app_init().
const ble_gatt_server_event_cb_t esurl_conf_gatt_server_cb |
Eddystone GATT server events handler initialization.
Eddystone GATT server events callback handler.
Referenced by eddystone_app_init().
esurl_conf_gatt_service_t esurl_conf_service |
Eddystone-URL configuration service information.
Referenced by eddystone_app_init().
esurl_data_t esurl_data |
Eddystone-URL related data.