Skip to content

UNO R4 WiFi: SATSE add serialNumber(byte sn[]) API #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2024
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
14 changes: 14 additions & 0 deletions libraries/SoftwareATSE/src/SoftwareATSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ void SoftwareATSEClass::debug(Stream &u, uint8_t level)
modem.debug(u,level);
}

int SoftwareATSEClass::serialNumber(byte sn[])
{
string res = "";
modem.read_using_size();
if (modem.write(string(PROMPT(_SOFTSE_SERIAL)), res, "%s", CMD(_SOFTSE_SERIAL))) {
if (res.size()) {
String result = (char*)NULL;
memcpy(sn, (uint8_t*)&res[0], 6);
return 1;
}
}
return 0;
}

String SoftwareATSEClass::serialNumber()
{
string res = "";
Expand Down
1 change: 1 addition & 0 deletions libraries/SoftwareATSE/src/SoftwareATSE.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class SoftwareATSEClass

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

int serialNumber(byte sn[]);
String serialNumber();

long random(long min, long max);
Expand Down
Loading