Go to the documentation of this file.
62 #include "custom_config.h"
71 #define ESL_CTL_PT_TLV_MAX_LEN 17
73 #define ESL_TLV_CMD_TAG(OPCODE) (OPCODE & 0xF)
74 #define ESL_TLV_CMD_LEN(OPCODE) ((OPCODE>>4) & 0xF)
76 #define ESL_TLV_CMD_CHECK(OPCODE, length) ((ESL_TLV_CMD_LEN(OPCODE)==(length -2))?true:false)
79 #define ESL_BASIC_STATE_SERV_NEED_POS 0
80 #define ESL_BASIC_STATE_SYNC_POS 1
81 #define ESL_BASIC_STATE_ACTIVE_LED_POS 2
82 #define ESL_BASIC_STATE_LED_UPDATE_POS 3
83 #define ESL_BASIC_STATE_DISP_UPDATE_POS 4
85 #define ESL_ADDR_ESL_ID_BROAD_ADDR 0xFF
86 #define ESL_ADDR_INVALID_GRP_ID 0xFF
544 uint8_t color_RGB_bright,
545 uint8_t flashing_pattern[7],
547 uint16_t repeat_duration);
568 uint8_t color_RGB_bright,
569 uint8_t flashing_pattern[7],
571 uint16_t repeat_duration,
731 uint8_t color_RGB_bright,
732 uint8_t flashing_pattern[7],
734 uint16_t repeat_duration);
756 uint8_t color_RGB_bright,
757 uint8_t flashing_pattern[7],
759 uint16_t repeat_duration,
@ ESL_VENDOR_IMAGE_END_NTF
The ESL profile vendor command to notify image transport end.
@ ESL_RSP_ERR_CODE_IMPLAUSIBLE_ABS_TIM
The Absolute Time parameter value in the command is implausible.
@ ESLS_C_EVT_ESL_DISP_READ_INFO
ESLS Client read ESL Display Information .
@ ESL_CMD_OPCODE_UPDATE_COMP
The ESL Control Point characteristic command procedure is Update Complete.
@ ESL_RSP_ERR_CODE_INVALID_IMAGE_IDX
The Image_Index value was out of range.
@ ESL_RSP_ERR_CODE_QUEUE_FULL
The ESL is temporarily unable to add a further timed command to the queue of pending commands¡ªthe qu...
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.
@ ESL_VENDOR_IMAGE_START_RSP
The ESL profile vendor command to response start image transport.
esl_cmd_opcode_t
Values for The ESL Control Point characteristic command procedure.
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.
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.
@ ESL_CMD_OPCODE_LED_CTL
The ESL Control Point characteristic command procedure is LED Control.
@ ESLS_C_EVT_CTRL_POINT_SET_RSP
ESLS Client has sent command from control point.
uint16_t esls_srvc_start_handle
ESL Service start handle.
@ ESL_CMD_OPCODE_VEND_SPEC_TAG
uint16_t esls_addr_handle
ESL address characteristic Value handle which has been got from peer.
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.
@ ESLS_C_EVT_ESL_RSP_KEY_SET_SUCCESS
ESLS Client has set ESL Response Key .
sdk_err_t esls_c_disp_info_read(uint8_t conn_idx)
Set Electronic Shelf Label service display information characteristic.
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.
@ led_mono
A monochrome LED is a single-color LED.
uint8_t esl_id
The esl id.
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.
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.
@ ESL_RSP_ERR_CODE_RETRY
The ESL is temporarily unable to give a full response (e.g., because the required sensor hardware was...
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.
uint16_t esls_current_abs_time_handle
ESL current absolute time characteristic Value handle which has been got from peer.
@ ESL_CMD_OPCODE_REFRESH_DISP
The ESL Control Point characteristic command procedure is Refresh Display.
@ ESLS_C_EVT_ESL_ADDR_SET_SUCCESS
ESLS Client has set ESL Server Addr.
@ ESL_RSP_OPCODE_VEND_TAG
Response data as specified by the vendor of the ESL.
led_type_t
Values for LED type enumeration.
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.
void(* esls_c_evt_handler_t)(esls_c_evt_t *p_evt)
Electronic Shelf Label Client event handler type.
@ ESL_VENDOR_IMAGE_START_REQ
The ESL profile vendor command to request start image transport.
@ ESL_VENDOR_DATA_ERR_CKSUM
The ESL profile vendor command data checksum fail.
@ ESLS_C_EVT_ESL_IMAGE_READ_INFO
ESLS Client read ESL Image Information.
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.
@ ESL_RSP_OPCODE_DISP_STATE
Acknowledgment of a request to display an image.
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.
@ ESLS_C_ESL_KEY_FLAG_MAX
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.
@ ESL_RSP_ERR_CODE_RFU
Reserved for Future Use.
esl_rsp_opcode_t
The ESL Control Point characteristic response behavior.
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.
const uint8_t * p_value
data of event type.
@ ESL_RSP_OPCODE_SENSOR_TAG
Sensor report.
uint16_t esls_srvc_end_handle
ESL Service end handle.
uint16_t esls_ctrl_point_handle
ESL Control Point characteristic Value handle which has been got from peer.
@ ESLS_C_EVT_ESL_ABS_TIM_SET_SUCCESS
ESLS Client has set ESL Current Absolute Time.
@ ESL_RSP_ERR_CODE_INSUFF_BATTERY
The request could not be processed because of a lack of battery charge.
@ ESL_RSP_ERR_CODE_INVALID_STATE
The request was not valid for the present ESL state.
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.
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.
uint16_t esls_led_handle
ESL LED information characteristic Value handle which has been got from peer.
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.
@ ESL_RSP_ERR_CODE_INVALID_OPCODE
The opcode was not recognized.
@ ESL_VENDOR_DATA_ERR_LEN
The ESL profile vendor command data length error.
esl_vendor_opcode_t
Values for contrl point vendor command and response.
@ ESL_RSP_OPCODE_LED_STATE
Acknowledgment of a request to control an LED.
@ ESL_CMD_OPCODE_PING
The ESL Control Point characteristic command procedure is ping.
uint16_t esls_display_handle
ESL display information characteristic Value handle which has been got from peer.
@ ESL_RSP_ERR_CODE_CAPACITY_LIMIT
The required response could not be sent as it would exceed the payload size limit.
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.
@ ESL_CMD_OPCODE_DISP_TIM_IMAGE
The ESL Control Point characteristic command procedure is Display Timed Image.
@ ESL_RSP_ERR_CODE_VEND_BEGIN
Error codes defined by a vendor.
sdk_err_t esls_c_image_info_read(uint8_t conn_idx)
Set Electronic Shelf Label service image information characteristic.
@ ESL_CMD_OPCODE_LED_TIM_CTL
The ESL Control Point characteristic command procedure is LED Timed Control.
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.
@ ESL_CMD_OPCODE_UNASSOCIATE_AP
The ESL Control Point characteristic command procedure is Unassociate from AP.
uint16_t esls_ctrl_point_cccd_handle
ESL CCCD handle has been got from peer.
@ ESLS_C_EVT_CTRL_POINT_CCCD_SET
ESLS Client has set Control Point completely.
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.
@ ESL_VENDOR_REQ_BD_ADDR
The ESL profile vendor command to request peer device bd_addr.
@ ESLS_C_EVT_DISCOVERY_COMPLETE
ESLS Client has found ESLS service and its characteristics.
sdk_err_t esls_c_sensor_info_read(uint8_t conn_idx)
Set Electronic Shelf Label service sensor information characteristic.
@ ESL_RSP_OPCODE_BASIC_STATE
General acknowledgment containing ESL status data.
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.
@ ESLS_C_AP_SYNC_KEY_FLAG
The AP Sync Key Material.
@ ESL_CMD_OPCODE_RD_SENSOR_DATA
The ESL Control Point characteristic command procedure is Read Sensor Data.
@ ESL_RSP_ERR_CODE_INVALID_PARAM
The parameter value(s) or length did not match the opcode.
Profile/Service Common Types.
@ ESL_CMD_OPCODE_SRV_RST
The ESL Control Point characteristic command procedure is Service Reset.
@ ESLS_C_EVT_WRITE_OP_ERR
Error occured when ESLS Client writen to peer.
@ ESL_RSP_ERR_CODE_UNSPEC
Any error condition that is not covered by a specific error code below.
uint16_t sdk_err_t
SDK API result type.
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.
@ ESLS_C_ESL_RSP_KEY_FLAG
The ESL Response Key Material.
@ ESL_VENDOR_RSP_DEVICE_NAME
The ESL profile has received peer device name.
@ ESL_VENDOR_RSP_BD_ADDR
The ESL profile has received peer device bd_addr.
@ ESL_CMD_OPCODE_DISP_IMAGE
The ESL Control Point characteristic command procedure is Display Image.
uint16_t esls_image_handle
ESL image information characteristic Value handle which has been got from peer.
@ ESL_RSP_ERR_CODE_INSUFF_RESOURCE
The request could not be processed because of a lack of resources.
@ ESLS_C_EVT_AP_SYNC_KEY_SET_SUCCESS
ESLS Client has set AP Sync Key .
Handles on the connected peer device needed to interact with it.
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.
@ led_sRGB
An sRGB LED is a multi-color LED that can change color.
sdk_err_t esls_c_disc_srvc_start(uint8_t conn_idx)
Discovery Electronic Shelf Label service on peer.
esls_c_evt_type_t
Electronic Shelf Label User event to APP.
uint16_t esls_rsp_key_handle
ESL esl response key characteristic Value handle which has been got from peer.
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.
@ ESL_RSP_ERR_CODE_VEND_NO_ERR
Error codes defined by a vendor to represent no error.
@ ESL_RSP_OPCODE_ERR
The command could not be processed successfully.
void ble_esl_pawr_evt_on_ble_capture(const ble_evt_t *p_evt)
Capture PAwR events on BLE.
sdk_err_t esls_client_init(esls_c_evt_handler_t evt_handler)
Register ESLS Client event handler.
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.
uint16_t esls_sensor_handle
ESL Sensor information characteristic Value handle which has been got from peer.
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.
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.
Electronic Shelf Label LED infor type.
uint8_t grp_id
The group id .
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.
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.
uint16_t esls_ap_sync_key_handle
ESL AP Sync Key characteristic Value handle which has been got from peer.
uint8_t conn_idx
The connection index.
@ ESL_VENDOR_DATA_NO_ERR
The ESL profile vendor command data no error.
@ ESLS_C_EVT_ESL_LED_READ_INFO
ESLS Client read ESL LED Information.
@ ESLS_C_EVT_INVALID
ESLS Client invalid event.
esls_c_key_type_t
Electronic Shelf Label Key Material type.
uint16_t length
length of event type data.
@ ESL_VENDOR_REQ_DEVICE_NAME
The ESL profile vendor command to request peer device name.
@ ESL_CMD_OPCODE_FACTORY_RST
The ESL Control Point characteristic command procedure is Factory Reset.
@ ESL_RSP_ERR_CODE_IMAGE_NOT_AVAILABLE
The requested image contained no image data.
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.
@ ESL_RSP_ERR_CODE_MAX
Error codes defined MAX.
sdk_err_t esls_c_led_info_read(uint8_t conn_idx)
Set Electronic Shelf Label service led information characteristic.
@ ESLS_C_EVT_CTRL_POINT_RSP_RECEIVE
ESLS Client has reviced command response from control point by connection.
@ ESLS_C_EVT_ESL_SYNC_RSP_RECEIVE
ESLS Client has reviced command response from control point by synchronization.
esl_rsp_err_code_t
The Error response has a single parameter that contains an error code .
esls_c_evt_type_t evt_type
ESL Client event type.
@ ESLS_C_EVT_ESL_SENSOR_READ_INFO
ESLS Client read ESL Sensor Information.
Electronic Shelf Label Client event.
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.
esl_vendor_data_err_t
Values for contrl point vendor command data error code.
@ ESLS_C_EVT_DISCOVERY_FAIL
ESLS Client found ESLS service failed because of invalid operation or no found at the peer.