diff --git a/component.mk b/component.mk index 33f4c60..1072789 100755 --- a/component.mk +++ b/component.mk @@ -1,2 +1,2 @@ COMPONENT_ADD_INCLUDEDIRS := include -COMPONENT_SRCDIRS := src +COMPONENT_SRCDIRS := src src/aes src/hal src/lmic diff --git a/examples/hello_world/main/main.cpp b/examples/hello_world/main/main.cpp index 289ea2c..882c245 100644 --- a/examples/hello_world/main/main.cpp +++ b/examples/hello_world/main/main.cpp @@ -22,11 +22,11 @@ // Copy the below hex string from the "Device EUI" field // on your device's overview page in the TTN console. -const char *devEui = "????????????????"; +const char *devEui = "48AC328FF03E9294"; // Copy the below two lines from bottom of the same page -const char *appEui = "????????????????"; -const char *appKey = "????????????????????????????????"; +const char *appEui = "70B3D57ED000C6CD"; +const char *appKey = "C1ADB6821EF7E906BC51D981DF07CCC4"; // Pins and other resources #define TTN_SPI_HOST HSPI_HOST @@ -36,7 +36,7 @@ const char *appKey = "????????????????????????????????"; #define TTN_PIN_SPI_MISO 19 #define TTN_PIN_NSS 18 #define TTN_PIN_RXTX TTN_NOT_CONNECTED -#define TTN_PIN_RST 14 +#define TTN_PIN_RST TTN_NOT_CONNECTED #define TTN_PIN_DIO0 26 #define TTN_PIN_DIO1 33 diff --git a/src/TheThingsNetwork.cpp b/src/TheThingsNetwork.cpp index 8a4a005..b42fa37 100644 --- a/src/TheThingsNetwork.cpp +++ b/src/TheThingsNetwork.cpp @@ -14,10 +14,10 @@ #include "esp_event.h" #include "esp_log.h" #include "TheThingsNetwork.h" -#include "config.h" -#include "hal.h" -#include "hal_esp32.h" -#include "lmic.h" +#include "lmic/config.h" +#include "lmic/hal.h" +#include "hal/hal_esp32.h" +#include "lmic/lmic.h" #include "provisioning.h" diff --git a/src/aes.c b/src/aes/aes.c similarity index 99% rename from src/aes.c rename to src/aes/aes.c index c2223c2..2d19af6 100755 --- a/src/aes.c +++ b/src/aes/aes.c @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "oslmic.h" +#include "../lmic/oslmic.h" #define AES_MICSUB 0x30 // internal use only diff --git a/src/hal_esp32.c b/src/hal/hal_esp32.c similarity index 99% rename from src/hal_esp32.c rename to src/hal/hal_esp32.c index 1ef1997..d6c6ee9 100755 --- a/src/hal_esp32.c +++ b/src/hal/hal_esp32.c @@ -10,8 +10,8 @@ * Hardware abstraction layer to run LMIC on a ESP32 using ESP-iDF. *******************************************************************************/ -#include "lmic.h" -#include "hal_esp32.h" +#include "../lmic/lmic.h" +#include "../hal/hal_esp32.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/src/hal_esp32.h b/src/hal/hal_esp32.h similarity index 100% rename from src/hal_esp32.h rename to src/hal/hal_esp32.h diff --git a/src/config.h b/src/lmic/config.h similarity index 100% rename from src/config.h rename to src/lmic/config.h diff --git a/src/hal.h b/src/lmic/hal.h similarity index 100% rename from src/hal.h rename to src/lmic/hal.h diff --git a/src/lmic.c b/src/lmic/lmic.c similarity index 100% rename from src/lmic.c rename to src/lmic/lmic.c diff --git a/src/lmic.h b/src/lmic/lmic.h similarity index 100% rename from src/lmic.h rename to src/lmic/lmic.h diff --git a/src/lorabase.h b/src/lmic/lorabase.h similarity index 100% rename from src/lorabase.h rename to src/lmic/lorabase.h diff --git a/src/oslmic.c b/src/lmic/oslmic.c similarity index 99% rename from src/oslmic.c rename to src/lmic/oslmic.c index c315f53..0fae191 100755 --- a/src/oslmic.c +++ b/src/lmic/oslmic.c @@ -26,7 +26,7 @@ */ #include "lmic.h" -#include "hal_esp32.h" +#include "../hal/hal_esp32.h" #include // RUNTIME STATE diff --git a/src/oslmic.h b/src/lmic/oslmic.h similarity index 100% rename from src/oslmic.h rename to src/lmic/oslmic.h diff --git a/src/radio.c b/src/lmic/radio.c similarity index 100% rename from src/radio.c rename to src/lmic/radio.c diff --git a/src/provisioning.c b/src/provisioning.c index 96d76c4..f3195c1 100644 --- a/src/provisioning.c +++ b/src/provisioning.c @@ -17,8 +17,8 @@ #include "esp_system.h" #include "nvs_flash.h" #include "provisioning.h" -#include "lmic.h" -#include "hal_esp32.h" +#include "lmic/lmic.h" +#include "hal/hal_esp32.h" #define UART_NUM CONFIG_TTN_PROVISION_UART_NUM #define MAX_LINE_LENGTH 128 diff --git a/src/provisioning.h b/src/provisioning.h index fa9fe12..36ed89e 100644 --- a/src/provisioning.h +++ b/src/provisioning.h @@ -13,7 +13,7 @@ #ifndef _provision_task_h_ #define _provision_task_h_ -#include "oslmic.h" +#include "lmic/oslmic.h" #ifdef __cplusplus