esls.h
Go to the documentation of this file.
1 /**
2  *****************************************************************************************
3  *
4  * @file esls.h
5  *
6  * @brief Electronic Shelf Label Service API.
7  *
8  *****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  *****************************************************************************************
36  */
37 
38 /**
39  * @addtogroup BLE_SRV BLE Services
40  * @{
41  * @brief Definitions and prototypes for the BLE Service interface.
42  */
43 
44 /**
45  * @defgroup BLE_SDK_ESLS Electronic Shelf Label Service (ESLS)
46  * @{
47  * @brief Definitions and prototypes for the ESLS interface.
48  *
49  * @details The Electronic Shelf Label Service allows electronic shelf labels (ESLs) to be controlled and updated using
50  * Bluetooth wireless technology.The ESL Service enables a Client to discover the capabilities of the ESL and
51  * to send configuration settings to an ESL on which the service is exposed.The Bluetooth wireless technology
52  * that can be used to update and control the ESL is described by this specification.
53  */
54 
55 #ifndef __ESLS_H__
56 #define __ESLS_H__
57 
58 #include "gr_includes.h"
59 #include "custom_config.h"
60 #include <stdint.h>
61 #include <stdbool.h>
62 
63 /**
64  * @defgroup ESLS_MACRO Defines
65  * @{
66  */
67 #define PAWR_MAX_SENT_DATA_LEN 250 /**< Maximum data length per subevt. */
68 #define PAWR_SENT_DATA_LEN_OFFSET 0 /**< Advertising data length field offset. */
69 #define PAWR_SENT_DATA_TYPE_OFFSET 1 /**< Advertising data type field offset. */
70 
71 #define ESLS_CONNECTION_MAX 10 /**< Maximum number of Electronic Shelf Label Service connections. */
72 #define ESL_ADDR_LEN 2 /**< Maximum length of heart rate measurement characteristic. */
73 #define ESL_SESSION_KEY_LEN 16 /**< The length of shared session key. */
74 #define ESL_IV_LEN 8 /**< The length of initialization vector. */
75 #define AP_SYNC_KEY_MATERIAL_LEN (ESL_SESSION_KEY_LEN + ESL_IV_LEN) /**< The encryption keys of AP sent data . */
76 #define ESL_RSP_KEY_MATERIAL_LEN (ESL_SESSION_KEY_LEN + ESL_IV_LEN) /**< The encryption keys of ESL response data . */
77 #define ESL_CTL_PT_TLV_MIN_LEN 2 /**< The shortest TLV length . */
78 #define ESL_CTL_PT_TLV_MAX_LEN 17 /**< The longest TLV length . */
79 #define ESL_MAX_VAL_LEN 512
80 
81 #define ESL_ADDR_ESL_ID_BROAD_ADDR 0xFF /**< The value 0xFF is reserved for the Broadcast Address. */
82 
83 #define ESL_CTL_PT_SENSOR_DATA_MAX_LEN 15 /**< The max sensor data length. */
84 #define ESL_VENDOR_DATA_MAX_LEN 15 /**< The max vendor data length. */
85 
86 #define esls_sensor_size00(x) x&0xFF, (x>>8)&0xFF
87 #define esls_sensor_size01(y) y&0xFF, (y>>8)&0xFF, (y>>16)&0xFF, (y>>24)&0xFF
88 
89 #define GRP_ID_MSK(esl_addr) (esl_addr & 0x7F)
90 #define ESL_TLV_CMD_TAG(OPCODE) (OPCODE & 0xF) /**< Get opcode tag field. */
91 #define ESL_TLV_CMD_LEN(OPCODE) ((OPCODE>>4) & 0xF) /**< Get opcode length field. */
92 #define ESL_VEND_TAG 0x0F /**< Vendor tag field. */
93 #define ESL_LED_INFOR_TYPE_RGB(x) (x & 0x3F) /**< sRGB LED Type. */
94 #define ESL_LED_INFOR_TYPE_MON(y) ((y & 0x3F)|(0x40)) /**< Monochrome LED Type. */
95 /** @} */
96 
97 /**
98  * @defgroup ESLS_CHAR_MASK Characteristics Mask
99  * @{
100  * @brief Bit masks for the initialization of \ref esls_init_t.char_mask.
101  */
102 
103 #define ESLS_CHAR_MANDATORY 0xE01FF /**< Bit mask of the mandatory characteristics. */
104 #define ESLS_CHAR_DISPLAY_INFOR_SUP 0x00600 /**< Bit mask of esl display information Feature Supported. */
105 #define ESLS_CHAR_IMAGE_INFOR_SUP 0x01800 /**< Bit mask of esl image information Feature Supported. */
106 #define ESLS_CHAR_SENSOR_INFOR_SUP 0x06000 /**< Bit mask of esl sensor information Feature Supported. */
107 #define ESLS_CHAR_LED_INFOR_SUP 0x18000 /**< Bit mask of esl LED information Feature Supported. */
108 /** @} */
109 
110 /**
111  * @defgroup ESLS_CONFIG_MASK Characteristics Mask
112  * @{
113  * @brief Bit masks for the initialization of esls_env_t.config_mask.
114  */
115 #define ESLS_CONFIG_ADDR_MASK 0x1 /**< Bit mask of the address characteristics config flag . */
116 #define ESLS_CONFIG_SYNC_KEY_MASK 0x2 /**< Bit mask of the sync key characteristics config flag . */
117 #define ESLS_CONFIG_RSP_KEY_MASK 0x4 /**< Bit mask of the response key characteristics config flag . */
118 #define ESLS_CONFIG_ABS_TIME_MASK 0x8 /**< Bit mask of the current time characteristics config flag . */
119 
120 #define ESLS_CONFIG_COMPLETE_MASK (ESLS_CONFIG_ADDR_MASK|ESLS_CONFIG_SYNC_KEY_MASK|ESLS_CONFIG_RSP_KEY_MASK|ESLS_CONFIG_ABS_TIME_MASK)
121 
122 /** @} */
123 
124 /**
125  * @defgroup ESLS_ENUM Enumerations
126  * @{
127  */
128 /**@brief Values for The ESL Control Point characteristic command procedure. */
129 typedef enum
130 {
131  ESL_CMD_OPCODE_PING = 0x00, /**< The ESL Control Point characteristic command procedure is ping. */
132  ESL_CMD_OPCODE_UNASSOCIATE_AP, /**< The ESL Control Point characteristic command procedure is Unassociate from AP. */
133  ESL_CMD_OPCODE_SRV_RST, /**< The ESL Control Point characteristic command procedure is Service Reset. */
134  ESL_CMD_OPCODE_FACTORY_RST, /**< The ESL Control Point characteristic command procedure is Factory Reset. */
135  ESL_CMD_OPCODE_UPDATE_COMP, /**< The ESL Control Point characteristic command procedure is Update Complete. */
136  ESL_CMD_OPCODE_RD_SENSOR_DATA = 0x10, /**< The ESL Control Point characteristic command procedure is Read Sensor Data. */
137  ESL_CMD_OPCODE_REFRESH_DISP, /**< The ESL Control Point characteristic command procedure is Refresh Display. */
138  ESL_CMD_OPCODE_DISP_IMAGE = 0x20, /**< The ESL Control Point characteristic command procedure is Display Image. */
139  ESL_CMD_OPCODE_DISP_TIM_IMAGE = 0x60, /**< The ESL Control Point characteristic command procedure is Display Timed Image. */
140  ESL_CMD_OPCODE_LED_CTL = 0xB0, /**< The ESL Control Point characteristic command procedure is LED Control. */
141  ESL_CMD_OPCODE_LED_TIM_CTL = 0xF0, /**< The ESL Control Point characteristic command procedure is LED Timed Control. */
143 
144 /** @brief The Error response has a single parameter that contains an error code .**/
145 typedef enum
146 {
147  ESL_RSP_ERR_CODE_RFU = 0x00, /**< Reserved for Future Use. */
148  ESL_RSP_ERR_CODE_UNSPEC, /**< Any error condition that is not covered by a specific error code below. */
149  ESL_RSP_ERR_CODE_INVALID_OPCODE, /**< The opcode was not recognized. */
150  ESL_RSP_ERR_CODE_INVALID_STATE, /**< The request was not valid for the present ESL state. */
151  ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX, /**< The Image_Index value was out of range. */
152  ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE, /**< The requested image contained no image data. */
153  ESL_RSP_ERR_CODE_INVALID_PARAM, /**< The parameter value(s) or length did not match the opcode. */
154  ESL_RSP_ERR_CODE_CAPACITY_LIMIT, /**< The required response could not be sent as it would exceed the payload size limit. */
155  ESL_RSP_ERR_CODE_INSUFF_BATTERY, /**< The request could not be processed because of a lack of battery charge. */
156  ESL_RSP_ERR_CODE_INSUFF_RESOURCE, /**< The request could not be processed because of a lack of resources. This may be a temporary condition.. */
157  ESL_RSP_ERR_CODE_RETRY, /**< The ESL is temporarily unable to give a full response (e.g., because the required sensor hardware was asleep) and the AP is asked to try the same command again. */
158  ESL_RSP_ERR_CODE_QUEUE_FULL, /**< The ESL is temporarily unable to add a further timed command to the queue of pending commands¡ªthe queue has reached its limit. */
159  ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM, /**< The Absolute Time parameter value in the command is implausible. */
160  ESL_RSP_ERR_CODE_VEND_BEGIN = 0xF0, /**< Error codes defined by a vendor. */
161  ESL_RSP_ERR_CODE_VEND_NO_ERR = 0xFF, /**< Error codes defined by a vendor to represent no error. */
162 
163  ESL_RSP_ERR_CODE_MAX = 0x100, /**< Error codes defined MAX. */
165 
166 /** @brief The ESL Control Point characteristic response behavior**/
167 typedef enum
168 {
169  ESL_RSP_OPCODE_ERR = 0x00, /**< The command could not be processed successfully. */
170  ESL_RSP_OPCODE_LED_STATE, /**< Acknowledgment of a request to control an LED. */
171  ESL_RSP_OPCODE_BASIC_STATE = 0x10, /**< General acknowledgment containing ESL status data. */
172  ESL_RSP_OPCODE_DISP_STATE = 0x11, /**< Acknowledgment of a request to display an image. */
173  ESL_RSP_OPCODE_SENSOR_TAG = 0x0E, /**< Sensor report. */
174  ESL_RSP_OPCODE_VEND_TAG = 0x0F, /**< Response data as specified by the vendor of the ESL. */
176 
177 /** @brief 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.*/
178 typedef enum
179 {
180  ESL_DISP_TYPE_BLACK_WHITE = 0x01, /**< the display supported show the colors of black white. */
181  ESL_DISP_TYPE_THREE_GRAY_SCALE, /**< the display supported show the colors of three gray scale. */
182  ESL_DISP_TYPE_FOUR_GRAY_SCALE, /**< the display supported show the colors of four gray scale. */
183  ESL_DISP_TYPE_EIGHT_GRAY_SCALE, /**< the display supported show the colors of eight gray scale. */
184  ESL_DISP_TYPE_SIXTEEN_GRAY_SCALE, /**< the display supported show the colors of sixteen gray scale. */
185  ESL_DISP_TYPE_RED_BLACK_WHITE, /**< the display supported show the colors of red black white. */
186  ESL_DISP_TYPE_YELLOW_BLACK_WHITE, /**< the display supported show the colors of yellow black white. */
187  ESL_DISP_TYPE_RED_YELLOW_BLACK_WHITE, /**< the display supported show the colors of red yellow black white. */
188  ESL_DISP_TYPE_SEVEN_COLOR, /**< the display supported show the colors of seven color. */
189  ESL_DISP_TYPE_SIXTEEN_COLOR, /**< the display supported show the colors of sixteen color. */
190  ESL_DISP_TYPE_FULL_RGB, /**< the display supported show the colors of full RGB. */
192 
193 /**@brief Values for The ESL Control Point characteristic vendor command procedure. */
194 typedef enum
195 {
196  ESL_VENDOR_REQ_DEVICE_NAME, /**< The ESL profile vendor command to request peer device name. */
197  ESL_VENDOR_RSP_DEVICE_NAME, /**< The ESL profile has received peer device name. */
198  ESL_VENDOR_REQ_BD_ADDR, /**< The ESL profile vendor command to request peer device bd_addr. */
199  ESL_VENDOR_RSP_BD_ADDR, /**< The ESL profile has received peer device bd_addr. */
200  ESL_VENDOR_IMAGE_START_REQ, /**< The ESL profile vendor command to request start image transport. */
201  ESL_VENDOR_IMAGE_START_RSP, /**< The ESL profile vendor command to response start image transport. */
202  ESL_VENDOR_IMAGE_END_NTF, /**< The ESL profile vendor command to notify image transport end. */
205 
206 /**@brief Values for contrl point vendor command data error code. */
207 typedef enum
208 {
209  ESL_VENDOR_DATA_NO_ERR, /**< The ESL profile vendor data no error. */
210  ESL_VENDOR_DATA_ERR_CKSUM, /**< The ESL profile vendor data error is checksum fail. */
211  ESL_VENDOR_DATA_ERR_LEN, /**< The ESL profile vendor data error is invalid-length . */
213 
214 /**@brief Electronic Shelf Label Service event types. */
215 typedef enum
216 {
217  ESLS_EVT_NOTIFICATION_ENABLED, /**< Electronic Shelf Label value notification has been enabled. */
218  ESLS_EVT_NOTIFICATION_DISABLED, /**< Electronic Shelf Label value notification has been disabled. */
219  ESLS_EVT_WRITE_VEND_COMMAND, /**< Electronic Shelf Label vendor command procedure, \ref esl_vendor_opcode_t. */
220  ESLS_EVT_UNASSOCIATE_FROM_AP, /**< Electronic Shelf Label unassociate from AP command report to user. */
221  ESLS_EVT_SERVICE_RESET, /**< Electronic Shelf Label service reset command report to user. */
222  ESLS_EVT_FACTORY_RESET, /**< Electronic Shelf Label factory reset command report to user. */
223  ESLS_EVT_CURRENT_ABS_TIM, /**< Electronic Shelf Label set current absolute time command report to user. */
224  ESLS_EVT_READ_SENSOR_DATA, /**< Electronic Shelf Label read sensor data command . */
225  ESLS_EVT_REFRESH_DISPLAY, /**< Electronic Shelf Label refresh display. */
226  ESLS_EVT_DISPLAY_IMAGE, /**< Electronic Shelf Label display Image. */
227  ESLS_EVT_DISPLAY_TIMED_IMAGE, /**< Electronic Shelf Label display Image, when the timer timeout. */
228  ESLS_EVT_LED_CTL, /**< Electronic Shelf Label control LED. */
229  ESLS_EVT_LED_TIMED_CTL, /**< Electronic Shelf Label control LED, when the timer timeout. */
230  ESLS_EVT_TX_DATA_SENT, /**< The data from the application has been sent, and the service is ready to accept new data from the application. */
231  ESLS_EVT_NO_NEED_PROC, /**< Electronic Shelf Label event max value. */
233 
234 /**@brief Electronic Shelf Label Service state machine types. */
235 typedef enum{
236  UNASSOCIAT_STATE, /**< Electronic Shelf Label unassociated state of state machine . */
237  CONFIGURING_STATE, /**< Electronic Shelf Label configuring state of state machine . */
238  SYNCHRONIZE_STATE, /**< Electronic Shelf Label synchronized state of state machine . */
239  UPDATING_STATE, /**< Electronic Shelf Label updating state of state machine . */
240  UNSYNCHRONIZE_STATE, /**< Electronic Shelf Label unsynchronized state of state machine . */
241  ESL_STATE_MAX, /**< Electronic Shelf Label state machine max value. */
242 }ESL_STATE_T;
243 
244 /**@brief Electronic Shelf Label Service state machine types. */
245 typedef enum{
246  SYNC_STATE_IDLE, /**< Electronic Shelf Label sync procedure is idle . */
247  SYNC_STATE_START, /**< Electronic Shelf Label sync procedure is starting . */
248  SYNC_STATE_ACTIVE, /**< Electronic Shelf Label sync procedure is running . */
251 
252 /**@brief Electronic Shelf Label Service List of NVDS parameters identifiers. */
253 typedef enum
254 {
255  /// Definition of the tag associated to each parameters
256  /// Service config information tag id
259 
260 /** @} */
261 
262 /**
263  * @defgroup ESLC_STRUCT Structures
264  * @{
265  */
266 
267 /**@brief Electronic Shelf Label Service sync parameter format. */
268 typedef struct
269 {
270  ESL_SYNC_STATE_T sync_state; /**< ESL Service state machine. */
271  bool config_flag; /**< ESL Service sync paramter config flag. */
272  uint8_t sync_idx; /**< ESL Service sync index. */
273  uint16_t sync_to; /**< ESL Service sync timeout. */
274  ble_gap_bdaddr_t target_addr; /**< ESL Service sync peer device bd addr. */
275  uint16_t target_id_len; /**< ESL Service sync peer device target id length. */
276  char target_id[128]; /**< ESL Service sync peer device target id. */
278 
279 /**@brief Electronic Shelf Label Service display information format. */
280 typedef struct __attribute__((packed))
281 {
282  uint16_t esls_display_width; /**< The width of the display in pixels. */
283  uint16_t esls_display_height; /**< The height of the display in pixels. */
284  uint8_t esls_display_type; /**< ESL Service display type, \ref ESL_DISP_TYPE_T. */
286 
287 /**@brief Electronic Shelf Label Service display information data. */
289 {
290  uint16_t display_arr_len; /**< ESL Service display infor buffer len. */
291  uint8_t *display_arr_p; /**< ESL Service display infor buffer. */
292 };
293 
294 /**@brief Electronic Shelf Label Service sensor information data. */
296 {
297  uint16_t sensor_arr_len; /**< ESL Service sensor infor buffer len. */
298  uint8_t *sensor_arr_p; /**< ESL Service sensor infor buffer. */
299 };
300 
301 /**@brief Electronic Shelf Label Service led information data. */
303 {
304  uint16_t led_arr_len; /**< ESL Service led infor buffer len. */
305  uint8_t *led_arr_p; /**< ESL Service led infor buffer. */
306 };
307 
308 /**@brief Electronic Shelf Label Service characteristic information. */
309 typedef struct
310 {
311  struct esls_display_arr_t display_infor; /**< Electronic Shelf Label Service display infor struct. */
312  struct esls_sensor_arr_t sensor_infor; /**< Electronic Shelf Label Service sensor infor struct. */
313  struct esls_led_arr_t led_infor; /**< Electronic Shelf Label Service led infor struct. */
314  uint8_t max_image_idx; /**< Electronic Shelf Label Service max image index. */
316 
317 /**@brief Electronic Shelf Label Key Material. */
318 typedef struct __attribute__((packed))
319 {
320  uint8_t session_key[16];
321  uint8_t iv[8];
323 
324 /**@brief Electronic Shelf Label Service display image command data format. */
325 typedef struct __attribute__((packed))
326 {
327  uint8_t display_idx; /**< Electronic Shelf Label Service display index. */
328  uint8_t image_idx; /**< Electronic Shelf Label Service image index. */
329  uint32_t abs_time; /**< Time when the display changes state. */
331 
332 /**@brief Electronic Shelf Label Service led control command data format. */
333 typedef struct __attribute__((packed))
334 {
335  uint8_t led_idx;
336  uint8_t color_red:2;
337  uint8_t color_green:2;
338  uint8_t color_blue:2;
339  uint8_t color_brightness:2;
340  /**< a bit of 1 means led on (bit_on_period*2)ms; a bit of 0 means led off (bit_off_period*2)ms. There are max 40 bits periods to be present. */
341  uint8_t Pattern[5];
342  uint8_t bit_off_period;
343  uint8_t bit_on_period;
344  /*
345  * If Repeat_Type = 0, an integer number of repeats of the flashing pattern specified by the Flashing_Pattern fields.
346  * If Repeat_Type = 1, a time duration specified in units of seconds.
347  */
348  uint16_t repeat_type:1;
349  uint16_t repeat_duration:15; /**< Number of times to repeat, or time duration in increments of 1 second. */
350  uint32_t abs_time; /**< Time when the led changes state. */
352 
353 /**@brief Electronic Shelf Label Service control Point format. */
354 typedef struct __attribute__((packed))
355 {
356  uint8_t esl_id; /**< Electronic Shelf Label Service address id. */
357  union
358  {
359  uint8_t sensor_idx;
360  esls_display_cmd_t display_cmd;
361  esls_led_cmd_t led_cmd;
362  }data; /**< Electronic Shelf Label Service command data struct. */
364 
365 /**@brief Electronic Shelf Label data format. */
366 typedef struct __attribute__((packed))
367 {
368  esl_cmd_opcode_t Opcode; /**The ESL Control Point characteristic command opcode. */
369  uint8_t param[ESL_CTL_PT_TLV_MAX_LEN]; /**The ESL Control Point characteristic command data, struct type \ref esls_ecp_cmd_t. */
371 
372 /**@brief Electronic Shelf Label Service event. */
373 typedef struct
374 {
375  uint8_t conn_idx; /**< Index of connection. */
376  esls_evt_type_t evt_type; /**< Electronic Shelf Label Service event type. */
377  esls_tlv_format_t *tlv_data; /**< Electronic Shelf Label Service tlv data format. */
378  void *evt_data_ptr; /**< Electronic Shelf Label Service raw data format. */
379 } esls_evt_t;
380 
381 /**@brief Electronic Shelf Label Service NVDS callback func define. */
382 typedef uint8_t (*ble_app_nvds_get_cb_t)(uint8_t tag, uint8_t *p_len, uint8_t *p_buf);
383 typedef uint8_t (*ble_app_nvds_put_cb_t)(uint8_t tag, uint8_t len, uint8_t *p_buf);
384 typedef uint8_t (*ble_app_nvds_del_cb_t)(uint8_t tag);
385 
386 /**@brief Electronic Shelf Label Service NVDS callback func. */
387 typedef struct
388 {
389  ble_app_nvds_get_cb_t get_cb; /**< The pointer of Electronic Shelf Label Service nvds get func. */
390  ble_app_nvds_put_cb_t put_cb; /**< The pointer of Electronic Shelf Label Service nvds put func. */
391  ble_app_nvds_del_cb_t del_cb; /**< The pointer of Electronic Shelf Label Service nvds delete func. */
393 
394 /**@brief Electronic Shelf Label Service event handler func define. */
396 typedef bool (*app_dev_reset_cbk_t)(uint8_t conn_idx, bool factory_rst);
397 
398 /**@brief Electronic Shelf Label Service Init variable. */
399 typedef struct
400 {
401  uint32_t char_mask; /**< Mask of Supported characteristics, and configured with \ref ESLS_CHAR_MASK */
402  esls_char_infor_t esls_char_infor; /**< Electronic Shelf Label Service characteristic information. */
403  esls_evt_handler_t evt_handler; /**< Electronic Shelf Label Service event handler. */
404  esls_nvds_cb_t esls_nvds_cb; /**< Electronic Shelf Label Service NVDS callback func. */
405 } esls_init_t;
406 
407 /** @} */
408 
409 /**
410  * @defgroup ESLS_FUNCTION Functions
411  * @{
412  */
413 /**
414  *****************************************************************************************
415  * @brief Init a Electronic Shelf Label Service instance and add in the DB.
416  *
417  * @param[in] p_esls_init: Pointer to a Electronic Shelf Label Init variable.
418  *
419  * @return Result of service initialization.
420  *****************************************************************************************
421  */
423 
424 /**
425  *****************************************************************************************
426  * @brief Get Electronic Shelf Label Service nvds load flag.
427  *
428  * @return Result of nvds load flag.
429  *****************************************************************************************
430  */
432 
433 /**
434  *****************************************************************************************
435  * @brief Capture esl service events on BLE.
436  *
437  * @param[in] p_evt: pointer on BLE event.
438  *****************************************************************************************
439  */
441 
442 /**
443  *****************************************************************************************
444  * @brief Provide the interface for other modules to obtain the esls service start handle .
445  *
446  * @return The esls service start handle.
447  *****************************************************************************************
448  */
450 
451 /**
452  ****************************************************************************************
453  * @brief Set Electronic Shelf Label default per sync trans parameter. Will be used after created conection with AP
454  *
455  * @param[in] sync_past_ptr: Pointer to the parameters.
456  *
457  * @return Result of setting.
458  ****************************************************************************************
459  */
461 
462 /**
463  ****************************************************************************************
464  * @brief Set Electronic Shelf Label state machine
465  *
466  * @param[in] esl_state: Esl state to setting.
467  *
468  * @return Result of setting.
469  ****************************************************************************************
470  */
472 
473 /**
474  ****************************************************************************************
475  * @brief Get Electronic Shelf Label state machine
476  *
477  * @return Current Esl state.
478  ****************************************************************************************
479  */
481 
482 /**
483  *****************************************************************************************
484  * @brief Reset Electronic Shelf Label Service state and database.
485  *****************************************************************************************
486  */
488 
489 /**
490  *****************************************************************************************
491  * @brief Send response message to AP.
492  *
493  * @param[in] conn_idx: Connection index.
494  * @param[in] rsp_data_p: Pointer to the data of response.
495  * @param[in] len: the data length of response.
496  *
497  * @return Result of message response.
498  *****************************************************************************************
499  */
500 sdk_err_t esls_tlv_response_send(uint8_t conn_idx, uint8_t *rsp_data_p, uint16_t len);
501 
502 /**
503  *****************************************************************************************
504  * @brief a Electronic Shelf Label Service reponse AP with a Error code.
505  *
506  * @param[in] conn_idx: Connnection index..
507  * @param[in] err_code: The command could not be processed successfully, will response this err code.
508  *
509  * @return Result of data sent.
510  *****************************************************************************************
511  */
513 
514 /**
515  *****************************************************************************************
516  * @brief a Electronic Shelf Label Service reponse of LED control command .
517  *
518  * @param[in] conn_idx: Connnection index..
519  * @param[in] led_idx: LED index.
520  *
521  * @return Result of data sent.
522  *****************************************************************************************
523  */
524 sdk_err_t esls_led_state_send(uint8_t conn_idx, uint8_t led_idx);
525 
526 /**
527  *****************************************************************************************
528  * @brief Sent a Electronic Shelf Label Service base state.
529  *
530  * @param[in] conn_idx: Connnection index.
531  *
532  * @return Result of data sent.
533  *****************************************************************************************
534  */
535 sdk_err_t esls_base_state_send(uint8_t conn_idx);
536 
537 /**
538  *****************************************************************************************
539  * @brief Sent Electronic Shelf Label Service sensor data.
540  *
541  * @param[in] conn_idx: Connnection index.
542  * @param[in] sensor_idx: Sensor index.
543  * @param[in] sensor_data_p: Pointer of Sensor data.
544  * @param[in] len: Sensor data length.
545  *
546  * @return Result of data sent.
547  *****************************************************************************************
548  */
549 sdk_err_t esls_sensor_value_send(uint8_t conn_idx, uint8_t sensor_idx, uint8_t *sensor_data_p, uint8_t len);
550 
551 /**
552  *****************************************************************************************
553  * @brief Sent Electronic Shelf Label Service diaplay state.
554  *
555  * @param[in] conn_idx: Connnection index.
556  * @param[in] display_idx: display index.
557  * @param[in] image_idx: image index.
558  *
559  * @return Result of data sent.
560  *****************************************************************************************
561  */
562 sdk_err_t esls_display_state_send(uint8_t conn_idx, uint8_t display_idx, uint8_t image_idx);
563 
564 /**
565  *****************************************************************************************
566  * @brief Sent Electronic Shelf Label Service user data.
567  *
568  * @param[in] conn_idx: Connnection index.
569  * @param[in] user_opcode: User define opcode, \ref esl_vendor_opcode_t.
570  * @param[in] esl_payload: Pointer on payload data.
571  * @param[in] esl_len: Pointer on payload data.
572  *
573  * @return Result of data sent.
574  *****************************************************************************************
575  */
576 sdk_err_t esls_user_payload_send(uint8_t conn_idx, uint8_t user_opcode, uint8_t *esl_payload, uint16_t esl_len);
577 
578 /**
579  *****************************************************************************************
580  * @brief Set Electronic Shelf Label Service user data in esl_sent_buffer, will sent later.
581  *
582  * @param[in] esl_sent_buffer: data buffer.
583  * @param[in] esl_sent_buffer_offset: buffer head offset.
584  * @param[in] user_opcode: Opcode of payload data.
585  * @param[in] esl_payload: Pointer on payload data.
586  * @param[in] esl_len: Pointer on payload length.
587  *
588  * @return Result of data sent.
589  *****************************************************************************************
590  */
591 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);
592 
593 /**
594  *****************************************************************************************
595  * @brief Electronic Shelf Label Service service need state set.
596  *
597  * @param[in] flag: True or False.
598  *
599  * @return Result of service state.
600  *****************************************************************************************
601  */
602 uint16_t esls_service_need_state_set(bool flag);
603 
604 /**
605  *****************************************************************************************
606  * @brief Get Electronic Shelf Label Service service need state .
607  *
608  * @return Result of service state.
609  *****************************************************************************************
610  */
612 
613 /**
614  *****************************************************************************************
615  * @brief Electronic Shelf Label Service sync state set.
616  *
617  * @param[in] flag: True or False.
618  *
619  * @return Result of service state.
620  *****************************************************************************************
621  */
622 uint16_t esls_sync_to_ap_state_set(bool flag);
623 
624 /**
625  *****************************************************************************************
626  * @brief Get Electronic Shelf Label Service sync state .
627  *
628  * @return Result of service state.
629  *****************************************************************************************
630  */
632 
633 /**
634  *****************************************************************************************
635  * @brief Electronic Shelf Label Service active LED state set.
636  *
637  * @param[in] flag: True or False.
638  *
639  * @return Result of service state.
640  *****************************************************************************************
641  */
642 uint16_t esls_active_led_state_set(bool flag);
643 
644 /**
645  *****************************************************************************************
646  * @brief Get Electronic Shelf Label Service active LED state state .
647  *
648  * @return Result of service state.
649  *****************************************************************************************
650  */
652 
653 /**
654  *****************************************************************************************
655  * @brief Electronic Shelf Label Service pengding LED state set.
656  *
657  * @param[in] flag: True or False.
658  *
659  * @return Result of service state.
660  *****************************************************************************************
661  */
663 
664 /**
665  *****************************************************************************************
666  * @brief Get Electronic Shelf Label Service pengding LED state state .
667  *
668  * @return Result of service state.
669  *****************************************************************************************
670  */
672 
673 /**
674  *****************************************************************************************
675  * @brief Electronic Shelf Label Service pengding display state set.
676  *
677  * @param[in] flag: True or False.
678  *
679  * @return Result of service state.
680  *****************************************************************************************
681  */
683 
684 /**
685  *****************************************************************************************
686  * @brief Get Electronic Shelf Label Service pengding display state state .
687  *
688  * @return Result of service state.
689  *****************************************************************************************
690  */
692 
693 
694 /** @} */
695 
696 #endif
697 /** @} */
698 /** @} */
699 
ESL_VENDOR_IMAGE_END_NTF
@ ESL_VENDOR_IMAGE_END_NTF
Definition: esls.h:202
ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM
@ ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM
Definition: esls.h:159
ESL_CMD_OPCODE_UPDATE_COMP
@ ESL_CMD_OPCODE_UPDATE_COMP
Definition: esls.h:135
esls_evt_t
Electronic Shelf Label Service event.
Definition: esls.h:374
esls_init_t
Electronic Shelf Label Service Init variable.
Definition: esls.h:400
esls_ap_sync_param_t
Electronic Shelf Label Service sync parameter format.
Definition: esls.h:269
ESL_SYNC_STATE_T
ESL_SYNC_STATE_T
Electronic Shelf Label Service state machine types.
Definition: esls.h:245
esls_display_arr_t::display_arr_p
uint8_t * display_arr_p
Definition: esls.h:291
ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX
@ ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX
Definition: esls.h:151
ESL_DISP_TYPE_THREE_GRAY_SCALE
@ ESL_DISP_TYPE_THREE_GRAY_SCALE
Definition: esls.h:181
esls_led_arr_t::led_arr_p
uint8_t * led_arr_p
Definition: esls.h:305
ESL_RSP_ERR_CODE_QUEUE_FULL
@ ESL_RSP_ERR_CODE_QUEUE_FULL
Definition: esls.h:158
ESL_VENDOR_IMAGE_START_RSP
@ ESL_VENDOR_IMAGE_START_RSP
Definition: esls.h:201
esls_get_state_machine
ESL_STATE_T esls_get_state_machine(void)
Get Electronic Shelf Label state machine.
ESLS_EVT_READ_SENSOR_DATA
@ ESLS_EVT_READ_SENSOR_DATA
Definition: esls.h:224
ESL_CMD_OPCODE_LED_CTL
@ ESL_CMD_OPCODE_LED_CTL
Definition: esls.h:140
ESL_DISP_TYPE_SIXTEEN_GRAY_SCALE
@ ESL_DISP_TYPE_SIXTEEN_GRAY_SCALE
Definition: esls.h:184
ESL_STATE_T
ESL_STATE_T
Electronic Shelf Label Service state machine types.
Definition: esls.h:235
esls_active_led_state_get
uint16_t esls_active_led_state_get(void)
Get Electronic Shelf Label Service active LED state state .
esls_pending_led_update_state_get
uint16_t esls_pending_led_update_state_get(void)
Get Electronic Shelf Label Service pengding LED state state .
ESLS_EVT_NO_NEED_PROC
@ ESLS_EVT_NO_NEED_PROC
Definition: esls.h:231
esls_ap_sync_param_t::target_id_len
uint16_t target_id_len
Definition: esls.h:275
esls_evt_handler_t
sdk_err_t(* esls_evt_handler_t)(esls_evt_t *p_evt)
Electronic Shelf Label Service event handler func define.
Definition: esls.h:395
esls_init_t::esls_nvds_cb
esls_nvds_cb_t esls_nvds_cb
Definition: esls.h:404
esls_pending_led_update_state_set
uint16_t esls_pending_led_update_state_set(bool flag)
Electronic Shelf Label Service pengding LED state set.
ESL_DISP_TYPE_RED_BLACK_WHITE
@ ESL_DISP_TYPE_RED_BLACK_WHITE
Definition: esls.h:185
esls_service_start_handle_get
uint16_t esls_service_start_handle_get(void)
Provide the interface for other modules to obtain the esls service start handle .
ble_gap_bdaddr_t
The struct of broadcast address with broadcast type.
Definition: ble_gapc.h:269
esls_sensor_arr_t::sensor_arr_len
uint16_t sensor_arr_len
Definition: esls.h:297
esls_char_infor_t::max_image_idx
uint8_t max_image_idx
Definition: esls.h:314
esl_vendor_opcode_t
esl_vendor_opcode_t
Values for The ESL Control Point characteristic vendor command procedure.
Definition: esls.h:195
ESL_RSP_ERR_CODE_RETRY
@ ESL_RSP_ERR_CODE_RETRY
Definition: esls.h:157
ESL_CMD_OPCODE_REFRESH_DISP
@ ESL_CMD_OPCODE_REFRESH_DISP
Definition: esls.h:137
ESL_RSP_OPCODE_VEND_TAG
@ ESL_RSP_OPCODE_VEND_TAG
Definition: esls.h:174
esls_user_payload_send
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.
UPDATING_STATE
@ UPDATING_STATE
Definition: esls.h:239
esls_evt_t::conn_idx
uint8_t conn_idx
Definition: esls.h:375
gr_includes.h
Include Files API.
ESL_DISP_TYPE_RED_YELLOW_BLACK_WHITE
@ ESL_DISP_TYPE_RED_YELLOW_BLACK_WHITE
Definition: esls.h:187
ESL_VENDOR_IMAGE_START_REQ
@ ESL_VENDOR_IMAGE_START_REQ
Definition: esls.h:200
esl_cmd_opcode_t
esl_cmd_opcode_t
Values for The ESL Control Point characteristic command procedure.
Definition: esls.h:130
esls_evt_t::evt_type
esls_evt_type_t evt_type
Definition: esls.h:376
ESL_VENDOR_DATA_ERR_CKSUM
@ ESL_VENDOR_DATA_ERR_CKSUM
Definition: esls.h:210
esls_service_reset
void esls_service_reset(void)
Reset Electronic Shelf Label Service state and database.
SYNCHRONIZE_STATE
@ SYNCHRONIZE_STATE
Definition: esls.h:238
ESLS_EVT_REFRESH_DISPLAY
@ ESLS_EVT_REFRESH_DISPLAY
Definition: esls.h:225
ESL_DISP_TYPE_FULL_RGB
@ ESL_DISP_TYPE_FULL_RGB
Definition: esls.h:190
esls_led_cmd_t
esls_led_cmd_t
Definition: esls.h:351
esls_ap_sync_param_t::sync_state
ESL_SYNC_STATE_T sync_state
Definition: esls.h:270
ESL_RSP_OPCODE_DISP_STATE
@ ESL_RSP_OPCODE_DISP_STATE
Definition: esls.h:172
esls_sync_to_ap_state_set
uint16_t esls_sync_to_ap_state_set(bool flag)
Electronic Shelf Label Service sync state set.
UNASSOCIAT_STATE
@ UNASSOCIAT_STATE
Definition: esls.h:236
esls_service_need_state_get
uint16_t esls_service_need_state_get(void)
Get Electronic Shelf Label Service service need state .
esls_display_infor_t
esls_display_infor_t
Definition: esls.h:285
esls_init_t::esls_char_infor
esls_char_infor_t esls_char_infor
Definition: esls.h:402
ESL_RSP_ERR_CODE_RFU
@ ESL_RSP_ERR_CODE_RFU
Definition: esls.h:147
ESLS_EVT_CURRENT_ABS_TIM
@ ESLS_EVT_CURRENT_ABS_TIM
Definition: esls.h:223
ESL_RSP_OPCODE_SENSOR_TAG
@ ESL_RSP_OPCODE_SENSOR_TAG
Definition: esls.h:173
ESL_RSP_ERR_CODE_INSUFF_BATTERY
@ ESL_RSP_ERR_CODE_INSUFF_BATTERY
Definition: esls.h:155
ESL_RSP_ERR_CODE_INVALID_STATE
@ ESL_RSP_ERR_CODE_INVALID_STATE
Definition: esls.h:150
ESLS_EVT_LED_TIMED_CTL
@ ESLS_EVT_LED_TIMED_CTL
Definition: esls.h:229
esls_service_init
sdk_err_t esls_service_init(esls_init_t *p_esls_init)
Init a Electronic Shelf Label Service instance and add in the DB.
esls_ap_sync_param_t::sync_idx
uint8_t sync_idx
Definition: esls.h:272
esls_active_led_state_set
uint16_t esls_active_led_state_set(bool flag)
Electronic Shelf Label Service active LED state set.
esls_init_t::evt_handler
esls_evt_handler_t evt_handler
Definition: esls.h:403
ESL_RSP_ERR_CODE_INVALID_OPCODE
@ ESL_RSP_ERR_CODE_INVALID_OPCODE
Definition: esls.h:149
esls_ecp_cmd_t
esls_ecp_cmd_t
Definition: esls.h:363
ESLS_EVT_UNASSOCIATE_FROM_AP
@ ESLS_EVT_UNASSOCIATE_FROM_AP
Definition: esls.h:220
ESL_DISP_TYPE_YELLOW_BLACK_WHITE
@ ESL_DISP_TYPE_YELLOW_BLACK_WHITE
Definition: esls.h:186
ESL_VENDOR_DATA_ERR_LEN
@ ESL_VENDOR_DATA_ERR_LEN
Definition: esls.h:211
esls_display_cmd_t
esls_display_cmd_t
Definition: esls.h:330
ESL_RSP_OPCODE_LED_STATE
@ ESL_RSP_OPCODE_LED_STATE
Definition: esls.h:170
ESL_CMD_OPCODE_PING
@ ESL_CMD_OPCODE_PING
Definition: esls.h:131
esls_pending_display_update_state_set
uint16_t esls_pending_display_update_state_set(bool flag)
Electronic Shelf Label Service pengding display state set.
SYNC_STATE_IDLE
@ SYNC_STATE_IDLE
Definition: esls.h:246
ESL_RSP_ERR_CODE_CAPACITY_LIMIT
@ ESL_RSP_ERR_CODE_CAPACITY_LIMIT
Definition: esls.h:154
ESL_CMD_OPCODE_DISP_TIM_IMAGE
@ ESL_CMD_OPCODE_DISP_TIM_IMAGE
Definition: esls.h:139
esls_nvds_cb_t::put_cb
ble_app_nvds_put_cb_t put_cb
Definition: esls.h:390
ESLS_EVT_WRITE_VEND_COMMAND
@ ESLS_EVT_WRITE_VEND_COMMAND
Definition: esls.h:219
ESL_RSP_ERR_CODE_VEND_BEGIN
@ ESL_RSP_ERR_CODE_VEND_BEGIN
Definition: esls.h:160
esls_char_infor_t
Electronic Shelf Label Service characteristic information.
Definition: esls.h:310
SYNC_STATE_START
@ SYNC_STATE_START
Definition: esls.h:247
esls_pending_display_update_state_get
uint16_t esls_pending_display_update_state_get(void)
Get Electronic Shelf Label Service pengding display state state .
ESL_CMD_OPCODE_LED_TIM_CTL
@ ESL_CMD_OPCODE_LED_TIM_CTL
Definition: esls.h:141
ESL_CMD_OPCODE_UNASSOCIATE_AP
@ ESL_CMD_OPCODE_UNASSOCIATE_AP
Definition: esls.h:132
ESL_VENDOR_REQ_BD_ADDR
@ ESL_VENDOR_REQ_BD_ADDR
Definition: esls.h:198
esls_nvds_cb_t::get_cb
ble_app_nvds_get_cb_t get_cb
Definition: esls.h:389
ESL_RSP_OPCODE_BASIC_STATE
@ ESL_RSP_OPCODE_BASIC_STATE
Definition: esls.h:171
ESL_CMD_OPCODE_RD_SENSOR_DATA
@ ESL_CMD_OPCODE_RD_SENSOR_DATA
Definition: esls.h:136
ESLS_EVT_NOTIFICATION_DISABLED
@ ESLS_EVT_NOTIFICATION_DISABLED
Definition: esls.h:218
esls_evt_t::tlv_data
esls_tlv_format_t * tlv_data
Definition: esls.h:377
esl_rsp_opcode_t
esl_rsp_opcode_t
The ESL Control Point characteristic response behavior.
Definition: esls.h:168
esls_service_need_state_set
uint16_t esls_service_need_state_set(bool flag)
Electronic Shelf Label Service service need state set.
ESL_DISP_TYPE_EIGHT_GRAY_SCALE
@ ESL_DISP_TYPE_EIGHT_GRAY_SCALE
Definition: esls.h:183
ESL_RSP_ERR_CODE_INVALID_PARAM
@ ESL_RSP_ERR_CODE_INVALID_PARAM
Definition: esls.h:153
esls_ap_sync_param_t::config_flag
bool config_flag
Definition: esls.h:271
esls_evt_type_t
esls_evt_type_t
Electronic Shelf Label Service event types.
Definition: esls.h:216
esls_service_nvds_load_flag_get
bool esls_service_nvds_load_flag_get(void)
Get Electronic Shelf Label Service nvds load flag.
ESL_CMD_OPCODE_SRV_RST
@ ESL_CMD_OPCODE_SRV_RST
Definition: esls.h:133
ESL_CTL_PT_TLV_MAX_LEN
#define ESL_CTL_PT_TLV_MAX_LEN
Definition: esls.h:78
ESL_RSP_ERR_CODE_UNSPEC
@ ESL_RSP_ERR_CODE_UNSPEC
Definition: esls.h:148
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:290
ESLS_EVT_LED_CTL
@ ESLS_EVT_LED_CTL
Definition: esls.h:228
SYNC_STATE_MAX
@ SYNC_STATE_MAX
Definition: esls.h:249
UNSYNCHRONIZE_STATE
@ UNSYNCHRONIZE_STATE
Definition: esls.h:240
ESL_VENDOR_RSP_DEVICE_NAME
@ ESL_VENDOR_RSP_DEVICE_NAME
Definition: esls.h:197
esls_sensor_arr_t::sensor_arr_p
uint8_t * sensor_arr_p
Definition: esls.h:298
esls_led_arr_t::led_arr_len
uint16_t led_arr_len
Definition: esls.h:304
ESL_STATE_MAX
@ ESL_STATE_MAX
Definition: esls.h:241
app_dev_reset_cbk_t
bool(* app_dev_reset_cbk_t)(uint8_t conn_idx, bool factory_rst)
Definition: esls.h:396
ESL_DISP_TYPE_FOUR_GRAY_SCALE
@ ESL_DISP_TYPE_FOUR_GRAY_SCALE
Definition: esls.h:182
ESL_VENDOR_RSP_BD_ADDR
@ ESL_VENDOR_RSP_BD_ADDR
Definition: esls.h:199
esls_set_state_machine
sdk_err_t esls_set_state_machine(ESL_STATE_T esl_state)
Set Electronic Shelf Label state machine.
ESL_CMD_OPCODE_DISP_IMAGE
@ ESL_CMD_OPCODE_DISP_IMAGE
Definition: esls.h:138
esls_sensor_arr_t
Electronic Shelf Label Service sensor information data.
Definition: esls.h:296
ESL_RSP_ERR_CODE_INSUFF_RESOURCE
@ ESL_RSP_ERR_CODE_INSUFF_RESOURCE
Definition: esls.h:156
esl_vendor_data_err_t
esl_vendor_data_err_t
Values for contrl point vendor command data error code.
Definition: esls.h:208
esls_init_t::char_mask
uint32_t char_mask
Definition: esls.h:401
ESL_DISP_TYPE_SEVEN_COLOR
@ ESL_DISP_TYPE_SEVEN_COLOR
Definition: esls.h:188
ESLS_EVT_NOTIFICATION_ENABLED
@ ESLS_EVT_NOTIFICATION_ENABLED
Definition: esls.h:217
esls_sync_to_ap_state_get
uint16_t esls_sync_to_ap_state_get(void)
Get Electronic Shelf Label Service sync state .
esls_key_material_t
esls_key_material_t
Definition: esls.h:322
esls_display_arr_t::display_arr_len
uint16_t display_arr_len
Definition: esls.h:290
ble_esls_evt_on_ble_capture
void ble_esls_evt_on_ble_capture(const ble_evt_t *p_evt)
Capture esl service events on BLE.
esls_evt_t::evt_data_ptr
void * evt_data_ptr
Definition: esls.h:378
ESLS_EVT_TX_DATA_SENT
@ ESLS_EVT_TX_DATA_SENT
Definition: esls.h:230
esls_led_state_send
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 .
esls_tlv_response_send
sdk_err_t esls_tlv_response_send(uint8_t conn_idx, uint8_t *rsp_data_p, uint16_t len)
Send response message to AP.
esls_nvds_cb_t::del_cb
ble_app_nvds_del_cb_t del_cb
Definition: esls.h:391
ble_app_nvds_del_cb_t
uint8_t(* ble_app_nvds_del_cb_t)(uint8_t tag)
Definition: esls.h:384
ESL_RSP_ERR_CODE_VEND_NO_ERR
@ ESL_RSP_ERR_CODE_VEND_NO_ERR
Definition: esls.h:161
esls_display_state_send
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.
__attribute__
Definition: cgms.h:255
esls_tlv_format_t
esls_tlv_format_t
Definition: esls.h:370
ESL_RSP_OPCODE_ERR
@ ESL_RSP_OPCODE_ERR
Definition: esls.h:169
ESLS_EVT_DISPLAY_TIMED_IMAGE
@ ESLS_EVT_DISPLAY_TIMED_IMAGE
Definition: esls.h:227
ESLS_EVT_DISPLAY_IMAGE
@ ESLS_EVT_DISPLAY_IMAGE
Definition: esls.h:226
ble_app_nvds_put_cb_t
uint8_t(* ble_app_nvds_put_cb_t)(uint8_t tag, uint8_t len, uint8_t *p_buf)
Definition: esls.h:383
ble_evt_t
BLE Event Information.
Definition: ble_event.h:207
ble_app_nvds_get_cb_t
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.
Definition: esls.h:382
esls_err_state_send
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.
esls_sync_past_param_set
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 wit...
esls_nvds_cb_t
Electronic Shelf Label Service NVDS callback func.
Definition: esls.h:388
CONFIGURING_STATE
@ CONFIGURING_STATE
Definition: esls.h:237
ESL_DISP_TYPE_SIXTEEN_COLOR
@ ESL_DISP_TYPE_SIXTEEN_COLOR
Definition: esls.h:189
ESL_VENDOR_OPCODE_MAX
@ ESL_VENDOR_OPCODE_MAX
Definition: esls.h:203
ESLS_EVT_FACTORY_RESET
@ ESLS_EVT_FACTORY_RESET
Definition: esls.h:222
esls_base_state_send
sdk_err_t esls_base_state_send(uint8_t conn_idx)
Sent a Electronic Shelf Label Service base state.
ESL_DISP_TYPE_T
ESL_DISP_TYPE_T
The value of the Display_Type field is from an enumeration , which identifies the colors that are sup...
Definition: esls.h:179
ESL_DISP_TYPE_BLACK_WHITE
@ ESL_DISP_TYPE_BLACK_WHITE
Definition: esls.h:180
ESLS_NVDS_PARAM_ID_T
ESLS_NVDS_PARAM_ID_T
Electronic Shelf Label Service List of NVDS parameters identifiers.
Definition: esls.h:254
ESL_VENDOR_DATA_NO_ERR
@ ESL_VENDOR_DATA_NO_ERR
Definition: esls.h:209
esl_rsp_err_code_t
esl_rsp_err_code_t
The Error response has a single parameter that contains an error code .
Definition: esls.h:146
ESL_VENDOR_REQ_DEVICE_NAME
@ ESL_VENDOR_REQ_DEVICE_NAME
Definition: esls.h:196
ESL_CMD_OPCODE_FACTORY_RST
@ ESL_CMD_OPCODE_FACTORY_RST
Definition: esls.h:134
ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE
@ ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE
Definition: esls.h:152
ESL_RSP_ERR_CODE_MAX
@ ESL_RSP_ERR_CODE_MAX
Definition: esls.h:163
esls_user_payload_prepare
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.
esls_ap_sync_param_t::sync_to
uint16_t sync_to
Definition: esls.h:273
esls_sensor_value_send
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.
esls_ap_sync_param_t::target_addr
ble_gap_bdaddr_t target_addr
Definition: esls.h:274
esls_display_arr_t
Electronic Shelf Label Service display information data.
Definition: esls.h:289
esls_led_arr_t
Electronic Shelf Label Service led information data.
Definition: esls.h:303
SYNC_STATE_ACTIVE
@ SYNC_STATE_ACTIVE
Definition: esls.h:248
ESLS_EVT_SERVICE_RESET
@ ESLS_EVT_SERVICE_RESET
Definition: esls.h:221
PARAM_ID_ESL_CONFIG_INFOR
@ PARAM_ID_ESL_CONFIG_INFOR
Definition: esls.h:257