Classes | Macros | Typedefs | Enumerations | Functions
esls_c.h File Reference

Electronic Shelf Label AP Client API. More...

`#include "gr_includes.h"`
`#include "ble_prf_types.h"`
`#include "custom_config.h"`
`#include <stdint.h>`
`#include <stdbool.h>`
`#include "pawr_adv.h"`
Include dependency graph for esls_c.h:

Go to the source code of this file.

## Classes
struct | esls_c_handles_t
| Handles on the connected peer device needed to interact with it. More...
struct | esls_c_led_infor_t
| Electronic Shelf Label LED infor type. More...
struct | esls_c_evt_t
| Electronic Shelf Label Client event. More...

## Macros
#define | ESL_CTL_PT_TLV_MAX_LEN 17
| Value for MAX esl TlV data len. More...
#define | ESL_TLV_CMD_TAG(OPCODE) (OPCODE & 0xF)
#define | ESL_TLV_CMD_LEN(OPCODE) ((OPCODE>>4) & 0xF)
#define | ESL_TLV_CMD_CHECK(OPCODE, length) ((ESL_TLV_CMD_LEN(OPCODE)==(length -2))?true:false)
#define | ESL_BASIC_STATE_SERV_NEED_POS 0
| Offset for basic state bits. More...
#define | ESL_BASIC_STATE_SYNC_POS 1
#define | ESL_BASIC_STATE_ACTIVE_LED_POS 2
#define | ESL_BASIC_STATE_LED_UPDATE_POS 3
#define | ESL_BASIC_STATE_DISP_UPDATE_POS 4
#define | ESL_ADDR_ESL_ID_BROAD_ADDR 0xFF
| The value 0xFF is reserved for the Broadcast Address. More...
#define | ESL_ADDR_INVALID_GRP_ID 0xFF
| The value 0xFF is reserved for the Invalid Group Address. More...

## Typedefs
typedef void(* | esls_c_evt_handler_t) (esls_c_evt_t *p_evt)
| Electronic Shelf Label Client event handler type. More...

