expose device serial number in javascript

This commit is contained in:
Peli de Halleux 2016-04-26 17:09:15 -07:00
parent 53bfea5752
commit cef1f57e30

View File

@ -163,4 +163,12 @@ namespace control {
StringData* deviceName() { StringData* deviceName() {
return ManagedString(microbit_friendly_name()).leakData(); return ManagedString(microbit_friendly_name()).leakData();
} }
/**
* Derive a unique, consistent serial number of this device from internal data.
*/
//%
int deviceSerialNumber() {
return microbit_serial_number();
}
} }