Functions
Functions
BLE Services » Electronic Shelf Label Service (ESLS)

## Functions
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...

## Detailed Description

## Function Documentation

## ◆ 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.

Parameters

  [in] | p_evt | pointer on BLE event.

## ◆ esls_active_led_state_get()

uint16_t esls_active_led_state_get | ( | void |  | ) |

Get Electronic Shelf Label Service active LED state state .

Returns
  Result of service state.

## ◆ esls_active_led_state_set()

uint16_t esls_active_led_state_set | ( | bool | flag | ) |

Electronic Shelf Label Service active LED state set.

Parameters

  [in] | flag | True or False.

Returns
  Result of service state.

## ◆ esls_base_state_send()

sdk_err_t esls_base_state_send | ( | uint8_t | conn_idx | ) |

Sent a Electronic Shelf Label Service base state.

Parameters

  [in] | conn_idx | Connnection index.

Returns
  Result of data sent.

## ◆ 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.

Parameters

  [in] | conn_idx | Connnection index.
  [in] | display_idx | display index.
  [in] | image_idx | image index.

Returns
  Result of data sent.

## ◆ 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.

Parameters

  [in] | conn_idx | Connnection index..
  [in] | err_code | The command could not be processed successfully, will response this err code.

Returns
  Result of data sent.

## ◆ esls_get_state_machine()

ESL_STATE_T esls_get_state_machine | ( | void |  | ) |

Get Electronic Shelf Label state machine.

Returns
  Current Esl state.

## ◆ 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 .

Parameters

  [in] | conn_idx | Connnection index..
  [in] | led_idx | LED index.

Returns
  Result of data sent.

## ◆ esls_pending_display_update_state_get()

uint16_t esls_pending_display_update_state_get | ( | void |  | ) |

Get Electronic Shelf Label Service pengding display state state .

Returns
  Result of service state.

## ◆ esls_pending_display_update_state_set()

uint16_t esls_pending_display_update_state_set | ( | bool | flag | ) |

Electronic Shelf Label Service pengding display state set.

Parameters

  [in] | flag | True or False.

Returns
  Result of service 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 .

Returns
  Result of service state.

## ◆ esls_pending_led_update_state_set()

uint16_t esls_pending_led_update_state_set | ( | bool | flag | ) |

Electronic Shelf Label Service pengding LED state set.

Parameters

  [in] | flag | True or False.

Returns
  Result of service state.

## ◆ 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.

Parameters

  [in] | conn_idx | Connnection index.
  [in] | sensor_idx | Sensor index.
  [in] | sensor_data_p | Pointer of Sensor data.
  [in] | len | Sensor data length.

Returns
  Result of data sent.

## ◆ 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.

Parameters

  [in] | p_esls_init | Pointer to a Electronic Shelf Label Init variable.

Returns
  Result of service initialization.

## ◆ esls_service_need_state_get()

uint16_t esls_service_need_state_get | ( | void |  | ) |

Get Electronic Shelf Label Service service need state .

Returns
  Result of service state.

## ◆ esls_service_need_state_set()

uint16_t esls_service_need_state_set | ( | bool | flag | ) |

Electronic Shelf Label Service service need state set.

Parameters

  [in] | flag | True or False.

Returns
  Result of service state.

## ◆ esls_service_nvds_load_flag_get()

bool esls_service_nvds_load_flag_get | ( | void |  | ) |

Get Electronic Shelf Label Service nvds load flag.

Returns
  Result of nvds load flag.

## ◆ esls_service_reset()

void esls_service_reset | ( | void |  | ) |

Reset Electronic Shelf Label Service state and database.

## ◆ 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 .

Returns
  The esls service start handle.

## ◆ esls_set_state_machine()

sdk_err_t esls_set_state_machine | ( | ESL_STATE_T | esl_state | ) |

Set Electronic Shelf Label state machine.

Parameters

  [in] | esl_state | Esl state to setting.

Returns
  Result of setting.

## ◆ 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 with AP.

Parameters

  [in] | sync_past_ptr | Pointer to the parameters.

Returns
  Result of setting.

## ◆ esls_sync_to_ap_state_get()

uint16_t esls_sync_to_ap_state_get | ( | void |  | ) |

Get Electronic Shelf Label Service sync state .

Returns
  Result of service state.

## ◆ esls_sync_to_ap_state_set()

uint16_t esls_sync_to_ap_state_set | ( | bool | flag | ) |

Electronic Shelf Label Service sync state set.

Parameters

  [in] | flag | True or False.

Returns
  Result of service state.

## ◆ 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.

Parameters

  [in] | conn_idx | Connection index.
  [in] | rsp_data_p | Pointer to the data of response.
  [in] | len | the data length of response.

Returns
  Result of message response.

## ◆ 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.

Parameters

  [in] | esl_sent_buffer | data buffer.
  [in] | esl_sent_buffer_offset | buffer head offset.
  [in] | user_opcode | Opcode of payload data.
  [in] | esl_payload | Pointer on payload data.
  [in] | esl_len | Pointer on payload length.

Returns
  Result of data sent.

## ◆ 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.

Parameters

  [in] | conn_idx | Connnection index.
  [in] | user_opcode | User define opcode, esl_vendor_opcode_t.
  [in] | esl_payload | Pointer on payload data.
  [in] | esl_len | Pointer on payload data.

Returns
  Result of data sent.