MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
Functions
mip::platform Namespace Reference

Functions

std::unique_ptr< microstrain::ConnectioncreateConnectionFromInterfaceName (std::string interface_name, uint32_t parameter)
 Creates a connection object given the interface name and a parameter. More...
 
bool isSerialInterfaceName (const std::string_view interface_name)
 Determines if the name corresponds to a serial port device. More...
 
bool isNetworkInterfaceName (std::string_view interface_name)
 Determines if the name corresponds to a URL or IP address. More...
 

Function Documentation

◆ createConnectionFromInterfaceName()

std::unique_ptr< microstrain::Connection > mip::platform::createConnectionFromInterfaceName ( std::string  interface_name,
uint32_t  parameter 
)

Creates a connection object given the interface name and a parameter.

Note
This only creates the connection object; it does not open it. Call connection->connect() to open it.
Parameters
interfaceNameThis is the interface name - COM* (windows) or /dev/tty* (Linux) for a serial port or anything else for a TCP socket.
parameterFor serial ports, this is the baud rate. For TCP sockets, this is the port number.

◆ isNetworkInterfaceName()

bool mip::platform::isNetworkInterfaceName ( std::string_view  interface_name)

Determines if the name corresponds to a URL or IP address.

Parameters
interface_name
Returns
True if the interface could be a URL or IP address. False otherwise.

◆ isSerialInterfaceName()

bool mip::platform::isSerialInterfaceName ( const std::string_view  interface_name)

Determines if the name corresponds to a serial port device.

Parameters
interface_name
Returns
True if the interface is likely a serial port. False otherwise.