Introduce isInBullshitState() to restart the modem stack quicker when it breaks

This commit is contained in:
feedc0de committed 2024-03-26 20:02:20 +01:00
1 parent 932c1869a4
commit 4d8d61e106
4 files changed
+15

No files matched your search

@@ -96,6 +96,8 @@ public:
*/
bool recover();
bool isInBullshitState() { if (m_isInBullshitState) { m_isInBullshitState = false; return true; } return false; }
private:
enum class protocol_mismatch_reason {
@@ -128,6 +130,9 @@ private:
bool on_footer(CMuxFrame &frame);
void recover_protocol(protocol_mismatch_reason reason);
//! When espressif again fucks up the recovering of the MUX
bool m_isInBullshitState{};
std::function<bool(uint8_t *data, size_t len)> read_cb[MAX_TERMINALS_NUM]; /*!< Function pointers to read callbacks */
std::shared_ptr<Terminal> term; /*!< The original terminal */
cmux_state state; /*!< CMux protocol state */
@@ -122,6 +122,8 @@ public:
*/
bool recover();
bool isInBullshitState();
protected:
/**
* @brief Allows for locking the DTE