Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Calapristi committed Sep 30, 2022
2 parents 297bc24 + a821edb commit e015a5a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### v 1.1 - 2022.09.30
* Fix: fixed an issue when using NRF52 board
* Add: Add support to mbed_nano, mbed_rp2040 [#f562fb1] (by khoih-prog)
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
# Microcontroller-Id Arduino Library by smartme.IO

# Credits
Based on [ArduinoUniqueID](https://github.com/ricaun/ArduinoUniqueID) by [Luiz Henrique Cassettari][https://github.com/ricaun)

The Microcontroller-Id library allows to retrieve the manufacturer's serial number from the microprocessor.

## Credits

This library is based on [ArduinoUniqueID](https://github.com/ricaun/ArduinoUniqueID) by Luiz Henrique Cassettari (https://github.com/ricaun).

## Supported devices

Currently the following devices are supported:

- Atmel AVR
- Atmel SAM
- Atmel SAMD
- STM32
- Espressif ESP
- RP2040 (Raspberry Pi Pico)
- nRF52

## Examples and usage

The library already comes with an example showing how to properly use the provided methods. The Id can be either retieved as a uint8_t array by calling the MicroID.getUniqueID function
```c
uint8_t uniqueID [16];
MicroID.getUniqueID(uniqueID, 16);
```

or as a string via the MicroID.getUniqueIDString function. In both cases the Id will be zero padded until the given size is met however, if a size is not provided in the getUniqueIDString method, only the bare minimum Id will be returned.
```c
char id [50];
MicroID.getUniqueIDString(id);
//This one will be padded until 20 bytes reached
MicroID.getUniqueIDString(id, 20);
```
2 changes: 1 addition & 1 deletion examples/GetDeviceID/GetDeviceID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void setup() {
Serial.println(id);

MicroID.getUniqueIDString(id, 20);
Serial.print("Device ID (fixed-lenght string): ");
Serial.print("Device ID (fixed-length string): ");
Serial.println(id);
}

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Microcontroller-id
version=1.0.0
version=1.1.0
author=smartme.IO
maintainer=smartme.IO <[email protected]>
sentence=Retrieve manufacturer serial number stored inside the microcontroller
Expand Down
2 changes: 1 addition & 1 deletion src/MicrocontrollerID.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This library can be considered as a reshaped version of the ArduinoUniqueID libr
#elif defined(ARDUINO_ARCH_STM32)
#define IDSIZE 12
#elif defined(ARDUINO_ARCH_NRF52)
#define IDSIZE 12
#define IDSIZE 8
#endif


Expand Down

0 comments on commit e015a5a

Please sign in to comment.