Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,047 changes: 373 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,3 @@ Boards can authenticate to the ArduinoIoTCloud servers using 3 methods:
* `DEVICE_CERTIFICATE` and `PRIVATE_KEY`. This values are stored inside the board secure element during the device provisioning phase. Boards that are using this method are: [`MKR 1000`](https://store.arduino.cc/arduino-mkr1000-wifi), [`MKR WiFi 1010`](https://store.arduino.cc/arduino-mkr-wifi-1010), [`MKR GSM 1400`](https://store.arduino.cc/arduino-mkr-gsm-1400-1415), [`MKR NB 1500`](https://store.arduino.cc/arduino-mkr-nb-1500-1413), [`Nano 33 IoT`](https://store.arduino.cc/arduino-nano-33-iot), [`Portenta H7`](https://store.arduino.cc/portenta-h7), [`Nano RP2040 Connect`](https://store.arduino.cc/products/arduino-nano-rp2040-connect), [`Nicla Vision`](https://store.arduino.cc/products/nicla-vision), [`OPTA WiFi`](https://store.arduino.cc/products/opta-wifi), [`OPTA RS485`](https://store.arduino.cc/products/opta-rs485), [`OPTA Lite`](https://store.arduino.cc/products/opta-lite), [`GIGA R1 WiFi`](https://store.arduino.cc/products/giga-r1-wifi), [`Portenta C33`](https://store.arduino.cc/products/portenta-c33)

* `APP_EUI` and `APP_KEY`. This values are defined in the `thingProperties.h` file and included in the Sketch. Boards that are using this method are: [`MKR WAN 1300/1310`](https://store.arduino.cc/mkr-wan-1310)

### License

The ArduinoIoTCloud library is licensed under the GNU General Public License v3.0.

You can be released from the requirements of the above license by purchasing a commercial license. Buying such a license is mandatory if you want to modify or otherwise use the software for commercial activities involving the Arduino software without disclosing the source code of your own applications. To purchase a commercial license, send an email to [email protected]
16 changes: 11 additions & 5 deletions extras/test/include/Arduino.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.

Copyright (c) 2019 Arduino SA

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#ifndef TEST_ARDUINO_H_
#define TEST_ARDUINO_H_

/******************************************************************************
INCLUDE
INCLUDE
******************************************************************************/

#include <string>
#include <IPAddress.h>

/******************************************************************************
DEFINES
DEFINES
******************************************************************************/
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif

/******************************************************************************
TYPEDEF
TYPEDEF
******************************************************************************/

typedef std::string String;

/******************************************************************************
FUNCTION PROTOTYPES
FUNCTION PROTOTYPES
******************************************************************************/

void set_millis(unsigned long const millis);
Expand Down
8 changes: 7 additions & 1 deletion extras/test/include/IPAddress.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.
Copyright (c) 2019 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#ifndef TEST_IPADDRESS_H_
Expand Down
30 changes: 16 additions & 14 deletions extras/test/include/util/CBORTestUtil.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.

Copyright (c) 2019 Arduino SA

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#ifndef INCLUDE_CBOR_TESTUTIL_H_
#define INCLUDE_CBOR_TESTUTIL_H_

/**************************************************************************************
INCLUDE
**************************************************************************************/
/******************************************************************************
INCLUDE
******************************************************************************/

#include <PropertyContainer.h>

#include <vector>

/**************************************************************************************
NAMESPACE
**************************************************************************************/
/******************************************************************************
NAMESPACE
******************************************************************************/

namespace cbor
{

/**************************************************************************************
PROTOTYPES
**************************************************************************************/
/******************************************************************************
PROTOTYPES
******************************************************************************/

std::vector<uint8_t> encode(PropertyContainer & property_container, bool lightPayload = false);
void print(std::vector<uint8_t> const & vect);

/**************************************************************************************
NAMESPACE
**************************************************************************************/

} /* cbor */

#endif /* INCLUDE_CBOR_TESTUTIL_H_ */
16 changes: 11 additions & 5 deletions extras/test/include/util/PropertyTestUtil.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
This file is part of the ArduinoIoTCloud library.
Copyright (c) 2020 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#ifndef PROPERTY_TEST_UTIL_H_
#define PROPERTY_TEST_UTIL_H_

/**************************************************************************************
FUNCTION DECLARATION
**************************************************************************************/
/******************************************************************************
FUNCTION DECLARATION
******************************************************************************/

extern "C" unsigned long getTime();

Expand Down
14 changes: 10 additions & 4 deletions extras/test/src/Arduino.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.

Copyright (c) 2019 Arduino SA

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/******************************************************************************
INCLUDE
INCLUDE
******************************************************************************/

#include <Arduino.h>

/******************************************************************************
GLOBAL VARIABLES
GLOBAL VARIABLES
******************************************************************************/

static unsigned long current_millis = 0;

/******************************************************************************
PUBLIC FUNCTIONS
PUBLIC FUNCTIONS
******************************************************************************/

void set_millis(unsigned long const millis)
Expand Down
20 changes: 12 additions & 8 deletions extras/test/src/test_CloudColor.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.

Copyright (c) 2019 Arduino SA

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/**************************************************************************************
INCLUDE
**************************************************************************************/
/******************************************************************************
INCLUDE
******************************************************************************/

#include <catch2/catch_test_macros.hpp>

#include <util/CBORTestUtil.h>

#include <property/types/CloudColor.h>

/**************************************************************************************
/******************************************************************************
TEST CODE
**************************************************************************************/
******************************************************************************/

SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudColor]")
{
Expand Down
19 changes: 11 additions & 8 deletions extras/test/src/test_CloudFloat.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.

Copyright (c) 2019 Arduino SA

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/**************************************************************************************
/******************************************************************************
INCLUDE
**************************************************************************************/
******************************************************************************/

#include <catch2/catch_test_macros.hpp>

#include <CBORDecoder.h>

#include <property/types/CloudFloat.h>

/**************************************************************************************
/******************************************************************************
TEST CODE
**************************************************************************************/
******************************************************************************/

SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudFloat]")
{
Expand Down Expand Up @@ -108,5 +112,4 @@ SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudFloat]")

REQUIRE(prop.isDifferentFromCloud() == true);
}

}
29 changes: 17 additions & 12 deletions extras/test/src/test_CloudLocation.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
/*
Copyright (c) 2019 Arduino. All rights reserved.
This file is part of the ArduinoIoTCloud library.
Copyright (c) 2019 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/**************************************************************************************
INCLUDE
**************************************************************************************/
/******************************************************************************
INCLUDE
******************************************************************************/

