newtmgr conn¶
Manage newtmgr connection profiles.
Usage:¶
newtmgr conn [command] [flags]
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 the- connstringvalue depends on the connection- typevalue as follows:- serial and oic_serial: A quoted string with two, comma separated, - attribute=valuepairs. 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=valuepairs. 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 the- peer_idattribute.
- 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 - --nameflag 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 - --nameflag 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 a- peer_nameor- peer_idattribute in the connection profile.
 
- bhd and oic_bhd: The format is a quoted string of, comma separated, - attribute=valuepairs. 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 the- peer_addrand- peer_addr_typeattributes.
- 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 a- peer_addr_typevalue for the device address. Note: This value is only used when a peer name is not specified for the connection profile or with the- --nameflag 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 - --nameflag option.
- own_addr_type: (Optional) The address type of the BLE controller for the host that the newtmgr tool is running on. See the- peer_addr_typeattribute 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 - --nameflag 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 a- peer_nameor- peer_addrattribute 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. | 
