BAOS .net SDK  18.2.0
Public Member Functions | Protected Member Functions | List of all members
kdrive::baos::bindings::BaosConnection Class Reference

The BaosConnection is responsible for creating a TCP/IP stream or a FT 1.2 connection with the baos server More...

#include <BaosConnection.h>

Public Member Functions

 BaosConnection ()
 Constructor. More...
 
 ~BaosConnection ()
 Destructor cleans up unmanaged and managed resources. More...
 
void connectIp (System::String^remoteHost, unsigned char protocol, bool decodeProtocol)
 Connects to the remote IP BAOS device. More...
 
void connectIp (System::String^remoteHost)
 Connects to the remote IP BAOS device. More...
 
void connectIp (System::String^remoteHost, bool decodeProtocol)
 Connects to the remote IP BAOS device. More...
 
void connectIpByName (System::String^name)
 Enumerates the network and finds all available IP BAOS devices. More...
 
void connectIpByName (System::String^name, bool decodeProtocol)
 Enumerates the network and finds all available BAOS devices. More...
 
void connectIpNat (System::String^remoteHost, unsigned short port, unsigned char protocol, bool decodeProtocol)
 Connects to a remote IP BAOS device with NAT More...
 
void connectSerial (System::String^serialDeviceName, bool decodeProtocol)
 Connects to a Serial FT1.2 BAOS device More...
 
void disconnect ()
 Disconnects the connection More...
 
bool isConnected ()
 Returns true if the connection is available false otherwise More...
 
unmanaged::ConnectorPtr getConnector ()
 Returns the unmanaged (shared) connector pointer. More...
 

Protected Member Functions

 !BaosConnection ()
 Finalizer (non-deterministic destructor) cleans up unmanaged resources. More...
 

Detailed Description

The BaosConnection is responsible for creating a TCP/IP stream or a FT 1.2 connection with the baos server

The BaosConnection is responsible for creating a TCP/IP socket connection or FT 1.2 connection to the remote BAOS device. For IP it requires the IP Address of the device and for FT 1.2 Serial the name of the serial port. The BaosConnection is a wrapper around the Connector which is used throughout the baos rpc library.

It implements a connect and a disconnect signal. These signals are invoked when the stream connection is connector and disconnected respectively. Note: a stream connection can be auto-disconnected if the tcp/ip connection is terminated by the remote peer (baos device).

Note
It's recommended that you release the connection with disconnect or Dispose if you do not more need it.
// C# sample
BaosConnection baosConnection = null;
try
{
BaosConnection baosConnection = new StreamConnection();
baosConnection.connectIpByName("Baos-Sample");
// ...
baosConnection.disconnect();
}
catch (kdrive.KdriveException exception)
{
Console.WriteLine(exception.Message);
}
finally
{
if (baosConnection != null)
{
baosConnection.Dispose();
}
}

DEPRECATED! Use ScopedBaosConnection instead. This class calls only the functions from BaosConnection.

Constructor & Destructor Documentation

kdrive::baos::bindings::BaosConnection::BaosConnection ( )

Constructor.

There are no parameters.

kdrive::baos::bindings::BaosConnection::~BaosConnection ( )

Destructor cleans up unmanaged and managed resources.

kdrive::baos::bindings::BaosConnection::!BaosConnection ( )
protected

Finalizer (non-deterministic destructor) cleans up unmanaged resources.

Member Function Documentation

void kdrive::baos::bindings::BaosConnection::connectIp ( System::String^  remoteHost,
unsigned char  protocol,
bool  decodeProtocol 
)

Connects to the remote IP BAOS device.

Parameters
remoteHostThe remote is the IP Address of the device.
protocolThe protocol is the BAOS protocol version:
decodeProtocolIndicates whether the packet trace is enabled, if true use in conjunction with the logger
Note
This function does perform enumeration, if the protocol version is unknown, to determine the protocol version
void kdrive::baos::bindings::BaosConnection::connectIp ( System::String^  remoteHost)

Connects to the remote IP BAOS device.

Parameters
remoteHostRemote Host is the IP Address of the device. Tip: you can find this address with the NetnNode Client Application when you select Open Port - Knx via Ip Tunnelling.
Note
This function performs device enumeration to determine the protocol version
void kdrive::baos::bindings::BaosConnection::connectIp ( System::String^  remoteHost,
bool  decodeProtocol 
)

Connects to the remote IP BAOS device.

Parameters
remoteHostThe remote is the IP Address of the device.
decodeProtocolIndicates whether the packet trace is enabled, if true use in conjunction with the logger
Note
This function does perform enumeration, if the protocol version is unknown, to determine the protocol version
void kdrive::baos::bindings::BaosConnection::connectIpByName ( System::String^  name)

Enumerates the network and finds all available IP BAOS devices.

Selects the device that matches the specified name and opens a connection to it.

Parameters
nameThe device friendly name. (Which you can set with the ETS)

This auto-select the BAOS protocol.

void kdrive::baos::bindings::BaosConnection::connectIpByName ( System::String^  name,
bool  decodeProtocol 
)

Enumerates the network and finds all available BAOS devices.

Selects the device that matches the specified name and opens a connection to it.

Parameters
nameThe device friendly name. (Which you can set with the ETS)
decodeProtocolIndicates whether the packet trace is enabled, if true use in conjunction with the logger

This auto-select the BAOS protocol.

void kdrive::baos::bindings::BaosConnection::connectIpNat ( System::String^  remoteHost,
unsigned short  port,
unsigned char  protocol,
bool  decodeProtocol 
)

Connects to a remote IP BAOS device with NAT

Parameters
remoteHostRemote Host is the IP Address of the device. Tip: you can find this address with the NetnNode Client Application when you select Open Port - Knx via Ip Tunnelling.
portThe port associated with the connection. The default port of the BAOS TCP protocol is 12004
protocolThe protocol is the BAOS protocol version:
decodeProtocolIndicates whether the packet trace is enabled, if true use in conjunction with the logger

This function does perform enumeration, if the protocol version is unknown, to determine the protocol version

void kdrive::baos::bindings::BaosConnection::connectSerial ( System::String^  serialDeviceName,
bool  decodeProtocol 
)

Connects to a Serial FT1.2 BAOS device

Parameters
serialDeviceNameSerialDeviceName is the platform specific device name, e.g. COM1 or /dev/ttyS0
decodeProtocolIndicates whether the packet trace is enabled, if true use in conjunction with the logger
void kdrive::baos::bindings::BaosConnection::disconnect ( )

Disconnects the connection

unmanaged::ConnectorPtr kdrive::baos::bindings::BaosConnection::getConnector ( )

Returns the unmanaged (shared) connector pointer.

Used by the managed C++ implementation

bool kdrive::baos::bindings::BaosConnection::isConnected ( )

Returns true if the connection is available false otherwise


The documentation for this class was generated from the following file: