mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 02:51:17 +00:00
change! time of last packet rx in node->last_heard instead of node->position.time
This commit is contained in:
parent
dd0f1b2704
commit
04225f7bc2
@ -4,13 +4,16 @@ You probably don't care about this section - skip to the next one.
|
|||||||
|
|
||||||
## before next release
|
## before next release
|
||||||
|
|
||||||
* turn off bluetooth interface ENTIRELY while using serial API (was python client times out on connect sometimes)
|
* split position.time and last_heard
|
||||||
* gps assistance from phone not working?
|
* update android app to use last_heard
|
||||||
|
* have android fill in if local GPS has poor signal
|
||||||
|
* DONE turn off bluetooth interface ENTIRELY while using serial API (was python client times out on connect sometimes)
|
||||||
|
* DONE gps assistance from phone not working?
|
||||||
* DONE test latest firmware update with is_router
|
* DONE test latest firmware update with is_router
|
||||||
* DONE firmware OTA updates of is_router true nodes fails?
|
* DONE firmware OTA updates of is_router true nodes fails?
|
||||||
* DONE add UI in android app to reset to defaults https://github.com/meshtastic/Meshtastic-Android/issues/263
|
* DONE add UI in android app to reset to defaults https://github.com/meshtastic/Meshtastic-Android/issues/263
|
||||||
* DONE TEST THIS! changing channels requires a reboot to take effect https://github.com/meshtastic/Meshtastic-device/issues/752
|
* DONE TEST THIS! changing channels requires a reboot to take effect https://github.com/meshtastic/Meshtastic-device/issues/752
|
||||||
* DIBE bug report with remote info request timing out
|
* DONE bug report with remote info request timing out
|
||||||
* DONE retest channel changing in android (using sim?)
|
* DONE retest channel changing in android (using sim?)
|
||||||
* DONE move remote admin doc from forum into git
|
* DONE move remote admin doc from forum into git
|
||||||
* DONE check crashlytics
|
* DONE check crashlytics
|
||||||
|
@ -198,7 +198,7 @@ NodeInfo *MeshService::refreshMyNodeInfo()
|
|||||||
Position &position = node->position;
|
Position &position = node->position;
|
||||||
|
|
||||||
// Update our local node info with our position (even if we don't decide to update anyone else)
|
// Update our local node info with our position (even if we don't decide to update anyone else)
|
||||||
position.time =
|
node->last_heard =
|
||||||
getValidTime(RTCQualityFromNet); // This nodedb timestamp might be stale, so update it if our clock is kinda valid
|
getValidTime(RTCQualityFromNet); // This nodedb timestamp might be stale, so update it if our clock is kinda valid
|
||||||
|
|
||||||
position.battery_level = powerStatus->getBatteryChargePercent();
|
position.battery_level = powerStatus->getBatteryChargePercent();
|
||||||
|
@ -408,8 +408,7 @@ uint32_t sinceLastSeen(const NodeInfo *n)
|
|||||||
{
|
{
|
||||||
uint32_t now = getTime();
|
uint32_t now = getTime();
|
||||||
|
|
||||||
uint32_t last_seen = n->position.time;
|
int delta = (int)(now - n->last_heard);
|
||||||
int delta = (int)(now - last_seen);
|
|
||||||
if (delta < 0) // our clock must be slightly off still - not set from GPS yet
|
if (delta < 0) // our clock must be slightly off still - not set from GPS yet
|
||||||
delta = 0;
|
delta = 0;
|
||||||
|
|
||||||
@ -443,7 +442,7 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p)
|
|||||||
// Be careful to only update fields that have been set by the sender
|
// Be careful to only update fields that have been set by the sender
|
||||||
// A lot of position reports don't have time populated. In that case, be careful to not blow away the time we
|
// A lot of position reports don't have time populated. In that case, be careful to not blow away the time we
|
||||||
// recorded based on the packet rxTime
|
// recorded based on the packet rxTime
|
||||||
if (!info->position.time && p.time)
|
if (p.time)
|
||||||
info->position.time = p.time;
|
info->position.time = p.time;
|
||||||
if (p.battery_level)
|
if (p.battery_level)
|
||||||
info->position.battery_level = p.battery_level;
|
info->position.battery_level = p.battery_level;
|
||||||
@ -493,10 +492,8 @@ void NodeDB::updateFrom(const MeshPacket &mp)
|
|||||||
|
|
||||||
NodeInfo *info = getOrCreateNode(getFrom(&mp));
|
NodeInfo *info = getOrCreateNode(getFrom(&mp));
|
||||||
|
|
||||||
if (mp.rx_time) { // if the packet has a valid timestamp use it to update our last_seen
|
if (mp.rx_time) // if the packet has a valid timestamp use it to update our last_heard
|
||||||
info->has_position = true; // at least the time is valid
|
info->last_heard = mp.rx_time;
|
||||||
info->position.time = mp.rx_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mp.rx_snr)
|
if (mp.rx_snr)
|
||||||
info->snr = mp.rx_snr; // keep the most recent SNR we received for this node.
|
info->snr = mp.rx_snr; // keep the most recent SNR we received for this node.
|
||||||
|
@ -125,7 +125,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define LegacyRadioConfig_size 4
|
#define LegacyRadioConfig_size 4
|
||||||
#define LegacyRadioConfig_LegacyPreferences_size 2
|
#define LegacyRadioConfig_LegacyPreferences_size 2
|
||||||
#define DeviceState_size 4920
|
#define DeviceState_size 5112
|
||||||
#define ChannelFile_size 832
|
#define ChannelFile_size 832
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -161,6 +161,7 @@ typedef struct _NodeInfo {
|
|||||||
User user;
|
User user;
|
||||||
bool has_position;
|
bool has_position;
|
||||||
Position position;
|
Position position;
|
||||||
|
uint32_t last_heard;
|
||||||
float snr;
|
float snr;
|
||||||
} NodeInfo;
|
} NodeInfo;
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ extern "C" {
|
|||||||
#define Routing_init_default {0, {RouteDiscovery_init_default}}
|
#define Routing_init_default {0, {RouteDiscovery_init_default}}
|
||||||
#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
|
#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
|
||||||
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
|
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
|
||||||
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0}
|
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0}
|
||||||
#define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
|
#define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
|
||||||
#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN}
|
#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN}
|
||||||
#define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}}
|
#define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}}
|
||||||
@ -244,7 +245,7 @@ extern "C" {
|
|||||||
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
|
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
|
||||||
#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
|
#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0}
|
||||||
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
|
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0}
|
||||||
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0}
|
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0}
|
||||||
#define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
|
#define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0}
|
||||||
#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN}
|
#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN}
|
||||||
#define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}}
|
#define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}}
|
||||||
@ -299,6 +300,7 @@ extern "C" {
|
|||||||
#define NodeInfo_num_tag 1
|
#define NodeInfo_num_tag 1
|
||||||
#define NodeInfo_user_tag 2
|
#define NodeInfo_user_tag 2
|
||||||
#define NodeInfo_position_tag 3
|
#define NodeInfo_position_tag 3
|
||||||
|
#define NodeInfo_last_heard_tag 4
|
||||||
#define NodeInfo_snr_tag 7
|
#define NodeInfo_snr_tag 7
|
||||||
#define Routing_route_request_tag 1
|
#define Routing_route_request_tag 1
|
||||||
#define Routing_route_reply_tag 2
|
#define Routing_route_reply_tag 2
|
||||||
@ -378,6 +380,7 @@ X(a, STATIC, SINGULAR, INT32, rx_rssi, 13)
|
|||||||
X(a, STATIC, SINGULAR, UINT32, num, 1) \
|
X(a, STATIC, SINGULAR, UINT32, num, 1) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \
|
X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \
|
X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \
|
||||||
|
X(a, STATIC, SINGULAR, FIXED32, last_heard, 4) \
|
||||||
X(a, STATIC, SINGULAR, FLOAT, snr, 7)
|
X(a, STATIC, SINGULAR, FLOAT, snr, 7)
|
||||||
#define NodeInfo_CALLBACK NULL
|
#define NodeInfo_CALLBACK NULL
|
||||||
#define NodeInfo_DEFAULT NULL
|
#define NodeInfo_DEFAULT NULL
|
||||||
@ -463,7 +466,7 @@ extern const pb_msgdesc_t ToRadio_msg;
|
|||||||
#define Routing_size 42
|
#define Routing_size 42
|
||||||
#define Data_size 260
|
#define Data_size 260
|
||||||
#define MeshPacket_size 309
|
#define MeshPacket_size 309
|
||||||
#define NodeInfo_size 126
|
#define NodeInfo_size 131
|
||||||
#define MyNodeInfo_size 89
|
#define MyNodeInfo_size 89
|
||||||
#define LogRecord_size 81
|
#define LogRecord_size 81
|
||||||
#define FromRadio_size 318
|
#define FromRadio_size 318
|
||||||
|
Loading…
Reference in New Issue
Block a user