1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-20 20:22:27 +01:00

Nextion - Review set_protocol_reparse_mode() (#6567)

This commit is contained in:
Edward Firmo
2024-04-18 01:07:05 +02:00
committed by GitHub
parent 6075067e84
commit 8c323e2e4c
2 changed files with 32 additions and 19 deletions

View File

@@ -878,12 +878,24 @@ class Nextion : public NextionBase, public PollingComponent, public uart::UARTDe
*/
void sleep(bool sleep);
/**
* Sets Nextion Protocol Reparse mode between active or passive
* @param True or false.
* active_mode=true to enter active protocol reparse mode
* active_mode=false to enter passive protocol reparse mode.
* @brief Sets the Nextion display's protocol reparse mode.
*
* This function toggles the Nextion display's protocol reparse mode between active and passive.
* In active mode, the display actively parses incoming data.
* In passive mode, it does not parse data unless specifically instructed to do so.
* This is useful for managing how the Nextion display interprets incoming commands,
* especially during initialization or in scenarios where precise control over command processing is needed.
*
* @param active_mode A boolean value indicating the desired reparse mode.
* - true to set the display to active protocol reparse mode, where it actively parses incoming commands.
* - false to set the display to passive protocol reparse mode, where command parsing is done only on explicit
* instruction.
*
* @return bool Returns true if all commands were sent successfully to the Nextion display, indicating that the mode
* was set as expected. Returns false if any of the commands failed to send, indicating that the desired reparse mode
* may not be correctly set.
*/
void set_protocol_reparse_mode(bool active_mode);
bool set_protocol_reparse_mode(bool active_mode);
// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)