mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-12 16:12:07 +00:00
Remove sending network ping to displayed node on interval
This commit is contained in:
parent
8a81f190b8
commit
8f736c8ecc
@ -194,17 +194,6 @@ static void onEnter()
|
|||||||
LOG_INFO("Enter state: ON\n");
|
LOG_INFO("Enter state: ON\n");
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
|
|
||||||
static uint32_t lastPingMs;
|
|
||||||
|
|
||||||
uint32_t now = millis();
|
|
||||||
|
|
||||||
if ((now - lastPingMs) >
|
|
||||||
30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
|
|
||||||
if (displayedNodeNum)
|
|
||||||
service.sendNetworkPing(displayedNodeNum, true); // Refresh the currently displayed node
|
|
||||||
lastPingMs = now;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onIdle()
|
static void onIdle()
|
||||||
|
@ -348,8 +348,6 @@ static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
/// Draw the last text message we received
|
/// Draw the last text message we received
|
||||||
static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
display->setFont(FONT_MEDIUM);
|
display->setFont(FONT_MEDIUM);
|
||||||
|
|
||||||
@ -370,8 +368,6 @@ static bool shouldDrawMessage(const meshtastic_MeshPacket *packet)
|
|||||||
/// Draw the last text message we received
|
/// Draw the last text message we received
|
||||||
static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
// the max length of this buffer is much longer than we can possibly print
|
// the max length of this buffer is much longer than we can possibly print
|
||||||
static char tempBuf[237];
|
static char tempBuf[237];
|
||||||
|
|
||||||
@ -773,7 +769,6 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
|
|||||||
nodeIndex = (nodeIndex + 1) % nodeDB.getNumNodes();
|
nodeIndex = (nodeIndex + 1) % nodeDB.getNumNodes();
|
||||||
n = nodeDB.getNodeByIndex(nodeIndex);
|
n = nodeDB.getNodeByIndex(nodeIndex);
|
||||||
}
|
}
|
||||||
displayedNodeNum = n->num;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_NodeInfo *node = nodeDB.getNodeByIndex(nodeIndex);
|
meshtastic_NodeInfo *node = nodeDB.getNodeByIndex(nodeIndex);
|
||||||
@ -1393,8 +1388,6 @@ void Screen::setFastFramerate()
|
|||||||
|
|
||||||
void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
|
|
||||||
// The coordinates define the left starting point of the text
|
// The coordinates define the left starting point of the text
|
||||||
@ -1502,8 +1495,6 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
const char *wifiName = config.network.wifi_ssid;
|
const char *wifiName = config.network.wifi_ssid;
|
||||||
|
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
|
|
||||||
// The coordinates define the left starting point of the text
|
// The coordinates define the left starting point of the text
|
||||||
@ -1634,8 +1625,6 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
|
|
||||||
void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
|
|
||||||
// The coordinates define the left starting point of the text
|
// The coordinates define the left starting point of the text
|
||||||
|
@ -58,12 +58,6 @@ meshtastic_User &owner = devicestate.owner;
|
|||||||
|
|
||||||
static uint8_t ourMacAddr[6];
|
static uint8_t ourMacAddr[6];
|
||||||
|
|
||||||
/**
|
|
||||||
* The node number the user is currently looking at
|
|
||||||
* 0 if none
|
|
||||||
*/
|
|
||||||
NodeNum displayedNodeNum;
|
|
||||||
|
|
||||||
NodeDB::NodeDB() : nodes(devicestate.node_db), numNodes(&devicestate.node_db_count) {}
|
NodeDB::NodeDB() : nodes(devicestate.node_db), numNodes(&devicestate.node_db_count) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,12 +153,6 @@ class NodeDB
|
|||||||
void installDefaultDeviceState(), installDefaultChannels(), installDefaultConfig(), installDefaultModuleConfig();
|
void installDefaultDeviceState(), installDefaultChannels(), installDefaultConfig(), installDefaultModuleConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* The node number the user is currently looking at
|
|
||||||
* 0 if none
|
|
||||||
*/
|
|
||||||
extern NodeNum displayedNodeNum;
|
|
||||||
|
|
||||||
extern NodeDB nodeDB;
|
extern NodeDB nodeDB;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -446,8 +446,6 @@ int CannedMessageModule::getPrevIndex()
|
|||||||
|
|
||||||
void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
|
|
||||||
if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) {
|
if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) {
|
||||||
|
@ -153,8 +153,6 @@ AudioModule::AudioModule() : SinglePortModule("AudioModule", meshtastic_PortNum_
|
|||||||
|
|
||||||
void AudioModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void AudioModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
|
||||||
|
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
|
Loading…
Reference in New Issue
Block a user