## Enumerations
enum | esl_cmd_opcode_t { ESL_CMD_OPCODE_PING = 0x00, ESL_CMD_OPCODE_UNASSOCIATE_AP, ESL_CMD_OPCODE_SRV_RST, ESL_CMD_OPCODE_FACTORY_RST, ESL_CMD_OPCODE_UPDATE_COMP, ESL_CMD_OPCODE_RD_SENSOR_DATA = 0x10, ESL_CMD_OPCODE_REFRESH_DISP, ESL_CMD_OPCODE_DISP_IMAGE = 0x20, ESL_CMD_OPCODE_DISP_TIM_IMAGE = 0x60, ESL_CMD_OPCODE_LED_CTL = 0xB0, ESL_CMD_OPCODE_LED_TIM_CTL = 0xF0, ESL_CMD_OPCODE_PING = 0x00, ESL_CMD_OPCODE_UNASSOCIATE_AP, ESL_CMD_OPCODE_SRV_RST, ESL_CMD_OPCODE_FACTORY_RST, ESL_CMD_OPCODE_UPDATE_COMP, ESL_CMD_OPCODE_RD_SENSOR_DATA = 0x10, ESL_CMD_OPCODE_REFRESH_DISP, ESL_CMD_OPCODE_DISP_IMAGE = 0x20, ESL_CMD_OPCODE_DISP_TIM_IMAGE = 0x60, ESL_CMD_OPCODE_LED_CTL = 0xB0, ESL_CMD_OPCODE_LED_TIM_CTL = 0xF0, ESL_CMD_OPCODE_VEND_SPEC_TAG = 0x0F }
| Values for The ESL Control Point characteristic command procedure. More...
enum | esl_rsp_err_code_t { ESL_RSP_ERR_CODE_RFU = 0x00, ESL_RSP_ERR_CODE_UNSPEC, ESL_RSP_ERR_CODE_INVALID_OPCODE, ESL_RSP_ERR_CODE_INVALID_STATE, ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX, ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE, ESL_RSP_ERR_CODE_INVALID_PARAM, ESL_RSP_ERR_CODE_CAPACITY_LIMIT, ESL_RSP_ERR_CODE_INSUFF_BATTERY, ESL_RSP_ERR_CODE_INSUFF_RESOURCE, ESL_RSP_ERR_CODE_RETRY, ESL_RSP_ERR_CODE_QUEUE_FULL, ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM, ESL_RSP_ERR_CODE_VEND_BEGIN = 0xF0, ESL_RSP_ERR_CODE_VEND_NO_ERR = 0xFF, ESL_RSP_ERR_CODE_MAX = 0x100, ESL_RSP_ERR_CODE_RFU = 0x00, ESL_RSP_ERR_CODE_UNSPEC, ESL_RSP_ERR_CODE_INVALID_OPCODE, ESL_RSP_ERR_CODE_INVALID_STATE, ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX, ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE, ESL_RSP_ERR_CODE_INVALID_PARAM, ESL_RSP_ERR_CODE_CAPACITY_LIMIT, ESL_RSP_ERR_CODE_INSUFF_BATTERY, ESL_RSP_ERR_CODE_INSUFF_RESOURCE, ESL_RSP_ERR_CODE_RETRY, ESL_RSP_ERR_CODE_QUEUE_FULL, ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM, ESL_RSP_ERR_CODE_VEND_BEGIN = 0xF0, ESL_RSP_ERR_CODE_VEND_NO_ERR = 0xFF, ESL_RSP_ERR_CODE_MAX = 0x100 }
| The Error response has a single parameter that contains an error code . More...
enum | esl_rsp_opcode_t { ESL_RSP_OPCODE_ERR = 0x00, ESL_RSP_OPCODE_LED_STATE, ESL_RSP_OPCODE_BASIC_STATE = 0x10, ESL_RSP_OPCODE_DISP_STATE = 0x11, ESL_RSP_OPCODE_SENSOR_TAG = 0x0E, ESL_RSP_OPCODE_VEND_TAG = 0x0F, ESL_RSP_OPCODE_ERR = 0x00, ESL_RSP_OPCODE_LED_STATE, ESL_RSP_OPCODE_BASIC_STATE = 0x10, ESL_RSP_OPCODE_DISP_STATE = 0x11, ESL_RSP_OPCODE_SENSOR_TAG = 0x0E, ESL_RSP_OPCODE_VEND_TAG = 0x0F }
| The ESL Control Point characteristic response behavior. More...
enum | esls_c_key_type_t { ESLS_C_AP_SYNC_KEY_FLAG, ESLS_C_ESL_RSP_KEY_FLAG, ESLS_C_ESL_KEY_FLAG_MAX }
| Electronic Shelf Label Key Material type. More...
enum | esls_c_evt_type_t { ESLS_C_EVT_INVALID, ESLS_C_EVT_DISCOVERY_COMPLETE, ESLS_C_EVT_DISCOVERY_FAIL, ESLS_C_EVT_ESL_ADDR_SET_SUCCESS, ESLS_C_EVT_AP_SYNC_KEY_SET_SUCCESS, ESLS_C_EVT_ESL_RSP_KEY_SET_SUCCESS, ESLS_C_EVT_ESL_ABS_TIM_SET_SUCCESS, ESLS_C_EVT_ESL_DISP_READ_INFO, ESLS_C_EVT_ESL_IMAGE_READ_INFO, ESLS_C_EVT_ESL_SENSOR_READ_INFO, ESLS_C_EVT_ESL_LED_READ_INFO, ESLS_C_EVT_CTRL_POINT_SET_RSP, ESLS_C_EVT_CTRL_POINT_CCCD_SET, ESLS_C_EVT_CTRL_POINT_RSP_RECEIVE, ESLS_C_EVT_ESL_SYNC_RSP_RECEIVE, ESLS_C_EVT_WRITE_OP_ERR }
| Electronic Shelf Label User event to APP. More...
enum | esl_vendor_opcode_t { ESL_VENDOR_REQ_DEVICE_NAME, ESL_VENDOR_RSP_DEVICE_NAME, ESL_VENDOR_REQ_BD_ADDR, ESL_VENDOR_RSP_BD_ADDR, ESL_VENDOR_IMAGE_START_REQ, ESL_VENDOR_IMAGE_START_RSP, ESL_VENDOR_IMAGE_END_NTF, ESL_VENDOR_OPCODE_MAX = 0xFF, ESL_VENDOR_REQ_DEVICE_NAME, ESL_VENDOR_RSP_DEVICE_NAME, ESL_VENDOR_REQ_BD_ADDR, ESL_VENDOR_RSP_BD_ADDR, ESL_VENDOR_IMAGE_START_REQ, ESL_VENDOR_IMAGE_START_RSP, ESL_VENDOR_IMAGE_END_NTF, ESL_VENDOR_OPCODE_MAX = 0xFF }
| Values for contrl point vendor command and response. More...
enum | esl_vendor_data_err_t { ESL_VENDOR_DATA_NO_ERR, ESL_VENDOR_DATA_ERR_CKSUM, ESL_VENDOR_DATA_ERR_LEN, ESL_VENDOR_DATA_NO_ERR, ESL_VENDOR_DATA_ERR_CKSUM, ESL_VENDOR_DATA_ERR_LEN }
| Values for contrl point vendor command data error code. More...
enum | led_type_t { led_sRGB, led_mono }
| Values for LED type enumeration. More...

