Skip to content

Commit e53daef

Browse files
committed
UNO R4 WiFi: SATSE add serialNumber(byte sn[]) API
1 parent 1169821 commit e53daef

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Diff for: libraries/SoftwareATSE/src/SoftwareATSE.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ void SoftwareATSEClass::debug(Stream &u, uint8_t level)
5757
modem.debug(u,level);
5858
}
5959

60+
int SoftwareATSEClass::serialNumber(byte sn[])
61+
{
62+
string res = "";
63+
modem.read_using_size();
64+
if (modem.write(string(PROMPT(_SOFTSE_SERIAL)), res, "%s", CMD(_SOFTSE_SERIAL))) {
65+
if (res.size()) {
66+
String result = (char*)NULL;
67+
memcpy(sn, (uint8_t*)&res[0], 6);
68+
return 1;
69+
}
70+
}
71+
return 0;
72+
}
73+
6074
String SoftwareATSEClass::serialNumber()
6175
{
6276
string res = "";

Diff for: libraries/SoftwareATSE/src/SoftwareATSE.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class SoftwareATSEClass
3434

3535
void debug(Stream &u, uint8_t level = 0);
3636

37+
int serialNumber(byte sn[]);
3738
String serialNumber();
3839

3940
long random(long min, long max);

0 commit comments

Comments
 (0)