CC_MONITOR_ONLY option added
GPS Time will be displayed as YYYY-MM-DD HH-MM-SS
This commit is contained in:
parent
23f3ff0392
commit
30d259645c
15
src/main.cpp
15
src/main.cpp
|
@ -181,6 +181,7 @@ void startReceive(){
|
||||||
|
|
||||||
// send packet (blocking), MCU sleeps while waiting for TX DONE
|
// send packet (blocking), MCU sleeps while waiting for TX DONE
|
||||||
bool perhapsSend(Packet_t* p) {
|
bool perhapsSend(Packet_t* p) {
|
||||||
|
if (!CC_MONITOR_ONLY) {
|
||||||
if (p->size > RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
|
if (p->size > RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
|
||||||
MSG("\n\r[INF]Packet size is %i! Reducing to %i. Sending ...", p->size, RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
MSG("\n\r[INF]Packet size is %i! Reducing to %i. Sending ...", p->size, RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
||||||
p->size = RADIOLIB_SX126X_MAX_PACKET_LENGTH;
|
p->size = RADIOLIB_SX126X_MAX_PACKET_LENGTH;
|
||||||
|
@ -205,6 +206,10 @@ bool perhapsSend(Packet_t* p) {
|
||||||
dio1 = false;
|
dio1 = false;
|
||||||
radio.finishTransmit();
|
radio.finishTransmit();
|
||||||
return ( err & RADIOLIB_SX126X_IRQ_TX_DONE );
|
return ( err & RADIOLIB_SX126X_IRQ_TX_DONE );
|
||||||
|
} else {
|
||||||
|
MSG("[TX]**Monitor only, no TX**\n\r");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool perhapsDecode(Packet_t* p) {
|
bool perhapsDecode(Packet_t* p) {
|
||||||
|
@ -321,11 +326,13 @@ void printVariants(void){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Log packet size and data fields
|
// Log packet size and data fields
|
||||||
MSG("Node=%08X(%s) l=%d latI=%d lonI=%d msl=%d hae=%d geo=%d pdop=%d hdop=%d vdop=%d siv=%d fxq=%d fxt=%d pts=%d "
|
MSG("Node=%08X(%s) l=%d latI=%d lonI=%d msl=%d hae=%d geo=%d pdop=%d hdop=%d vdop=%d siv=%d fxq=%d fxt=%d pts=%d ",
|
||||||
"time=%d\n\r",
|
|
||||||
mp.from, NodeDB.get(mp.from), d.payload.size, pos.latitude_i, pos.longitude_i, pos.altitude, pos.altitude_hae,
|
mp.from, NodeDB.get(mp.from), d.payload.size, pos.latitude_i, pos.longitude_i, pos.altitude, pos.altitude_hae,
|
||||||
pos.altitude_geoidal_separation, pos.PDOP, pos.HDOP, pos.VDOP, pos.sats_in_view, pos.fix_quality, pos.fix_type, pos.timestamp,
|
pos.altitude_geoidal_separation, pos.PDOP, pos.HDOP, pos.VDOP, pos.sats_in_view, pos.fix_quality, pos.fix_type, pos.timestamp
|
||||||
pos.time);
|
);
|
||||||
|
MSG("time=%04d-%02d-%02d %02d:%02d:%02d\n\r",
|
||||||
|
year(pos.time), month(pos.time), day(pos.time),
|
||||||
|
hour(pos.time), minute(pos.time), second(pos.time));
|
||||||
NodeDB.update(&theNode); // update last heard
|
NodeDB.update(&theNode); // update last heard
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#define CC_MAX_POWER 22 // TX power setting. Absolute Max for CubeCell is 22, enforced by RadioLib.
|
#define CC_MAX_POWER 22 // TX power setting. Absolute Max for CubeCell is 22, enforced by RadioLib.
|
||||||
|
|
||||||
|
#define CC_MONITOR_ONLY false // set true to suppress transmitting of packets (just monitor the traffic)
|
||||||
|
|
||||||
#define MAX_ID_LIST 64 // number of stored packet IDs to prevent unnecesary repeating
|
#define MAX_ID_LIST 64 // number of stored packet IDs to prevent unnecesary repeating
|
||||||
#define MAX_NODE_LIST 20 // number of stored known nodes
|
#define MAX_NODE_LIST 20 // number of stored known nodes
|
||||||
#define MAX_TX_QUEUE 8 // max number of packets which can be waiting for transmission
|
#define MAX_TX_QUEUE 8 // max number of packets which can be waiting for transmission
|
||||||
|
@ -69,6 +71,7 @@ SX1262 radio = new Module(RADIOLIB_BUILTIN_MODULE);
|
||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
#include <CryptoEngine.h>
|
#include <CryptoEngine.h>
|
||||||
|
#include <time.h>
|
||||||
/*
|
/*
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue