User calibration vector
The purpose of the usrcalib functionality is to allow manufacturers to store some information about the vehicle, such as its production number, model, and year. These data are stored permanently (as part of the metadata vector), so even if the vehicle's firmware is changed, the information in the USRCALIB will not be affected.
Command usrcalib [id] [data]
id | name | size | Description |
---|---|---|---|
0 | usrWelcome | 200 char | Every controller startup, this will be printed to the terminal |
1 | usrDevName | 40 char | Device name |
2 | usrDevSN | 40 char | Device serial number |
3 | usrDevId0 | int32 | Any 32-bit signed integer |
4 | usrDevId1 | int32 | Any 32-bit signed integer |
5 | usrDevId2 | int32 | Any 32-bit signed integer |
6 | usrDevId3 | int32 | Any 32-bit signed integer |
7 | usrDevId4 | int32 | Any 32-bit signed integer |
8 | usrDevId5 | int32 | Any 32-bit signed integer |
9 | usrDevId6 | int32 | Any 32-bit signed integer |
10 | usrDevId7 | int32 | Any 32-bit signed integer |
11 | usrDevId8 | int32 | Any 32-bit signed integer |
12 | usrDevId9 | int32 | Any 32-bit signed integer |
Change USRCALIB value
Set usrWelcome to "Hello world!":
Run this command in the terminal:
usrcalib 0 Hello world!
Set usrDevId0 to 123:
usrcalib 3 123
Print USRCALIB
Run usrcalib
to print the whole USRCALIB vector.
To print only one value, use usrcalib 3
. If USRCALIB value is a number, its value is stored in the retval
variable.
Examples
Set welcome message
Set the welcome message:
SC-felix#>usrcalib 0 Hello world
set usr calibration index 0 to Hello ? (y/n)
Print the whole USRCALIB vector:
SC-felix#>usrcalib
0 usrWelcome 'Hello'
1 usrDevName ''
2 usrDevSN ''
3 usrDevId0 0
4 usrDevId1 0
5 usrDevId2 0
6 usrDevId3 0
7 usrDevId4 0
8 usrDevId5 0
9 usrDevId6 0
10 usrDevId7 0
11 usrDevId8 0
12 usrDevId9 0
Set and read USRCALIB
If you execute usrcalib [id]
, the return value is actual value stored in the USRCALIB. This only works for integers types (usrDevId0-usrDevId9)
Set USRCALIB "usrDevId0" to value 1234:
SC-felix#>usrcalib 3 1234
set usr calibration index 3 to 1234 ? (y/n)
Read the value:
SC-felix#>usrcalib 3
3 usrDevId0 1234
SC-felix#>vr
List of available dynamic vars:
-> retval int32 : 1234
-> ticks uint32 : 2961034
-> debuglevel uint8 : 16
-> errlevel uint8 : 17
Total 4 entries
SC-felix#>