#include <catch2/catch_test_macros.hpp>

#include <property/types/CloudLocation.h>

/**************************************************************************************
/******************************************************************************
TEST CODE
**************************************************************************************/
******************************************************************************/

SCENARIO("Testing cloud type 'Location' Ctor", "[Location::Location]")
{
Expand All @@ -28,7 +33,7 @@ SCENARIO("Testing cloud type 'Location' Ctor", "[Location::Location]")
}
}

/**************************************************************************************/
/******************************************************************************/

SCENARIO("Testing cloud type 'Location' assignment operator", "[Location::operator =]")
{
Expand All @@ -45,7 +50,7 @@ SCENARIO("Testing cloud type 'Location' assignment operator", "[Location::operat
}
}

/**************************************************************************************/
/******************************************************************************/

SCENARIO("Testing cloud type 'Location' operator -", "[Location::operator -]")
{
Expand All @@ -62,7 +67,7 @@ SCENARIO("Testing cloud type 'Location' operator -", "[Location::operator -]")
}
}

/**************************************************************************************/
/******************************************************************************/

SCENARIO("Testing cloud type 'Location' comparison operator ==", "[Location::operator ==]")
{
Expand All @@ -85,7 +90,7 @@ SCENARIO("Testing cloud type 'Location' comparison operator ==", "[Location::ope
}
}

/**************************************************************************************/
/******************************************************************************/

SCENARIO("Testing cloud type 'Location' comparison operator !=", "[Location::operator !=]")
{
Expand All @@ -108,7 +113,7 @@ SCENARIO("Testing cloud type 'Location' comparison operator !=", "[Location::ope
}
}

/**************************************************************************************/
/******************************************************************************/

SCENARIO("Testing cloud type 'Location' function distance for calculating Euclidean 2d distance between two points", "[Location::distance]")
{
Expand Down
Loading
Loading