From 56ac1e5f7d9a1be69b892187648a0f083aa74b66 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Fri, 29 Jun 2018 20:17:52 -0400 Subject: [PATCH] Fix #80: add printout for EV_TXSTART (and clean up) --- examples/ttn-abp/ttn-abp.ino | 27 +++++++++++++++---- .../ttn-otaa-feather-us915.ino | 27 +++++++++++++++---- examples/ttn-otaa/ttn-otaa.ino | 27 +++++++++++++++---- 3 files changed, 66 insertions(+), 15 deletions(-) diff --git a/examples/ttn-abp/ttn-abp.ino b/examples/ttn-abp/ttn-abp.ino index d27dcd4e..3620db22 100644 --- a/examples/ttn-abp/ttn-abp.ino +++ b/examples/ttn-abp/ttn-abp.ino @@ -97,9 +97,14 @@ void onEvent (ev_t ev) { case EV_JOINED: Serial.println(F("EV_JOINED")); break; - case EV_RFU1: - Serial.println(F("EV_RFU1")); - break; + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_RFU1: + || Serial.println(F("EV_RFU1")); + || break; + */ case EV_JOIN_FAILED: Serial.println(F("EV_JOIN_FAILED")); break; @@ -134,8 +139,20 @@ void onEvent (ev_t ev) { case EV_LINK_ALIVE: Serial.println(F("EV_LINK_ALIVE")); break; - default: - Serial.println(F("Unknown event")); + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_SCAN_FOUND: + || Serial.println(F("EV_SCAN_FOUND")); + || break; + */ + case EV_TXSTART: + Serial.println(F("EV_TXSTART")); + break; + default: + Serial.print(F("Unknown event: ")); + Serial.println((unsigned) ev); break; } } diff --git a/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino b/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino index abf12384..03639818 100644 --- a/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino +++ b/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino @@ -123,9 +123,14 @@ void onEvent (ev_t ev) { // size, we don't use it in this example. LMIC_setLinkCheckMode(0); break; - case EV_RFU1: - Serial.println(F("EV_RFU1")); - break; + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_RFU1: + || Serial.println(F("EV_RFU1")); + || break; + */ case EV_JOIN_FAILED: Serial.println(F("EV_JOIN_FAILED")); break; @@ -161,8 +166,20 @@ void onEvent (ev_t ev) { case EV_LINK_ALIVE: Serial.println(F("EV_LINK_ALIVE")); break; - default: - Serial.println(F("Unknown event")); + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_SCAN_FOUND: + || Serial.println(F("EV_SCAN_FOUND")); + || break; + */ + case EV_TXSTART: + Serial.println(F("EV_TXSTART")); + break; + default: + Serial.print(F("Unknown event: ")); + Serial.println((unsigned) ev); break; } } diff --git a/examples/ttn-otaa/ttn-otaa.ino b/examples/ttn-otaa/ttn-otaa.ino index 28790e0a..ce2f7fb3 100644 --- a/examples/ttn-otaa/ttn-otaa.ino +++ b/examples/ttn-otaa/ttn-otaa.ino @@ -113,9 +113,14 @@ void onEvent (ev_t ev) { // size, we don't use it in this example. LMIC_setLinkCheckMode(0); break; - case EV_RFU1: - Serial.println(F("EV_RFU1")); - break; + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_RFU1: + || Serial.println(F("EV_RFU1")); + || break; + */ case EV_JOIN_FAILED: Serial.println(F("EV_JOIN_FAILED")); break; @@ -151,8 +156,20 @@ void onEvent (ev_t ev) { case EV_LINK_ALIVE: Serial.println(F("EV_LINK_ALIVE")); break; - default: - Serial.println(F("Unknown event")); + /* + || This event is defined but not used in the code. No + || point in wasting codespace on it. + || + || case EV_SCAN_FOUND: + || Serial.println(F("EV_SCAN_FOUND")); + || break; + */ + case EV_TXSTART: + Serial.println(F("EV_TXSTART")); + break; + default: + Serial.print(F("Unknown event: ")); + Serial.println((unsigned) ev); break; } }