Skip to main content

parse_target

Function parse_target 

Source
pub fn parse_target(s: &str) -> Result<Target, String>
Expand description

Parse a target string into a Target.

Supported formats:

  • dnet:instance: a routed device (e.g., 2:1234)
  • dnet:0xHEX: a routed station by its MAC on that network (e.g., 2:0x05 for MS/TP station 5)
  • ip or ip:port: a direct BIP MAC (e.g., 192.168.1.100 or 192.168.1.100:47808)
  • six hex octets, 02:00:00:00:00:01, 02-00-00-00-00-01 or 020000000001: a 6-octet MAC as written, such as a BACnet/SC VMAC
  • bip6:instance or bip6:0xHHHHHH: a B/IPv6 VMAC, a device instance’s (Clause H.7.2) or any three octets, as format_vmac_text prints them
  • [ipv6] or [ipv6]:port: a B/IPv6 address (port 47808 when absent), whose VMAC bip6_vmac finds
  • mstp:station or mstp:0xHH: an MS/TP station’s 1-octet MAC, 0 to 254
  • instance: a device instance number (e.g., 1234)