mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-30 14:40:40 +00:00
more warning fixes
This commit is contained in:
@@ -156,13 +156,12 @@ ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp)
|
||||
|
||||
if (radioConfig.preferences.ext_notification_plugin_enabled) {
|
||||
|
||||
auto &p = mp.decoded;
|
||||
|
||||
if (getFrom(&mp) != nodeDB.getNodeNum()) {
|
||||
|
||||
// TODO: This may be a problem if messages are sent in unicide, but I'm not sure if it will.
|
||||
// Need to know if and how this could be a problem.
|
||||
if (radioConfig.preferences.ext_notification_plugin_alert_bell) {
|
||||
auto &p = mp.decoded;
|
||||
DEBUG_MSG("externalNotificationPlugin - Notification Bell\n");
|
||||
for (int i = 0; i < p.payload.size; i++) {
|
||||
if (p.payload.bytes[i] == ASCII_BELL) {
|
||||
|
||||
@@ -145,9 +145,9 @@ int32_t PositionPlugin::runOnce()
|
||||
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);
|
||||
sendOurPosition(NODENUM_BROADCAST, requestReplies);
|
||||
} else if (radioConfig.preferences.position_broadcast_smart == true) {
|
||||
NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position
|
||||
NodeInfo *node2 = service.refreshMyNodeInfo(); // should guarantee there is now a position
|
||||
|
||||
if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0)) {
|
||||
if (node2->has_position && (node2->position.latitude_i != 0 || node2->position.longitude_i != 0)) {
|
||||
// The minimum distance to travel before we are able to send a new position packet.
|
||||
const uint32_t distanceTravelMinimum = 30;
|
||||
|
||||
@@ -173,7 +173,7 @@ int32_t PositionPlugin::runOnce()
|
||||
bool requestReplies = currentGeneration != radioGeneration;
|
||||
currentGeneration = radioGeneration;
|
||||
|
||||
DEBUG_MSG("Sending smart pos@%x:6 to mesh (wantReplies=%d, dt=%d, tt=%d)\n", node->position.pos_timestamp, requestReplies, distanceTravel, timeTravel);
|
||||
DEBUG_MSG("Sending smart pos@%x:6 to mesh (wantReplies=%d, dt=%d, tt=%d)\n", node2->position.pos_timestamp, requestReplies, distanceTravel, timeTravel);
|
||||
sendOurPosition(NODENUM_BROADCAST, requestReplies);
|
||||
|
||||
/* Update lastGpsSend to now. This means if the device is stationary, then
|
||||
@@ -185,4 +185,4 @@ int32_t PositionPlugin::runOnce()
|
||||
}
|
||||
|
||||
return 5000; // to save power only wake for our callback occasionally
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, Hardwar
|
||||
HardwareMessage r = HardwareMessage_init_default;
|
||||
r.typ = HardwareMessage_Type_READ_GPIOS_REPLY;
|
||||
r.gpio_value = res;
|
||||
MeshPacket *p = allocDataProtobuf(r);
|
||||
setReplyTo(p, req);
|
||||
myReply = p;
|
||||
MeshPacket *p2 = allocDataProtobuf(r);
|
||||
setReplyTo(p2, req);
|
||||
myReply = p2;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -132,4 +132,4 @@ int32_t RemoteHardwarePlugin::runOnce()
|
||||
}
|
||||
|
||||
return 200; // Poll our GPIOs every 200ms (FIXME, make adjustable via protobuf arg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ uint32_t StoreForwardPlugin::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
||||
|
||||
void StoreForwardPlugin::historyAdd(const MeshPacket &mp)
|
||||
{
|
||||
auto &p = mp.decoded;
|
||||
const auto &p = mp.decoded;
|
||||
|
||||
this->packetHistory[this->packetHistoryCurrent].time = millis();
|
||||
this->packetHistory[this->packetHistoryCurrent].to = mp.to;
|
||||
@@ -247,14 +247,14 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
|
||||
|
||||
DEBUG_MSG("--- S&F Received something\n");
|
||||
|
||||
auto &p = mp.decoded;
|
||||
|
||||
// The router node should not be sending messages as a client.
|
||||
if (getFrom(&mp) != nodeDB.getNodeNum()) {
|
||||
|
||||
if (mp.decoded.portnum == PortNum_TEXT_MESSAGE_APP) {
|
||||
DEBUG_MSG("Packet came from - PortNum_TEXT_MESSAGE_APP\n");
|
||||
|
||||
auto &p = mp.decoded;
|
||||
|
||||
if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 0x00)) {
|
||||
DEBUG_MSG("--- --- --- Request to send\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user