Display sending state.

This commit is contained in:
Balazs Kelemen
2022-01-04 22:02:16 +01:00
parent 4a29aef19e
commit b3ddf16d64
3 changed files with 43 additions and 26 deletions

View File

@@ -15,26 +15,27 @@ enum cannedMessagePluginActionType
ACTION_DOWN
};
enum cannedMessagePluginSendigState
{
SENDING_STATE_NONE,
SENDING_STATE_ACTIVE
};
#define CANNED_MESSAGE_PLUGIN_MESSAGE_MAX_LEN 50
static char cannedMessagePluginMessages[][CANNED_MESSAGE_PLUGIN_MESSAGE_MAX_LEN] =
{
"I need a helping hand",
"I need help with saw",
"Need helping hand",
"Help me with saw",
"I need an alpinist",
"I need ambulance",
"I'm fine",
"I'm already waiting",
"I will be late",
"I couldn't join",
"We have got company"
"We have company"
};
typedef struct _CannedMessagePluginStatus
{
int dummy;
} CannedMessagePluginStatus;
class CannedMessagePlugin :
public SinglePortPlugin,
public Observable<const meshtastic::Status *>,
@@ -59,7 +60,11 @@ class CannedMessagePlugin :
}
bool shouldDraw()
{
return currentMessageIndex != -1;
return (currentMessageIndex != -1) || (this->sendingState != SENDING_STATE_NONE);
}
cannedMessagePluginSendigState getSendingState()
{
return this->sendingState;
}
protected:
@@ -106,6 +111,7 @@ class CannedMessagePlugin :
volatile int rotaryLevelA = LOW;
volatile int rotaryLevelB = LOW;
int currentMessageIndex = -1;
cannedMessagePluginSendigState sendingState = SENDING_STATE_NONE;
};
extern CannedMessagePlugin *cannedMessagePlugin;