Skip to content

Commit 4e4f6d9

Browse files
author
Scott Powell
committed
* ANON_REQ_TYPE_VER_OWNER now delimited by newline chars
1 parent 65796c8 commit 4e4f6d9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

examples/simple_repeater/MyMesh.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,17 @@ uint8_t MyMesh::handleAnonRegionsReq(const mesh::Identity& sender, uint32_t send
159159
return 0;
160160
}
161161

162-
static void sanitiseName(char* dest, const char* src) {
163-
while (*src) {
164-
*dest++ = (*src == ',') ? ' ' : *src;
165-
src++;
166-
}
167-
*dest = 0;
168-
}
169-
170162
uint8_t MyMesh::handleAnonVerOwnerReq(const mesh::Identity& sender, uint32_t sender_timestamp, const uint8_t* data) {
171163
if (anon_limiter.allow(rtc_clock.getCurrentTime())) {
172164
// request data has: {reply-path-len}{reply-path}
173165
reply_path_len = *data++ & 0x3F;
174166
memcpy(reply_path, data, reply_path_len);
175167
// data += reply_path_len;
176168

177-
char tmp[sizeof(_prefs.node_name)];
178-
sanitiseName(tmp, _prefs.node_name);
179-
180169
memcpy(reply_data, &sender_timestamp, 4); // prefix with sender_timestamp, like a tag
181170
uint32_t now = getRTCClock()->getCurrentTime();
182171
memcpy(&reply_data[4], &now, 4); // include our clock (for easy clock sync, and packet hash uniqueness)
183-
sprintf((char *) &reply_data[8], "%s,%s,%s", FIRMWARE_VERSION, tmp, _prefs.owner_info);
172+
sprintf((char *) &reply_data[8], "%s\n%s\n%s", FIRMWARE_VERSION, _prefs.node_name, _prefs.owner_info);
184173

185174
return 8 + strlen((char *) &reply_data[8]); // reply length
186175
}

0 commit comments

Comments
 (0)