Skip to content

Commit bf2c4bb

Browse files
committed
networkId: rename IFACE_MAC_ADDR_LENGTH to NETWORK_ID_SIZE
1 parent f5439b1 commit bf2c4bb

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/networkId.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ bool networkId::begin() {
4343
}
4444

4545
bool networkId::get(uint8_t *in, uint32_t size) {
46-
#if IFACE_MAC_ADDR_LENGTH == 0
46+
#if NETWORK_ID_SIZE == 0
4747
(void)in;
4848
(void)size;
4949
return false;
5050
#else
51-
if (size < IFACE_MAC_ADDR_LENGTH) {
51+
if (size < NETWORK_ID_SIZE) {
5252
return false;
5353
}
5454
#if defined(ARDUINO_NANO_RP2040_CONNECT) || \

src/networkId.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717
defined(ARDUINO_NICLA_VISION) || \
1818
defined(ARDUINO_GIGA)
1919
#include <WiFi.h>
20-
#define IFACE_MAC_ADDR_LENGTH WL_MAC_ADDR_LENGTH
20+
#define NETWORK_ID_SIZE WL_MAC_ADDR_LENGTH
2121
#elif defined(ARDUINO_SAMD_MKRNB1500)
2222
#include <MKRNB.h>
2323
/* We don't take in account Luhn check digit */
24-
#define IFACE_MAC_ADDR_LENGTH 7
24+
#define NETWORK_ID_SIZE 7
2525
#elif defined(ARDUINO_SAMD_MKRGSM1400)
2626
#include <MKRGSM.h>
2727
/* We don't take in account Luhn check digit */
28-
#define IFACE_MAC_ADDR_LENGTH 7
28+
#define NETWORK_ID_SIZE 7
2929
#elif defined(ARDUINO_SAMD_MKRWAN1300) || \
3030
defined(ARDUINO_SAMD_MKRWAN1310)
3131
#include <MKRWAN.h>
32-
#define IFACE_MAC_ADDR_LENGTH 8
32+
#define NETWORK_ID_SIZE 8
3333
#elif defined(ARDUINO_PORTENTA_C33)
3434
#include <WiFiC3.h>
35-
#define IFACE_MAC_ADDR_LENGTH WL_MAC_ADDR_LENGTH
35+
#define NETWORK_ID_SIZE WL_MAC_ADDR_LENGTH
3636
#elif defined(ARDUINO_UNOR4_WIFI)
3737
#include <WiFi.h>
38-
#define IFACE_MAC_ADDR_LENGTH 6
38+
#define NETWORK_ID_SIZE 6
3939
#elif defined(ARDUINO_OPTA)
4040
#include <Ethernet.h>
41-
#define IFACE_MAC_ADDR_LENGTH 6
41+
#define NETWORK_ID_SIZE 6
4242
#else
43-
#define IFACE_MAC_ADDR_LENGTH 0
43+
#define NETWORK_ID_SIZE 0
4444
#endif
4545

4646
/*

src/uniqueHWId.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool UniqueHWId::get(uint8_t* in, uint32_t size) {
2929
if (!_nId.get(&in[offset], size - offset)) {
3030
return false;
3131
}
32-
offset += IFACE_MAC_ADDR_LENGTH;
32+
offset += NETWORK_ID_SIZE;
3333
if (!_sId.get(&in[offset], size - offset)) {
3434
return false;
3535
}

src/uniqueHWId.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UniqueHWId {
2121

2222
public:
2323
static constexpr int BOARD_PROVISIONING_ID_SIZE = UC_UID_SIZE +
24-
IFACE_MAC_ADDR_LENGTH +
24+
NETWORK_ID_SIZE +
2525
CRYPTO_SN_SIZE;
2626

2727
bool begin();

0 commit comments

Comments
 (0)