Skip to content

Commit 328c30a

Browse files
committed
draft cbor encoding for sending network configuration in cloud
1 parent bc06ddc commit 328c30a

File tree

10 files changed

+604
-12
lines changed

10 files changed

+604
-12
lines changed

examples/utility/Provisioning_2.0/CSRHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define MAX_CSR_REQUEST_INTERVAL 180000
2424
#define MAX_CSR_REQUEST_INTERVAL_ATTEMPTS 15
2525

26+
#define COMPILE_TEST
2627
#ifdef COMPILE_TEST
2728
constexpr char *server = "boards-v2.oniudra.cc";
2829
#else

examples/utility/Provisioning_2.0/Provisioning_2.0.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <utility/SElementArduinoCloudDeviceId.h>
1515
#include <utility/SElementArduinoCloudCertificate.h>
1616
#include "utility/LEDFeedback.h"
17-
17+
#define COMPILE_TEST
1818
const char *SKETCH_VERSION = "0.1.0";
1919

2020
enum class DeviceState {

extras/test/CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ FetchContent_Declare(
2020
GIT_TAG main
2121
)
2222

23+
FetchContent_Declare(
24+
connectionhandler
25+
GIT_REPOSITORY https://github.com/arduino-libraries/Arduino_ConnectionHandler.git
26+
GIT_TAG master
27+
)
28+
2329
FetchContent_MakeAvailable(Catch2)
2430

2531
FetchContent_MakeAvailable(cloudutils)
32+
33+
FetchContent_MakeAvailable(connectionhandler)
2634
##########################################################################
2735

2836
include_directories(include)
@@ -55,6 +63,18 @@ target_include_directories(
5563
${cloudutils_SOURCE_DIR}/src/interfaces
5664
)
5765

66+
add_library(connectionhandler INTERFACE)
67+
68+
target_include_directories(
69+
connectionhandler INTERFACE
70+
${connectionhandler_SOURCE_DIR}/src/
71+
)
72+
73+
target_include_directories(
74+
connectionhandler INTERFACE
75+
${connectionhandler_SOURCE_DIR}/src/connectionHandlerModels
76+
)
77+
5878
##########################################################################
5979

6080
set(CMAKE_CXX_STANDARD 11)
@@ -126,12 +146,13 @@ set(TEST_TARGET_SRCS
126146

127147
##########################################################################
128148

149+
add_compile_definitions(BOARD_HAS_LORA BOARD_HAS_CATM1_NBIOT BOARD_HAS_WIFI BOARD_HAS_ETHERNET BOARD_HAS_CELLULAR BOARD_HAS_NB BOARD_HAS_GSM)
129150
add_compile_definitions(HOST HAS_TCP)
130151
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
131152
add_compile_options(-Wno-cast-function-type)
132153

133154
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "--coverage")
134-
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage -Wno-deprecated-copy")
155+
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage -Wno-deprecated-copy -Wno-missing-field-initializers")
135156

136157
##########################################################################
137158

@@ -140,6 +161,7 @@ add_executable(
140161
${TEST_TARGET_SRCS}
141162
)
142163

164+
target_link_libraries( ${TEST_TARGET} connectionhandler)
143165
target_link_libraries( ${TEST_TARGET} cloudutils)
144166
target_link_libraries( ${TEST_TARGET} Catch2WithMain )
145167

extras/test/include/Arduino.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
******************************************************************************/
1111

1212
#include <string>
13+
#include <IPAddress.h>
1314

1415
/******************************************************************************
1516
DEFINES

extras/test/include/IPAddress.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Copyright (c) 2019 Arduino. All rights reserved.
3+
*/
4+
5+
#ifndef TEST_IPADDRESS_H_
6+
#define TEST_IPADDRESS_H_
7+
8+
enum IPType {
9+
IPv4,
10+
IPv6
11+
};
12+
13+
#endif

0 commit comments

Comments
 (0)