mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* Refactor: advert_loc_policy now applied in new method CommonCLI::buildAdvertData()
This commit is contained in:
parent
837e7dcbdb
commit
93c0180740
5 changed files with 18 additions and 39 deletions
|
|
@ -287,19 +287,7 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
|
|||
|
||||
mesh::Packet *MyMesh::createSelfAdvert() {
|
||||
uint8_t app_data[MAX_ADVERT_DATA_SIZE];
|
||||
uint8_t app_data_len;
|
||||
{
|
||||
if (_prefs.advert_loc_policy == ADVERT_LOC_NONE) {
|
||||
AdvertDataBuilder builder(ADV_TYPE_REPEATER, _prefs.node_name);
|
||||
app_data_len = builder.encodeTo(app_data);
|
||||
} else if (_prefs.advert_loc_policy == ADVERT_LOC_SHARE) {
|
||||
AdvertDataBuilder builder(ADV_TYPE_REPEATER, _prefs.node_name, sensors.node_lat, sensors.node_lon);
|
||||
app_data_len = builder.encodeTo(app_data);
|
||||
} else {
|
||||
AdvertDataBuilder builder(ADV_TYPE_REPEATER, _prefs.node_name, _prefs.node_lat, _prefs.node_lon);
|
||||
app_data_len = builder.encodeTo(app_data);
|
||||
}
|
||||
}
|
||||
uint8_t app_data_len = _cli.buildAdvertData(ADV_TYPE_REPEATER, app_data);
|
||||
|
||||
return createAdvert(self_id, app_data, app_data_len);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue