Classes | Macros | Typedefs | Enumerations | Functions | Variables
esls.h File Reference

Electronic Shelf Label Service API. More...

`#include "gr_includes.h"`
`#include "custom_config.h"`
`#include <stdint.h>`
`#include <stdbool.h>`

Go to the source code of this file.

## Classes
struct | esls_ap_sync_param_t
| Electronic Shelf Label Service sync parameter format. More...
struct | esls_display_arr_t
| Electronic Shelf Label Service display information data. More...
struct | esls_sensor_arr_t
| Electronic Shelf Label Service sensor information data. More...
struct | esls_led_arr_t
| Electronic Shelf Label Service led information data. More...
struct | esls_char_infor_t
| Electronic Shelf Label Service characteristic information. More...
struct | esls_evt_t
| Electronic Shelf Label Service event. More...
struct | esls_nvds_cb_t
| Electronic Shelf Label Service NVDS callback func. More...
struct | esls_init_t
| Electronic Shelf Label Service Init variable. More...

## Macros
#define | PAWR_MAX_SENT_DATA_LEN 250
#define | PAWR_SENT_DATA_LEN_OFFSET 0
#define | PAWR_SENT_DATA_TYPE_OFFSET 1
#define | ESLS_CONNECTION_MAX 10
#define | ESL_ADDR_LEN 2
#define | ESL_SESSION_KEY_LEN 16
#define | ESL_IV_LEN 8
#define | AP_SYNC_KEY_MATERIAL_LEN (ESL_SESSION_KEY_LEN + ESL_IV_LEN)
#define | ESL_RSP_KEY_MATERIAL_LEN (ESL_SESSION_KEY_LEN + ESL_IV_LEN)
#define | ESL_CTL_PT_TLV_MIN_LEN 2
#define | ESL_CTL_PT_TLV_MAX_LEN 17
#define | ESL_MAX_VAL_LEN 512
#define | ESL_ADDR_ESL_ID_BROAD_ADDR 0xFF
#define | ESL_CTL_PT_SENSOR_DATA_MAX_LEN 15
#define | ESL_VENDOR_DATA_MAX_LEN 15
#define | esls_sensor_size00(x) x&0xFF, (x>>8)&0xFF
#define | esls_sensor_size01(y) y&0xFF, (y>>8)&0xFF, (y>>16)&0xFF, (y>>24)&0xFF
#define | GRP_ID_MSK(esl_addr) (esl_addr & 0x7F)
#define | ESL_TLV_CMD_TAG(OPCODE) (OPCODE & 0xF)
#define | ESL_TLV_CMD_LEN(OPCODE) ((OPCODE>>4) & 0xF)
#define | ESL_VEND_TAG 0x0F
#define | ESL_LED_INFOR_TYPE_RGB(x) (x & 0x3F)
#define | ESL_LED_INFOR_TYPE_MON(y) ((y & 0x3F)|(0x40))
#define | ESLS_CHAR_MANDATORY 0xE01FF
#define | ESLS_CHAR_DISPLAY_INFOR_SUP 0x00600
#define | ESLS_CHAR_IMAGE_INFOR_SUP 0x01800
#define | ESLS_CHAR_SENSOR_INFOR_SUP 0x06000
#define | ESLS_CHAR_LED_INFOR_SUP 0x18000
#define | ESLS_CONFIG_ADDR_MASK 0x1
#define | ESLS_CONFIG_SYNC_KEY_MASK 0x2
#define | ESLS_CONFIG_RSP_KEY_MASK 0x4
#define | ESLS_CONFIG_ABS_TIME_MASK 0x8
#define | ESLS_CONFIG_COMPLETE_MASK (ESLS_CONFIG_ADDR_MASK|ESLS_CONFIG_SYNC_KEY_MASK|ESLS_CONFIG_RSP_KEY_MASK|ESLS_CONFIG_ABS_TIME_MASK)

## Typedefs
typedef uint8_t(* | ble_app_nvds_get_cb_t) (uint8_t tag, uint8_t *p_len, uint8_t *p_buf)
| Electronic Shelf Label Service NVDS callback func define. More...
typedef uint8_t(* | ble_app_nvds_put_cb_t) (uint8_t tag, uint8_t len, uint8_t *p_buf)
typedef uint8_t(* | ble_app_nvds_del_cb_t) (uint8_t tag)
typedef sdk_err_t(* | esls_evt_handler_t) (esls_evt_t *p_evt)
| Electronic Shelf Label Service event handler func define. More...
typedef bool(* | app_dev_reset_cbk_t) (uint8_t conn_idx, bool factory_rst)

