This is an old revision of the document!
Table of Contents
Board Identification
under process
Background
(TODO)
Ubuntu
Board Identification using usid
Using the following node, you can get the 16-digit board ID.
cat /sys/class/efuse/usid
odroid@odroid64:~$ cat /sys/class/efuse/usid HKC2123456789ABC
Simple test example
$ gcc -o get_usid get_usid.c
odroid@odroid64:~$ ./get_usid S/N is 'HKC2123456789ABC'
- get_usid.c
#include <stdio.h> #include <unistd.h> #include <fcntl.h> #define SYSFS_CLASS_USID "/sys/class/efuse/usid" #define USID_LEN 16 int main(int argc, char *argv[]) { int fd, len; char buf[USID_LEN]; fd = open(SYSFS_CLASS_USID, O_RDONLY); if (fd < 0) printf("Open error! \n"); read(fd, buf, USID_LEN); printf("S/N is '%s'\n", buf); close(fd); return 0; }
Board Identification using MAC
Or the unique MAC can be used to define your board.
odroid@odroid64:~$ ip add | grep link/ether link/ether 00:12:34:56:78:9A brd ff:ff:ff:ff:ff:ff
Android
Board Identification using usid
On Android platform, you can use Property to get board ID with 'ro.serialno' or 'ro.boot.serialno'.
shell@odroidc2:/ $ getprop ro.serialno HKC2123456789ABC
shell@odroidc2:/ $ getprop ro.boot.serialno HKC2123456789ABC
The native property_get method from a java app using jni can be a general and easy way.
#include <cutils/perperties.h> void get_serialno(void) { char serialno[16]; perperty_get("ro.serialno", serialno, ""); // or perperty_get("ro.bootserialno", serialno, ""); ..... }