|
| 1 | +deviceparameter(1) -- get/set individual device parameters, get all parameters. |
| 2 | +============================================= |
| 3 | + |
| 4 | +## SYNOPSIS |
| 5 | + |
| 6 | +`deviceparameter` ...<br> |
| 7 | +`deviceparameter` `-a` _addr_ `-g` _group_ `-d` _dest_ ...<br> |
| 8 | +`deviceparameter` `-p` _parameter_ ...<br> |
| 9 | +`deviceparameter` `-p` _parameter_ `-v` _value_ ...<br> |
| 10 | +`deviceparameter` `-a` _addr_ `-g` _group_ `-d` _dest_ `-p` _parameter_ ...<br> |
| 11 | +`deviceparameter` `-a` _addr_ `-g` _group_ `-d` _dest_ `-p` _parameter_ `-v` _value_ ...<br> |
| 12 | +`deviceparameter` `--help`<br> |
| 13 | + |
| 14 | +## DESCRIPTION |
| 15 | + |
| 16 | +**deviceparameter** configures or queries device parameters from Mist nodes |
| 17 | +using the deviceparameters protocol: <https://github.com/thinnect/tos-devparam>. |
| 18 | + |
| 19 | +In its default mode, `deviceparameter` will sequentially query all parameters |
| 20 | +from the locally connected device. It is possible to query individual parameters |
| 21 | +and set their values one by one with the `-p` or `--parameter` option. |
| 22 | + |
| 23 | +It is possible to query and configure remote devices by specifying the source |
| 24 | +and destination addresses. |
| 25 | + |
| 26 | +Internally the deviceparameters protocol uses length and a byte array to transmit |
| 27 | +values. In order to correctly send an integer value, the type of the integer |
| 28 | +needs to be known. A typed value parameter can be specified with `--u8`, `--u16`, |
| 29 | +`--u32`, `--u64`, `--i8`, `--i16`, `--i32` or `--i64`. The `-v` or `--value` |
| 30 | +option will parse the input as a raw hex string, converting it directly to |
| 31 | +binary. ASCII strings can be specified with the `--str` option. |
| 32 | + |
| 33 | +The `--timeout` and `--retries` options change how long a single parameter is |
| 34 | +tried before skipping to the next one or giving up. |
| 35 | + |
| 36 | +## OPTIONS |
| 37 | + |
| 38 | +Options control connection parameters: |
| 39 | + |
| 40 | + * `connection`: |
| 41 | + This positional argument is used to specify the connection string for the |
| 42 | + mist network connection. Use sf@HOST:PORT for a SerialForwarder connection or |
| 43 | + serial@PORT:BAUD for a direct serial port. |
| 44 | + The default is sf@localhost:9002. |
| 45 | + |
| 46 | + * `-g`, `--group`: |
| 47 | + option is used to set the ActiveMessage group. The default is 22, |
| 48 | +the value is parsed as a hex string (0x22). |
| 49 | + |
| 50 | + * `-a`, `--address`: |
| 51 | + option is used to set the source ActiveMessage address used for remote |
| 52 | + requests. The default is 5678, the value is parsed as a hex string (0x5678). |
| 53 | + |
| 54 | + * `-d`, `--destination`: |
| 55 | + option is used to set the destination ActiveMessage address and switch over to |
| 56 | + a remote request. The value is parsed as a hex string. |
| 57 | + |
| 58 | +Options for controlling task processing timings: |
| 59 | + |
| 60 | + * `--timeout`: |
| 61 | + The time spent waiting for a response for a configuration action or query. |
| 62 | + Value is in seconds, default is 30. |
| 63 | + |
| 64 | + * `--retries`: |
| 65 | + The number of attempts made to configure or query a single parameter during |
| 66 | + one operation. The default is 2. |
| 67 | + |
| 68 | +Options for setting the value: |
| 69 | + |
| 70 | + * `-v`, `--value`: |
| 71 | + The is parsed as hex strings and converted to binary. |
| 72 | + The value must have a length that is divisible by 2 and only contain symbols |
| 73 | + [0-9abcdef]. Value is not case sensitive. |
| 74 | + * `--str`: |
| 75 | + The value is converted to binary using the ASCII encoding. |
| 76 | + * `--u8`: |
| 77 | + The value is converted to an unsigned 8-bit big-endian integer. |
| 78 | + * `--u16`: |
| 79 | + The value is converted to an unsigned 16-bit big-endian integer. |
| 80 | + * `--u32`: |
| 81 | + The value is converted to an unsigned 32-bit big-endian integer. |
| 82 | + * `--u64`: |
| 83 | + The value is converted to an unsigned 64-bit big-endian integer. |
| 84 | + * `--i8`: |
| 85 | + The value is converted to a signed 8-bit big-endian integer. |
| 86 | + * `--i16`: |
| 87 | + The value is converted to a signed 16-bit big-endian integer. |
| 88 | + * `--i32`: |
| 89 | + The value is converted to a signed 32-bit big-endian integer. |
| 90 | + * `--i64`: |
| 91 | + The value is converted to a signed 64-bit big-endian integer. |
| 92 | + |
| 93 | +Miscellaneous options: |
| 94 | + |
| 95 | + * `-Q`, `--quiet`: |
| 96 | + Turn on quite mode, only parameter values are printed. |
| 97 | + |
| 98 | + * `-D`, `--debug`: |
| 99 | + Turn on debug mode, can be specified multiple times to increase verbosity. |
| 100 | + |
| 101 | + * `-V`, `--version`: |
| 102 | + Show the application version. |
| 103 | + |
| 104 | +## EXAMPLES |
| 105 | + |
| 106 | +Query all parameters of the locally connected device: |
| 107 | + |
| 108 | + $ deviceparameter |
| 109 | + 2019/01/28 17:13:36.83 Connected with sf@localhost:9002 |
| 110 | + 2019/01/28 17:13:36.83 Get parameter list: |
| 111 | + 2019/01/28 17:13:36.84 0: tos_node_id 1234 |
| 112 | + 2019/01/28 17:13:38.86 1: radio_channel 26 |
| 113 | + ... |
| 114 | + 2019/01/28 17:13:50.052982 21: uptime 18073646 |
| 115 | + 2019/01/28 17:13:50.210797 Done |
| 116 | + |
| 117 | +Set the radio channel on the locally connected device: |
| 118 | + |
| 119 | + $ deviceparameter -p radio_channel --u8 25 |
| 120 | + 2019/01/28 17:16:21.00 Connected with sf@localhost:9002 |
| 121 | + 2019/01/28 17:16:21.00 Set radio_channel to 0x19 |
| 122 | + 2019/01/28 17:16:21.01 radio_channel = 25 |
| 123 | + 2019/01/28 17:16:21.16 Done |
| 124 | + |
| 125 | +Set the name parameter on a remote device: |
| 126 | + |
| 127 | + $ deviceparameter -a 1234 -d 6789 -p name --str FooBar |
| 128 | + 2019/01/28 17:16:22.01 Connected with sf@localhost:9002 |
| 129 | + 2019/01/28 17:16:22.01 Set name to 0x466F6F426172 |
| 130 | + 2019/01/28 17:16:32.02 name = FooBar |
| 131 | + 2019/01/28 17:16:32.17 Done |
| 132 | + |
| 133 | +## ENVIRONMENT |
| 134 | + |
| 135 | +**deviceparameter** currently does not take any configuration from the environment. |
| 136 | + |
| 137 | +## BUGS |
| 138 | + |
| 139 | +**deviceparameter** is written in go and an issue tracker is available at |
| 140 | +<https://github.com/thinnect/go-devparam/issues>. |
| 141 | + |
| 142 | +## COPYRIGHT |
| 143 | + |
| 144 | +**deviceparameter** is Copyright (C) 2019 Thinnect Inc. <http://www.thinnect.com> |
| 145 | + |
| 146 | +## SEE ALSO |
| 147 | + |
| 148 | +deviceparameters(1) |
0 commit comments