From 78a04ec77c7035dc7699881f0bb4013a98e50d59 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Thu, 11 Oct 2018 14:53:44 +0300 Subject: [PATCH] 1.0.3 flag added and add_device_time_req updated to not support 1.0.2 --- features/lorawan/lorastack/mac/LoRaMacCommand.cpp | 5 +++++ features/lorawan/lorawan_types.h | 1 + 2 files changed, 6 insertions(+) diff --git a/features/lorawan/lorastack/mac/LoRaMacCommand.cpp b/features/lorawan/lorastack/mac/LoRaMacCommand.cpp index 3b4881b833..91fc76c1b4 100644 --- a/features/lorawan/lorastack/mac/LoRaMacCommand.cpp +++ b/features/lorawan/lorastack/mac/LoRaMacCommand.cpp @@ -440,6 +440,11 @@ lorawan_status_t LoRaMacCommand::add_device_mode_indication(uint8_t classType) lorawan_status_t LoRaMacCommand::add_device_time_req() { + //App developer must know if the server version is 1.0.3 (or greater) + //1.0.2 does not support this MAC command and our stack does not support pre 1.0.2 versions + if (LORAWAN_VERSION_1_0_2 == MBED_CONF_LORA_VERSION) { + return LORAWAN_STATUS_UNSUPPORTED; + } lorawan_status_t ret = LORAWAN_STATUS_LENGTH_ERROR; if (cmd_buffer_remaining() > 0) { mac_cmd_buffer[mac_cmd_buf_idx++] = MOTE_MAC_DEVICE_TIME_REQ; diff --git a/features/lorawan/lorawan_types.h b/features/lorawan/lorawan_types.h index c0365619b9..14a64076de 100644 --- a/features/lorawan/lorawan_types.h +++ b/features/lorawan/lorawan_types.h @@ -52,6 +52,7 @@ #define MSG_PROPRIETARY_FLAG 0x08 #define LORAWAN_VERSION_1_0_2 0 +#define LORAWAN_VERSION_1_0_3 1 #define LORAWAN_VERSION_1_1 10 /**