newtmgr conn¶
Manage newtmgr connection profiles.
Global Flags:¶
-c, --conn string connection profile to use
-l, --loglevel string log level to use (default "info")
--name string name of target BLE device; overrides profile setting
-t, --timeout float timeout in seconds (partial seconds allowed) (default 10)
-r, --tries int total number of tries in case of timeout (default 1)
Description¶
The conn command provides subcommands to add, delete, and view connection profiles. A connection profile specifies information on how to connect and communicate with a remote device. Newtmgr commands use the information from a connection profile to send newtmgr requests to remote devices.
Add Sub-Command¶
The newtmgr conn add <conn_profile> <var-name=value ...>
command creates a connection profile named
conn_profile
. The command requires the conn_profile
name and a list of, space separated,
var-name=value pairs.
The var-names are: type
, and connstring
. The valid values for each var-name parameter are:
type
: The connection type. Valid values are:serial: Newtmgr protocol over a serial connection.
oic_serial: OIC protocol over a serial connection.
udp:newtmgr protocol over UDP.
oic_udp: OIC protocol over UDP.
ble newtmgr protocol over BLE. This type uses native OS BLE support
oic_ble: OIC protocol over BLE. This type uses native OS BLE support.
bhd: newtmgr protocol over BLE. This type uses the blehostd implemenation.
oic_bhd: OIC protocol over BLE. This type uses the blehostd implementation.
Note: newtmgr does not support BLE on Windows.
connstring
: The physical or virtual address for the connection. The format of theconnstring
value depends on the connectiontype
value as follows:serial and oic_serial: A quoted string with two, comma separated,
attribute=value
pairs. The attribute names and value format for each attribute are:dev
: (Required) The name of the serial port to use. For example: /dev/ttyUSB0 on a Linux platform or COM1 on a Windows platform .baud
: (Optional) A number that specifies the buad rate for the connection. Defaults to 115200 if the attribute is not specified.
Example:
connstring="dev=/dev/ttyUSB0,baud=9600"
Note: The 1.0 format, which only requires a serial port name, is still supported. For example,connstring=/dev/ttyUSB0
.udp and oic_udp: The peer ip address and port number that the newtmgr or oicmgr on the remote device is listening on. It must be of the form: [<ip-address>]:<port-number>.
ble and oic_ble: The format is a quoted string of, comma separated,
attribute=value
pairs. The attribute names and the value for each attribute are:peer_name
: A string that specifies the name the peer BLE device advertises. Note: If this attribute is specified, you do not need to specify a value for thepeer_id
attribute.peer_id
: The peer BLE device address or UUID. The format depends on the OS that the newtmgr tool is running on:Linux: 6 byte BLE address. Each byte must be a hexidecimal number and separated by a colon.
MacOS: 128 bit UUID.
Note: This value is only used when a peer name is not specified for the connection profile or with the
--name
flag option.ctlr_name
: (Optional) Controller name. This value depends on the OS that the newtmgr tool is running on.
Notes:
You must specify
connstring=" "
if you do not specify any attribute values.You can use the
--name
flag to specify a device name when you issue a newtmgr command that communicates with a BLE device. You can use this flag to override or in lieu of specifying apeer_name
orpeer_id
attribute in the connection profile.
bhd and oic_bhd: The format is a quoted string of, comma separated,
attribute=value
pairs. The attribute names and the value format for each attribute are:peer_name
: A string that specifies the name the peer BLE device advertises. Note: If this attribute is specified, you do not need to specify values for thepeer_addr
andpeer_addr_type
attributes.peer_addr
: A 6 byte peer BLE device address. Each byte must be a hexidecimal number and separated by a colon. You must also specify apeer_addr_type
value for the device address. Note: This value is only used when a peer name is not specified for the connection profile or with the--name
flag option.peer_addr_type
: The peer address type. Valid values are:public: Public address assigned by the manufacturer.
random: Static random address.
rpa_pub: Resolvable Private Address with public identity address.
rpa_rnd: Resolvable Private Address with static random identity address.
Note: This value is only used when a peer name is not specified for the connection profile or with the
--name
flag option.own_addr_type
: (Optional) The address type of the BLE controller for the host that the newtmgr tool is running on. See thepeer_addr_type
attribute for valid values. Defaults to random.ctlr_path
: The path of the port that is used to connect the BLE controller to the host that the newtmgr tool is running on.
Note: You can use the
--name
flag to specify a device name when you issue a newtmgr command that communicates with a BLE device. You can use this flag to override or in lieu of specifying apeer_name
orpeer_addr
attribute in the connection profile.
Delete Sub-Command¶
The newtmgr conn delete <conn_profile>
command deletes the conn_profile
connection profile.
Show Sub-Command¶
The newtmgr conn show [conn_profile]
command shows the information for the conn_profile
connection profile.
It shows information for all the connection profiles if conn_profile
is not specified.
Examples¶
Sub-command |
Usage |
Explanation |
---|---|---|
add |
|
Creates a connection profile, named |
add |
|
Creates a connection profile, named |
add |
|
Creates a connection profile, named |
add |
|
Creates a connection profile, named |
add |
|
Creates a connection profile, named |
add |
|
Creates a connection profile, named |
delete |
|
Deletes the connection profile named |
delete |
|
Deletes the connection profile named |
show |
|
Displays the information for the |
show |
|
Displays the information for all connection profiles. |