You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/22 09:28:43 UTC
[GitHub] [incubator-nuttx-apps] normanr opened a new pull request #974: system/uniqueid: Add a tool to get the board uniqueid
normanr opened a new pull request #974:
URL: https://github.com/apache/incubator-nuttx-apps/pull/974
## Summary
The `uniqueid` tool provides a way to get the board uniqueid from userspace.
## Impact
This is useful to be able to set the hostname in startup scripts (for example). It includes command line options to:
- select which bytes of the uniqueid you want to print (1 indexed, like the `cut` tool)
- include a prefix (so that `NSH_ARGCAT` is not required)
- print a delimiter between each byte
- format the bytes (hex, HEX, decimal, octal, char)
## Testing
```
nsh> uniqueid
010203000a0b0c0048656c6c6f000000
nsh> uniqueid -p nuttx- -b 4-6
nuttx-000a0b
nsh> uniqueid -d: -fd
1:2:3:0:10:11:12:0:72:101:108:108:111:0:0:0
nsh> uniqueid -b 9-13 -f c
Hello
nsh> uniqueid -b16-1
0000006f6c6c6548000c0b0a00030201
nsh> uniqueid -b9-16,1-8
48656c6c6f000000010203000a0b0c00
nsh> uniqueid -b9-16,1-9
ERROR: Too many bytes selected
nsh> uniqueid -b 0-5
ERROR: Invalid byte position: '0'
nsh> uniqueid -b 10-17
ERROR: Invalid byte position: '17'
nsh> uniqueid -bx
ERROR: Invalid byte position: 'x'
nsh> uniqueid -b1-5-8
ERROR: Invalid byte range: '1-5-8'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #974: system/uniqueid: Add a tool to get the board uniqueid
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #974:
URL: https://github.com/apache/incubator-nuttx-apps/pull/974
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org