## Functions
sdk_err_t | esls_client_init (esls_c_evt_handler_t evt_handler)
| Register ESLS Client event handler. More...
sdk_err_t | esl_ap_adv_param_fast_set (uint8_t adv_idx, struct ble_per_adv_param_t *per_adv_params_p)
| Set ESL AP PAwR adv paramters. More...
void | ble_esl_pawr_evt_on_ble_capture (const ble_evt_t *p_evt)
| Capture PAwR events on BLE. More...
sdk_err_t | esls_c_esl_sent_buffer_register (pawr_sent_data_arr_t *esl_sent_data_buff, uint8_t grp_number)
| Set ESL AP PAwR subevt data buffer, the subevt data will temporarily store here until it's sent. More...
sdk_err_t | esls_c_disc_srvc_start (uint8_t conn_idx)
| Discovery Electronic Shelf Label service on peer. More...
sdk_err_t | esls_c_ctrl_point_notify_set (uint8_t conn_idx, bool is_enable)
| Enable or disable peer Electronic Shelf Label characteristic notify. More...
sdk_err_t | esls_c_esl_addr_set (uint8_t conn_idx, uint8_t esl_id, uint8_t group_id)
| Set Electronic Shelf Label service esl address characteristic. More...
sdk_err_t | esls_c_esl_key_set (uint8_t conn_idx, esls_c_key_type_t key_flag, uint8_t session_key[16], uint8_t iv[8])
| Set Electronic Shelf Label service key material characteristic. More...
sdk_err_t | esls_c_esl_current_abs_time_set (uint8_t conn_idx, uint32_t abs_time)
| Set Electronic Shelf Label service current absolute time characteristic. More...
sdk_err_t | esls_c_disp_info_read (uint8_t conn_idx)
| Set Electronic Shelf Label service display information characteristic. More...
sdk_err_t | esls_c_image_info_read (uint8_t conn_idx)
| Set Electronic Shelf Label service image information characteristic. More...
sdk_err_t | esls_c_sensor_info_read (uint8_t conn_idx)
| Set Electronic Shelf Label service sensor information characteristic. More...
sdk_err_t | esls_c_led_info_read (uint8_t conn_idx)
| Set Electronic Shelf Label service led information characteristic. More...
sdk_err_t | esls_c_esl_ping (uint8_t conn_idx, uint8_t esl_id)
| Sent ESL ping cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_unassociate_from_ap (uint8_t conn_idx, uint8_t esl_id)
| Sent ESL unassociate from AP cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_service_reset (uint8_t conn_idx, uint8_t esl_id)
| Sent ESL service reset cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_factory_reset (uint8_t conn_idx, uint8_t esl_id)
| Sent ESL factory reset cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_update_complete (uint8_t conn_idx, uint8_t esl_id)
| Sent ESL update complete cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_read_sensor_data (uint8_t conn_idx, uint8_t esl_id, uint8_t sensor_idx)
| Sent ESL read sensor data cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_refresh_disp (uint8_t conn_idx, uint8_t esl_id, uint8_t disp_idx)
| Sent ESL refresh display cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_disp_image (uint8_t conn_idx, uint8_t esl_id, uint8_t disp_idx, uint8_t image_idx)
| Sent ESL display image cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_disp_time_image (uint8_t conn_idx, uint8_t esl_id, uint8_t disp_idx, uint8_t image_idx, uint32_t abs_tim)
| Sent ESL display image time cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_led_ctl (uint8_t conn_idx, uint8_t esl_id, uint8_t led_idx, uint8_t color_RGB_bright, uint8_t flashing_pattern[7], uint8_t repeat_type, uint16_t repeat_duration)
| Sent ESL LED control cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_led_time_ctl (uint8_t conn_idx, uint8_t esl_id, uint8_t led_idx, uint8_t color_RGB_bright, uint8_t flashing_pattern[7], uint8_t repeat_type, uint16_t repeat_duration, uint32_t abs_tim)
| Sent ESL LED control cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_vendor_cmd (uint8_t conn_idx, uint8_t esl_id, uint16_t value_length, uint8_t *ctrl_value_p)
| Sent ESL vendor cmd by Electronic Shelf Label service control point characteristic. More...
sdk_err_t | esls_c_esl_sync_ping (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id)
| Sent ESL ping cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_unassociate_from_ap (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id)
| Sent ESL ESL unassociate from AP cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_service_reset (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id)
| Sent ESL service reset cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_factory_reset (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id)
| Sent ESL factory reset cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_update_complete (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id)
| Sent ESL update complete cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_read_sensor_data (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t sensor_idx)
| Sent ESL read sensor data cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_refresh_disp (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t disp_idx)
| Sent ESL refresh display cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_disp_image (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t disp_idx, uint8_t image_idx)
| Sent ESL display image cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_disp_time_image (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t disp_idx, uint8_t image_idx, uint32_t abs_tim)
| Sent ESL display image time cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_led_ctl (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t led_idx, uint8_t color_RGB_bright, uint8_t flashing_pattern[7], uint8_t repeat_type, uint16_t repeat_duration)
| Sent ESL LED control cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_led_time_ctl (uint8_t grp_id, uint8_t sent_num, uint8_t esl_id, uint8_t led_idx, uint8_t color_RGB_bright, uint8_t flashing_pattern[7], uint8_t repeat_type, uint16_t repeat_duration, uint32_t abs_tim)
| Sent ESL LED control time cmd by Electronic Shelf Label PAwR Advertising subevt. More...
sdk_err_t | esls_c_esl_sync_vendor_cmd (uint8_t grp_id, uint8_t esl_id, uint8_t *data, uint16_t data_len, uint8_t sent_num)
| Sent ESL vendor cmd by Electronic Shelf Label PAwR Advertising subevt. More...

## Detailed Description

Electronic Shelf Label AP Client API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file esls_c.h.