Add a command to boardctl() to obtain a baord unique ID

This commit is contained in:
Gregory Nutt 2015-11-18 07:31:23 -06:00
parent 5937f9930d
commit 91a8514774
2 changed files with 33 additions and 0 deletions

View File

@ -1764,6 +1764,22 @@ config BOARDCTL_RESET
Architecture specific logic must provide the board_reset()
interface.
config BOARDCTL_UNIQUEID
bool "Return board unique ID"
default n
---help---
Enables support for the BOARDIOC_UNIQUEID boardctl() command.
Architecture specific logic must provide the board_uniqueid()
interface.
config BOARDCTL_UNIQUEID_SIZE
int "Size of the board unique ID (bytes)"
default 16
depends on BOARDCTL_UNIQUEID
---help---
Provides the size of the memory buffer that must be provided by the
caller of board_uniqueid() in which to receive the board unique ID.
config BOARDCTL_SYMTAB
bool "Enable symbol table interfaces"
default n

View File

@ -131,6 +131,23 @@ int boardctl(unsigned int cmd, uintptr_t arg)
break;
#endif
#ifdef CONFIG_BOARDCTL_UNIQUEID
/* CMD: BOARDIOC_UNIQUEID
* DESCRIPTION: Return a unique ID associated with the board (such
* as a serial number or a MAC address).
* ARG: A writable array of size CONFIG_BOARDCTL_UNIQUEID_SIZE
* in which to receive the board unique ID.
* DEPENDENCIES: Board logic must provide the board_uniqueid()
* interface.
*/
case BOARDIOC_UNIQUEID:
{
ret = board_uniqueid((FAR uint8_t *)arg);
}
break;
#endif
#ifdef CONFIG_BOARDCTL_SYMTAB
/* CMD: BOARDIOC_SYMTAB
* DESCRIPTION: Select a symbol table