Skip to content

Commit

Permalink
SE050: add API to read serial number raw bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 9, 2024
1 parent 0281be5 commit e24f799
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cores/arduino/api
2 changes: 1 addition & 1 deletion extras/tinyusb
13 changes: 13 additions & 0 deletions libraries/SE05X/src/SE05X.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ void SE05XClass::end()
Se05x_API_SessionClose(&_se05x_session);
}

int SE05XClass::serialNumber(byte sn[], size_t length)
{
size_t uidLen;
const int kSE05x_AppletResID_UNIQUE_ID = 0x7FFF0206,

status = Se05x_API_ReadObject(&_se05x_session, kSE05x_AppletResID_UNIQUE_ID, 0, length, sn, &uidLen);
if (status != SM_OK || length != uidLen) {
SMLOG_E("Error in Se05x_API_ReadObject \n");
return 0;
}
return 1;
}

String SE05XClass::serialNumber()
{
String result = (char*)NULL;
Expand Down
1 change: 1 addition & 0 deletions libraries/SE05X/src/SE05X.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SE05XClass
int begin();
void end();

int serialNumber(byte sn[], size_t length);
#if defined (ARDUINO)
String serialNumber();
#endif
Expand Down

0 comments on commit e24f799

Please sign in to comment.