mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-22 23:10:38 +00:00
Bump to version 0.2.7.
This commit is contained in:
1 parent
d670dd00d3
commit
9289da1a19
7 files changed
+68
-46
No files matched your search
@@ -66,7 +66,7 @@ delay(1500);
|
||||
LoRa.setTxPower(power);
|
||||
|
||||
INFO("LoRa init succeeded.");
|
||||
TRACEF("LoRa bandwidth is %s Kbps", std::to_string(Utilities::OS::round(_bitrate/1000.0, 2)).c_str());
|
||||
TRACEF("LoRa bandwidth is %.2f Kbps", Utilities::OS::round(_bitrate/1000.0, 2));
|
||||
#endif
|
||||
|
||||
_online = true;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "microReticulum",
|
||||
"version": "0.2.6",
|
||||
"version": "0.2.7",
|
||||
"description": "Port of Reticulum Network Stack to C++ specifically but not exclusively targeting 32-bit and better MCUs",
|
||||
"keywords": "reticulum, rns, mesh, embedded, mcu, esp32, nrf52, native",
|
||||
"repository":
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=microReticulum
|
||||
version=0.2.6
|
||||
version=0.2.7
|
||||
author=Chad Attermann <attermann@gmail.com>
|
||||
maintainer=Chad Attermann <attermann@gmail.com>
|
||||
sentence=Port of Reticulum Network Stack to C++
|
||||
|
||||
+1
-1
@@ -607,7 +607,7 @@ const Bytes Identity::decrypt(const Bytes& ciphertext_token) const {
|
||||
TRACEF("Identity::decrypt: ciphertext: %s", ciphertext.toHex().c_str());
|
||||
plaintext = token.decrypt(ciphertext);
|
||||
TRACEF("Identity::decrypt: plaintext: %s", plaintext.toHex().c_str());
|
||||
//TRACEF("Identity::decrypt: Token decrypted data of length %s", std::to_string(plaintext.size()).c_str());
|
||||
//TRACEF("Identity::decrypt: Token decrypted data of length %zu", plaintext.size());
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
DEBUGF("Decryption by %s failed: %s", toString().c_str(), e.what());
|
||||
|
||||
+1
-1
@@ -356,7 +356,7 @@ void Link::validate_proof(const Packet& packet) {
|
||||
_object->_activated_at = OS::time();
|
||||
_object->_last_proof = _object->_activated_at;
|
||||
Transport::activate_link(*this);
|
||||
VERBOSEF("Link %s established with %s, RTT is %f s", toString().c_str(), _object->_destination.toString().c_str(), OS::round(_object->_rtt, 3));
|
||||
VERBOSEF("Link %s established with %s, RTT is %.3f s", toString().c_str(), _object->_destination.toString().c_str(), OS::round(_object->_rtt, 3));
|
||||
|
||||
//p if _object->_rtt != None and _object->_establishment_cost != None and _object->_rtt > 0 and _object->_establishment_cost > 0:
|
||||
if (_object->_rtt != 0.0 && _object->_establishment_cost != 0 && _object->_rtt > 0 and _object->_establishment_cost > 0) {
|
||||
|
||||
@@ -92,11 +92,11 @@ namespace RNS {
|
||||
#endif
|
||||
|
||||
inline void log(const char* msg, LogLevel level = LOG_NOTICE) { doLog(level, msg); }
|
||||
//inline void log(const std::string& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
inline void log(const std::string& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
inline void logf(LogLevel level, const char* msg, ...) { va_list vlist; va_start(vlist, msg); doLog(level, msg, vlist); va_end(vlist); }
|
||||
#ifdef ARDUINO
|
||||
//inline void log(const String& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
//inline void log(const StringSumHelper& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
inline void log(const String& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
inline void log(const StringSumHelper& msg, LogLevel level = LOG_NOTICE) { doLog(level, msg.c_str()); }
|
||||
//inline void log(const __FlashStringHelper* msg, LogLevel level = LOG_NOTICE) { doLog(level, msg); }
|
||||
//inline void logf(LogLevel level, const __FlashStringHelper* msg, ...) { va_list vlist; va_start(vlist, msg); doLog(level, msg, vlist); va_end(vlist); }
|
||||
#endif
|
||||
|
||||
@@ -399,30 +399,40 @@ void test_incoming_announce_limit() {
|
||||
if ((RNS::Utilities::OS::ltime() - start_time) >= (num_announces * announces_period + 10000)) {
|
||||
break;
|
||||
}
|
||||
if (announce_count < num_announces && (RNS::Utilities::OS::ltime() - announce_time) >= announces_period) {
|
||||
printf("***** test_incoming_announce_limit: Sending announce #%d\n", announce_count + 1);
|
||||
RNS::Identity temp_id(true);
|
||||
RNS::Destination temp_dest(temp_id, RNS::Type::Destination::IN,
|
||||
RNS::Type::Destination::SINGLE, "test", "announce");
|
||||
temp_dest.set_proof_strategy(RNS::Type::Destination::PROVE_ALL);
|
||||
try {
|
||||
if (announce_count < num_announces && (RNS::Utilities::OS::ltime() - announce_time) >= announces_period) {
|
||||
printf("***** test_incoming_announce_limit: Sending announce #%d\n", announce_count + 1);
|
||||
RNS::Identity temp_id(true);
|
||||
RNS::Destination temp_dest(temp_id, RNS::Type::Destination::IN,
|
||||
RNS::Type::Destination::SINGLE, "test", "announce");
|
||||
temp_dest.set_proof_strategy(RNS::Type::Destination::PROVE_ALL);
|
||||
|
||||
// Announce
|
||||
std::string app_data = "test_announce_" + std::to_string(announce_count + 1);
|
||||
RNS::Packet announce_packet = temp_dest.announce(app_data, false, {RNS::Type::NONE}, {RNS::Type::NONE}, false);
|
||||
announce_packet.pack();
|
||||
// Announce
|
||||
std::string app_data = "test_announce_" + std::to_string(announce_count + 1);
|
||||
RNS::Packet announce_packet = temp_dest.announce(app_data, false, {RNS::Type::NONE}, {RNS::Type::NONE}, false);
|
||||
announce_packet.pack();
|
||||
|
||||
// Must deregister destination so that the ANNOUNCE appears to be from a remote node
|
||||
RNS::Transport::deregister_destination(temp_dest);
|
||||
// Must deregister destination so that the ANNOUNCE appears to be from a remote node
|
||||
RNS::Transport::deregister_destination(temp_dest);
|
||||
|
||||
in_interface.handle_incoming(announce_packet.raw());
|
||||
in_interface.handle_incoming(announce_packet.raw());
|
||||
|
||||
announce_time = RNS::Utilities::OS::ltime();
|
||||
++announce_count;
|
||||
announce_time = RNS::Utilities::OS::ltime();
|
||||
++announce_count;
|
||||
}
|
||||
test_reticulum.loop();
|
||||
if ((RNS::Utilities::OS::ltime() - log_time) >= 5000) {
|
||||
RNS::Transport::dump_stats();
|
||||
log_time = RNS::Utilities::OS::ltime();
|
||||
}
|
||||
}
|
||||
test_reticulum.loop();
|
||||
if ((RNS::Utilities::OS::ltime() - log_time) >= 5000) {
|
||||
RNS::Transport::dump_stats();
|
||||
log_time = RNS::Utilities::OS::ltime();
|
||||
catch (const std::bad_alloc&) {
|
||||
ERROR("test_incoming_announce_limit: bad_alloc - out of memory");
|
||||
break;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
ERRORF("test_incoming_announce_limit: exception: %s", e.what());
|
||||
break;
|
||||
}
|
||||
RNS::Utilities::OS::sleep(0.1);
|
||||
}
|
||||
@@ -450,30 +460,40 @@ void test_incoming_announce_over_limit() {
|
||||
if ((RNS::Utilities::OS::ltime() - start_time) >= (num_announces * announces_period + 10000)) {
|
||||
break;
|
||||
}
|
||||
if (announce_count < num_announces && (RNS::Utilities::OS::ltime() - announce_time) >= announces_period) {
|
||||
printf("***** test_incoming_announce_over_limit: Sending announce #%d\n", announce_count + 1);
|
||||
RNS::Identity temp_id(true);
|
||||
RNS::Destination temp_dest(temp_id, RNS::Type::Destination::IN,
|
||||
RNS::Type::Destination::SINGLE, "test", "announce");
|
||||
temp_dest.set_proof_strategy(RNS::Type::Destination::PROVE_ALL);
|
||||
try {
|
||||
if (announce_count < num_announces && (RNS::Utilities::OS::ltime() - announce_time) >= announces_period) {
|
||||
printf("***** test_incoming_announce_over_limit: Sending announce #%d\n", announce_count + 1);
|
||||
RNS::Identity temp_id(true);
|
||||
RNS::Destination temp_dest(temp_id, RNS::Type::Destination::IN,
|
||||
RNS::Type::Destination::SINGLE, "test", "announce");
|
||||
temp_dest.set_proof_strategy(RNS::Type::Destination::PROVE_ALL);
|
||||
|
||||
// Announce
|
||||
std::string app_data = "test_announce_" + std::to_string(announce_count + 1);
|
||||
RNS::Packet announce_packet = temp_dest.announce(app_data, false, {RNS::Type::NONE}, {RNS::Type::NONE}, false);
|
||||
announce_packet.pack();
|
||||
// Announce
|
||||
std::string app_data = "test_announce_" + std::to_string(announce_count + 1);
|
||||
RNS::Packet announce_packet = temp_dest.announce(app_data, false, {RNS::Type::NONE}, {RNS::Type::NONE}, false);
|
||||
announce_packet.pack();
|
||||
|
||||
// Must deregister destination so that the ANNOUNCE appears to be from a remote node
|
||||
RNS::Transport::deregister_destination(temp_dest);
|
||||
// Must deregister destination so that the ANNOUNCE appears to be from a remote node
|
||||
RNS::Transport::deregister_destination(temp_dest);
|
||||
|
||||
in_interface.handle_incoming(announce_packet.raw());
|
||||
in_interface.handle_incoming(announce_packet.raw());
|
||||
|
||||
announce_time = RNS::Utilities::OS::ltime();
|
||||
++announce_count;
|
||||
announce_time = RNS::Utilities::OS::ltime();
|
||||
++announce_count;
|
||||
}
|
||||
test_reticulum.loop();
|
||||
if ((RNS::Utilities::OS::ltime() - log_time) >= 5000) {
|
||||
RNS::Transport::dump_stats();
|
||||
log_time = RNS::Utilities::OS::ltime();
|
||||
}
|
||||
}
|
||||
test_reticulum.loop();
|
||||
if ((RNS::Utilities::OS::ltime() - log_time) >= 5000) {
|
||||
RNS::Transport::dump_stats();
|
||||
log_time = RNS::Utilities::OS::ltime();
|
||||
catch (const std::bad_alloc&) {
|
||||
ERROR("test_incoming_announce_over_limit: bad_alloc - out of memory");
|
||||
break;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
ERRORF("test_incoming_announce_over_limit: exception: %s", e.what());
|
||||
break;
|
||||
}
|
||||
RNS::Utilities::OS::sleep(0.1);
|
||||
}
|
||||
@@ -560,6 +580,7 @@ void tearDown(void) {}
|
||||
int runUnityTests(void) {
|
||||
UNITY_BEGIN();
|
||||
|
||||
/*
|
||||
// Transport receipt lifecycle
|
||||
RUN_TEST(test_receipt_creation_and_culling);
|
||||
RUN_TEST(test_receipt_rapid_fire);
|
||||
@@ -580,6 +601,7 @@ int runUnityTests(void) {
|
||||
RUN_TEST(test_destination_packet_cycle);
|
||||
|
||||
//RUN_TEST(test_incoming_announce_limit);
|
||||
*/
|
||||
RUN_TEST(test_incoming_announce_over_limit);
|
||||
//RUN_TEST(test_incoming_announce_stress);
|
||||
|
||||
|
||||
Reference in new issue
Block a user