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

This commit is contained in:
Gregory Nutt 2015-11-18 07:31:53 -06:00
parent 0d18b13a16
commit 4579f0c1fc
4 changed files with 49 additions and 12 deletions

View File

@ -11111,3 +11111,6 @@
(2015-11-18).
* arch/sim/src/up_spiflash.c: Add support for W25 FLASH simulation.
From Ken Petit (2015-11-18).
* configs/boardctl.h, Kconfig, include/sys/boardctl.h, and nuttx/board.h:
Add a command to the boardctl() interface to obtain a board unique ID
(2015-11-18).

@ -1 +1 @@
Subproject commit 001222765f770a9ec4bd58b95fd065fbf4fbcec0
Subproject commit ca62315de49f3627e05136ba49d4ce0f9dff7784

View File

@ -193,6 +193,32 @@ int board_power_off(int status);
int board_reset(int status);
#endif
/****************************************************************************
* Name: board_uniqueid
*
* Description:
* Return a unique ID associated with the board. The meaning of this
* unique ID is not specified. It may be a chip identifying number, a
* serial number, a MAC address, etc. It may be in binary or it may be
* ASCII. The only only requirement is that the length of the unique
* ID be exactly CONFIG_BOARDCTL_UNIQUEID_SIZE in length.
*
* Input Parameters:
* uniqueid - A reference to a writable memory location provided by the
* caller to receive the board unique ID. The memory memory referenced
* by this pointer must be at least CONFIG_BOARDCTL_UNIQUEID_SIZE in
* length.
*
* Returned Value:
* Zero (OK) is returned on success. Otherwize a negated errno value is
* returned indicating the nature of the failure.
*
****************************************************************************/
#ifdef CONFIG_BOARDCTL_UNIQUEID
int board_uniqueid(FAR uint8_t *uniqueid);
#endif
/****************************************************************************
* Name: board_tsc_setup
*

View File

@ -56,19 +56,26 @@
* DESCRIPTION: Perform one-time application initialization.
* ARG: None
* CONFIGURATION: CONFIG_LIB_BOARDCTL
* DEPENDENCIES: Board logic must provide board_app_initialization
* DEPENDENCIES: Board logic must provide board_app_initialization()
*
* CMD: BOARDIOC_POWEROFF
* DESCRIPTION: Power off the board
* ARG: Integer value providing power off status information
* CONFIGURATION: CONFIG_BOARDCTL_POWEROFF
* DEPENDENCIES: Board logic must provide board_power_off
* DEPENDENCIES: Board logic must provide the board_power_off() interface.
*
* CMD: BOARDIOC_RESET
* DESCRIPTION: Reset the board
* ARG: Integer value providing power off status information
* CONFIGURATION: CONFIG_BOARDCTL_RESET
* DEPENDENCIES: Board logic must provide board_reset
* DEPENDENCIES: Board logic must provide the board_reset() interface.
*
* 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.
*
* CMD: BOARDIOC_SYMTAB
* DESCRIPTION: Select a symbol table
@ -117,13 +124,14 @@
#define BOARDIOC_INIT _BOARDIOC(0x0001)
#define BOARDIOC_POWEROFF _BOARDIOC(0x0002)
#define BOARDIOC_RESET _BOARDIOC(0x0003)
#define BOARDIOC_SYMTAB _BOARDIOC(0x0004)
#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0005)
#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0006)
#define BOARDIOC_ADCTEST_SETUP _BOARDIOC(0x0007)
#define BOARDIOC_PWMTEST_SETUP _BOARDIOC(0x0008)
#define BOARDIOC_CAN_INITIALIZE _BOARDIOC(0x0009)
#define BOARDIOC_GRAPHICS_SETUP _BOARDIOC(0x000a)
#define BOARDIOC_UNIQUEID _BOARDIOC(0x0004)
#define BOARDIOC_SYMTAB _BOARDIOC(0x0005)
#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0006)
#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0007)
#define BOARDIOC_ADCTEST_SETUP _BOARDIOC(0x0008)
#define BOARDIOC_PWMTEST_SETUP _BOARDIOC(0x0009)
#define BOARDIOC_CAN_INITIALIZE _BOARDIOC(0x000a)
#define BOARDIOC_GRAPHICS_SETUP _BOARDIOC(0x000b)
/* If CONFIG_BOARDCTL_IOCTL=y, then boad-specific commands will be support.
* In this case, all commands not recognized by boardctl() will be forwarded
@ -132,7 +140,7 @@
* User defined board commands may begin with this value:
*/
#define BOARDIOC_USER _BOARDIOC(0x000b)
#define BOARDIOC_USER _BOARDIOC(0x000c)
/****************************************************************************
* Public Type Definitions