Skip to content

Commit abf5731

Browse files
committed
Automatically include SSU and set-up everything for OTA upload when building for a MKR GSM board
1 parent a62b28c commit abf5731

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/ArduinoIoTCloudTCP.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "tls/utility/CryptoUtil.h"
3030
#endif
3131

32+
#include "utility/ota/OTAStorage_MKRGSM.h"
3233
#include "utility/ota/OTAStorage_MKRMEM.h"
3334

3435
#include "cbor/CBOREncoder.h"
@@ -39,9 +40,11 @@
3940

4041
TimeService time_service;
4142

42-
#if OTA_STORAGE_MKRMEM
43+
#if OTA_STORAGE_MKRGSM
44+
static OTAStorage_MKRGSM ota_storage_ssu;
45+
#elif OTA_STORAGE_MKRMEM
4346
static OTAStorage_MKRMEM ota_storage_sfu;
44-
#endif /* OTA_STORAGE_MKRMEM */
47+
#endif
4548

4649
/******************************************************************************
4750
GLOBAL CONSTANTS
@@ -141,7 +144,9 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
141144

142145
printConnectionStatus(_iot_status);
143146

144-
#if OTA_STORAGE_MKRMEM
147+
#if OTA_STORAGE_MKRGSM
148+
setOTAStorage(ota_storage_ssu);
149+
#elif OTA_STORAGE_MKRMEM
145150
setOTAStorage(ota_storage_sfu);
146151
#endif /* OTA_STORAGE_MKRMEM */
147152

src/ArduinoIoTCloud_Config.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@
2626
#define OTA_STORAGE_MKRMEM (0)
2727
#endif
2828

29-
#ifndef OTA_STORAGE_MKRGSM
29+
#ifdef ARDUINO_SAMD_MKRGSM1400
30+
#define OTA_STORAGE_MKRGSM (1)
31+
#else
3032
#define OTA_STORAGE_MKRGSM (0)
3133
#endif
3234

3335
/******************************************************************************
3436
* AUTOMATIC CONFIGURED DEFINES
3537
******************************************************************************/
3638

37-
#if !defined(ARDUINO_SAMD_MKR1000) && !defined(ARDUINO_SAMD_MKRWIFI1010) && !defined(ARDUINO_SAMD_MKRGSM1400) && !defined(ARDUINO_SAMD_MKRNB1500)
38-
#define OTA_STORAGE_MKRMEM (0)
39-
#endif
40-
4139
#if OTA_STORAGE_MKRMEM || OTA_STORAGE_MKRGSM
4240
#define OTA_ENABLED (1)
4341
#else

src/utility/ota/OTAStorage_MKRGSM.h

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <ArduinoIoTCloud_Config.h>
2626
#if OTA_STORAGE_MKRGSM
2727

28+
#include <SSU.h>
29+
2830
#include "OTAStorage.h"
2931

3032
#include <GSMFileUtils.h>

0 commit comments

Comments
 (0)