## 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 | ESL_DISP_TYPE_T { ESL_DISP_TYPE_BLACK_WHITE = 0x01, ESL_DISP_TYPE_THREE_GRAY_SCALE, ESL_DISP_TYPE_FOUR_GRAY_SCALE, ESL_DISP_TYPE_EIGHT_GRAY_SCALE, ESL_DISP_TYPE_SIXTEEN_GRAY_SCALE, ESL_DISP_TYPE_RED_BLACK_WHITE, ESL_DISP_TYPE_YELLOW_BLACK_WHITE, ESL_DISP_TYPE_RED_YELLOW_BLACK_WHITE, ESL_DISP_TYPE_SEVEN_COLOR, ESL_DISP_TYPE_SIXTEEN_COLOR, ESL_DISP_TYPE_FULL_RGB }
| The value of the Display_Type field is from an enumeration , which identifies the colors that are supported by the display and may provide additional information about the display. 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 The ESL Control Point characteristic vendor command procedure. 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 | esls_evt_type_t { ESLS_EVT_NOTIFICATION_ENABLED, ESLS_EVT_NOTIFICATION_DISABLED, ESLS_EVT_WRITE_VEND_COMMAND, ESLS_EVT_UNASSOCIATE_FROM_AP, ESLS_EVT_SERVICE_RESET, ESLS_EVT_FACTORY_RESET, ESLS_EVT_CURRENT_ABS_TIM, ESLS_EVT_READ_SENSOR_DATA, ESLS_EVT_REFRESH_DISPLAY, ESLS_EVT_DISPLAY_IMAGE, ESLS_EVT_DISPLAY_TIMED_IMAGE, ESLS_EVT_LED_CTL, ESLS_EVT_LED_TIMED_CTL, ESLS_EVT_TX_DATA_SENT, ESLS_EVT_NO_NEED_PROC }
| Electronic Shelf Label Service event types. More...
enum | ESL_STATE_T { UNASSOCIAT_STATE, CONFIGURING_STATE, SYNCHRONIZE_STATE, UPDATING_STATE, UNSYNCHRONIZE_STATE, ESL_STATE_MAX }
| Electronic Shelf Label Service state machine types. More...
enum | ESL_SYNC_STATE_T { SYNC_STATE_IDLE, SYNC_STATE_START, SYNC_STATE_ACTIVE, SYNC_STATE_MAX }
| Electronic Shelf Label Service state machine types. More...
enum | ESLS_NVDS_PARAM_ID_T { PARAM_ID_ESL_CONFIG_INFOR = 0xcb }
| Electronic Shelf Label Service List of NVDS parameters identifiers. More...

## Functions
struct | __attribute__ ((packed))
| Electronic Shelf Label Service display information format. More...
sdk_err_t | esls_service_init (esls_init_t *p_esls_init)
| Init a Electronic Shelf Label Service instance and add in the DB. More...
bool | esls_service_nvds_load_flag_get (void)
| Get Electronic Shelf Label Service nvds load flag. More...
void | ble_esls_evt_on_ble_capture (const ble_evt_t *p_evt)
| Capture esl service events on BLE. More...
uint16_t | esls_service_start_handle_get (void)
| Provide the interface for other modules to obtain the esls service start handle . More...
sdk_err_t | esls_sync_past_param_set (esls_ap_sync_param_t *sync_past_ptr)
| Set Electronic Shelf Label default per sync trans parameter. Will be used after created conection with AP. More...
sdk_err_t | esls_set_state_machine (ESL_STATE_T esl_state)
| Set Electronic Shelf Label state machine. More...
ESL_STATE_T | esls_get_state_machine (void)
| Get Electronic Shelf Label state machine. More...
void | esls_service_reset (void)
| Reset Electronic Shelf Label Service state and database. More...
sdk_err_t | esls_tlv_response_send (uint8_t conn_idx, uint8_t *rsp_data_p, uint16_t len)
| Send response message to AP. More...
sdk_err_t | esls_err_state_send (uint8_t conn_idx, esl_rsp_err_code_t err_code)
| a Electronic Shelf Label Service reponse AP with a Error code. More...
sdk_err_t | esls_led_state_send (uint8_t conn_idx, uint8_t led_idx)
| a Electronic Shelf Label Service reponse of LED control command . More...
sdk_err_t | esls_base_state_send (uint8_t conn_idx)
| Sent a Electronic Shelf Label Service base state. More...
sdk_err_t | esls_sensor_value_send (uint8_t conn_idx, uint8_t sensor_idx, uint8_t *sensor_data_p, uint8_t len)
| Sent Electronic Shelf Label Service sensor data. More...
sdk_err_t | esls_display_state_send (uint8_t conn_idx, uint8_t display_idx, uint8_t image_idx)
| Sent Electronic Shelf Label Service diaplay state. More...
sdk_err_t | esls_user_payload_send (uint8_t conn_idx, uint8_t user_opcode, uint8_t *esl_payload, uint16_t esl_len)
| Sent Electronic Shelf Label Service user data. More...
sdk_err_t | esls_user_payload_prepare (uint8_t *esl_sent_buffer, uint16_t *esl_sent_buffer_offset, uint8_t user_opcode, uint8_t *esl_payload, uint16_t esl_len)
| Set Electronic Shelf Label Service user data in esl_sent_buffer, will sent later. More...
uint16_t | esls_service_need_state_set (bool flag)
| Electronic Shelf Label Service service need state set. More...
uint16_t | esls_service_need_state_get (void)
| Get Electronic Shelf Label Service service need state . More...
uint16_t | esls_sync_to_ap_state_set (bool flag)
| Electronic Shelf Label Service sync state set. More...
uint16_t | esls_sync_to_ap_state_get (void)
| Get Electronic Shelf Label Service sync state . More...
uint16_t | esls_active_led_state_set (bool flag)
| Electronic Shelf Label Service active LED state set. More...
uint16_t | esls_active_led_state_get (void)
| Get Electronic Shelf Label Service active LED state state . More...
uint16_t | esls_pending_led_update_state_set (bool flag)
| Electronic Shelf Label Service pengding LED state set. More...
uint16_t | esls_pending_led_update_state_get (void)
| Get Electronic Shelf Label Service pengding LED state state . More...
uint16_t | esls_pending_display_update_state_set (bool flag)
| Electronic Shelf Label Service pengding display state set. More...
uint16_t | esls_pending_display_update_state_get (void)
| Get Electronic Shelf Label Service pengding display state state . More...

## Variables
| esls_display_infor_t
| esls_key_material_t
| esls_display_cmd_t
| esls_led_cmd_t
| esls_ecp_cmd_t
| esls_tlv_format_t

## Detailed Description

Electronic Shelf Label Service 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.h.