From ac9ba2becccd8dc93603ab435a5f4c6cfbf2dfb4 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 4 Dec 2024 16:31:57 +0100 Subject: [PATCH 1/4] ci: compile examples fix sketch name --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 0489863..f1ebadd 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,7 +23,7 @@ jobs: - name: Arduino_SecureElement # sketch paths to compile (recursive) for all boards UNIVERSAL_SKETCH_PATHS: | - - examples/boardID + - examples/HWUniqueId SKETCHES_REPORTS_PATH: sketches-reports strategy: From f14fe92501e2b412f271c9c4a669bb2a33dfd42d Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 4 Dec 2024 17:25:40 +0100 Subject: [PATCH 2/4] ci: compile examples add CloudUtils dependency --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index f1ebadd..14cba67 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -20,6 +20,7 @@ jobs: # libraries to install for all boards UNIVERSAL_LIBRARIES: | - source-path: ./ + - name: Arduino_CloudUtils - name: Arduino_SecureElement # sketch paths to compile (recursive) for all boards UNIVERSAL_SKETCH_PATHS: | From d860b3e21a99444bf5ee7f3b7b94d147ab2c0447 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 4 Dec 2024 17:28:06 +0100 Subject: [PATCH 3/4] add dependencies in library.properties --- library.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library.properties b/library.properties index 61e9d3f..66d9392 100644 --- a/library.properties +++ b/library.properties @@ -7,3 +7,5 @@ paragraph= category=Communication url=https://github.com/arduino-libraries/Arduino_HWUniqueId architectures=* +includes=Arduino_HWUniqueId.h +depends=Arduino_CloudUtils,Arduino_SecureElement From 6c99eb4d0a28a1ea3e4a2f1245fcdea8b5fa2b76 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 5 Dec 2024 10:05:13 +0100 Subject: [PATCH 4/4] global renaming --- .github/workflows/compile-examples.yml | 2 +- README.md | 4 ++-- .../HWUniqueId.ino => uniqueHWId/uniqueHWId.ino} | 4 ++-- library.properties | 8 ++++---- src/{Arduino_HWUniqueId.h => Arduino_UniqueHWId.h} | 2 +- src/{HWUniqueId.cpp => uniqueHWId.cpp} | 8 ++++---- src/{HWUniqueId.h => uniqueHWId.h} | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) rename examples/{HWUniqueId/HWUniqueId.ino => uniqueHWId/uniqueHWId.ino} (91%) rename src/{Arduino_HWUniqueId.h => Arduino_UniqueHWId.h} (92%) rename src/{HWUniqueId.cpp => uniqueHWId.cpp} (90%) rename src/{HWUniqueId.h => uniqueHWId.h} (97%) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 14cba67..d69786d 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -24,7 +24,7 @@ jobs: - name: Arduino_SecureElement # sketch paths to compile (recursive) for all boards UNIVERSAL_SKETCH_PATHS: | - - examples/HWUniqueId + - examples/uniqueHWId SKETCHES_REPORTS_PATH: sketches-reports strategy: diff --git a/README.md b/README.md index 41c825d..6a9dc7c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Arduino HardWare Unique Id +# Arduino Unique Hardware Id -This library contains a set of functionalities to compute the hardware unique Id +This library contains a set of functionalities to compute the unique hardware Id of an Arduino board \ No newline at end of file diff --git a/examples/HWUniqueId/HWUniqueId.ino b/examples/uniqueHWId/uniqueHWId.ino similarity index 91% rename from examples/HWUniqueId/HWUniqueId.ino rename to examples/uniqueHWId/uniqueHWId.ino index 4bcb2f3..5b46204 100644 --- a/examples/HWUniqueId/HWUniqueId.ino +++ b/examples/uniqueHWId/uniqueHWId.ino @@ -8,13 +8,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include void setup() { Serial.begin(9600); while (!Serial); - HWUniqueId Id; + UniqueHWId Id; if(Id.begin()) { Serial.println(Id.get()); } else { diff --git a/library.properties b/library.properties index 66d9392..b8ddac1 100644 --- a/library.properties +++ b/library.properties @@ -1,11 +1,11 @@ -name=Arduino_HWUniqueId +name=Arduino_UniqueHWId version=0.0.1 author=Arduino maintainer=Arduino -sentence=Utility module to compute hardware unique identity +sentence=Utility module to compute unique hardware identity paragraph= category=Communication -url=https://github.com/arduino-libraries/Arduino_HWUniqueId +url=https://github.com/arduino-libraries/Arduino_UniqueHWId architectures=* -includes=Arduino_HWUniqueId.h +includes=Arduino_UniqueHWId.h depends=Arduino_CloudUtils,Arduino_SecureElement diff --git a/src/Arduino_HWUniqueId.h b/src/Arduino_UniqueHWId.h similarity index 92% rename from src/Arduino_HWUniqueId.h rename to src/Arduino_UniqueHWId.h index f175da7..49eea13 100644 --- a/src/Arduino_HWUniqueId.h +++ b/src/Arduino_UniqueHWId.h @@ -9,4 +9,4 @@ */ #pragma once -#include "HWUniqueId.h" +#include "uniqueHWId.h" diff --git a/src/HWUniqueId.cpp b/src/uniqueHWId.cpp similarity index 90% rename from src/HWUniqueId.cpp rename to src/uniqueHWId.cpp index ecc3bac..eec6d9b 100644 --- a/src/HWUniqueId.cpp +++ b/src/uniqueHWId.cpp @@ -10,14 +10,14 @@ #include #include -#include "HWUniqueId.h" +#include "uniqueHWId.h" -bool HWUniqueId::begin() { +bool UniqueHWId::begin() { _init =_sId.begin() && _nId.begin(); return _init; } -bool HWUniqueId::get(uint8_t* in, uint32_t size) { +bool UniqueHWId::get(uint8_t* in, uint32_t size) { if (_init == false || size < BOARD_PROVISIONING_ID_SIZE) { Serial.println("BOARD_PROVISIONING_ID_SIZE ERROR"); return false; @@ -40,7 +40,7 @@ bool HWUniqueId::get(uint8_t* in, uint32_t size) { return true; } -String HWUniqueId::get() { +String UniqueHWId::get() { uint8_t data[BOARD_PROVISIONING_ID_SIZE]; if (!get(data, sizeof(data))) { return String(""); diff --git a/src/HWUniqueId.h b/src/uniqueHWId.h similarity index 97% rename from src/HWUniqueId.h rename to src/uniqueHWId.h index 897a5a0..13bf504 100644 --- a/src/HWUniqueId.h +++ b/src/uniqueHWId.h @@ -17,7 +17,7 @@ /* * This class contains the methods to get board hardware unique id */ -class HWUniqueId { +class UniqueHWId { public: static constexpr int BOARD_PROVISIONING_ID_SIZE = UC_UID_SIZE +