mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-31 06:05:56 +00:00
* ContactInfo, added gps_lat, gps_lon
* companion_radio: now also save gps_lat, gps_lon * BaseChatMesh: now parses gps_lat, gps_lon out of Advertisement
This commit is contained in:
@@ -38,6 +38,9 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
||||
from = &contacts[num_contacts++];
|
||||
from->id = id;
|
||||
from->out_path_len = -1; // initially out_path is unknown
|
||||
from->gps_lat = 0; // initially unknown GPS loc
|
||||
from->gps_lon = 0;
|
||||
|
||||
// only need to calculate the shared_secret once, for better performance
|
||||
self_id.calcSharedSecret(from->shared_secret, id);
|
||||
} else {
|
||||
@@ -50,6 +53,10 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
||||
strncpy(from->name, parser.getName(), sizeof(from->name)-1);
|
||||
from->name[sizeof(from->name)-1] = 0;
|
||||
from->type = parser.getType();
|
||||
if (parser.hasLatLon()) {
|
||||
from->gps_lat = parser.getIntLat();
|
||||
from->gps_lon = parser.getIntLon();
|
||||
}
|
||||
from->last_advert_timestamp = timestamp;
|
||||
from->lastmod = getRTCClock()->getCurrentTime();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user