Skip to content

Commit a846e14

Browse files
committed
limit cambium beacon parser to more specific packets
1 parent fb82be7 commit a846e14

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tzsp-receiver.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ tzsp_receiver_packet(const uint8_t *packet,
272272

273273
if(cambium_net_get_frequency(net_cambium))
274274
data->network->frequency = cambium_net_get_frequency(net_cambium) * 1000;
275+
else if(channel)
276+
data->network->frequency = (*channel * 5 + context->frequency_base) * 1000;
275277

276278
cambium_net_free(net_cambium);
277279
}

tzsp/cambium.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ cambium_process_beacon(const uint8_t *data,
9393

9494
context = calloc(sizeof(cambium_net_t), 1);
9595

96+
/* Only 0x08 seems to contain useful data */
97+
if(data[1] != 0x08)
98+
return context;
99+
96100
for(i=CAMBIUM_BEACON_HEADER_LEN;
97101
i+CAMBIUM_BEACON_TAG_LEN <= len;
98102
i+=CAMBIUM_BEACON_TAG_LEN + data_len)

0 commit comments

Comments
 (0)