Overview   Project   Class   Tree   Index 
NXT C++ Bluetooth Library
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

NXT C++ Bluetooth Library
Class Connection

   in connection.h
Direct Known Subclasses:
Bluetooth, Nxt_network

class Connection

Abstract class for connections


Constructor Summary
virtual ~Connection()
          
 
Method Summary
 virtual void connect( unsigned int comport )
          Connect to the NXT using BT (Dummy method does nothing - is implemented in sub class)
 virtual void connect( unsigned int port, string ip_add, Server_settings& settings, string password = "" )
          Connect to the NXT using a network connection (Dummy method does nothing - is implemented in sub class)
 virtual void disconnect()= 0
          Disconnect from the NXT (must be implemented in sub class)
 virtual void flush()= 0
          Flush the input and output buffer (must be implemented in sub class)
 virtual Connection_type get_type()= 0
          Get the connection type (must be implemented in sub class)
 virtual void receive( unsigned char* buffer, unsigned int length )= 0
          Receive a byte string (must be implemented in sub class)
 virtual void send( unsigned char* buffer, unsigned int num_bytes )= 0
          Send a byte string (must be implemented in sub class)
 

Constructor Detail

~Connection

public virtual ~Connection();


Method Detail

connect

public virtual void connect( unsigned int comport );
Connect to the NXT using BT (Dummy method does nothing - is implemented in sub class)
Parameters:
comport - [specify the comport that is to used for the BT connection between the NXT and PC]

connect

public virtual void connect( unsigned int port, string ip_add, Server_settings& settings, string password = "" );
Connect to the NXT using a network connection (Dummy method does nothing - is implemented in sub class)
Parameters:
port - [specify the port that is to used for the network connection between the NXT and PC]
ip_add - [specify the IP-address]
settings - [used to retrive server settings]
password - [set the password]
See Also:
Server_settings_t

disconnect

public virtual void disconnect()= 0;
Disconnect from the NXT (must be implemented in sub class)

flush

public virtual void flush()= 0;
Flush the input and output buffer (must be implemented in sub class)

get_type

public virtual Connection_type get_type()= 0;
Get the connection type (must be implemented in sub class)
Returns:
the connection type

receive

public virtual void receive( unsigned char* buffer, unsigned int length )= 0;
Receive a byte string (must be implemented in sub class)
Parameters:
*buffer - [a pointer to a buffer that can hold the received bytes]
length - [the number of bytes to receive]

send

public virtual void send( unsigned char* buffer, unsigned int num_bytes )= 0;
Send a byte string (must be implemented in sub class)
Parameters:
*buffer - [a pointer to a buffer that can hold the bytes to send]
num_bytes - [the number of bytes to send]

 Overview   Project   Class   Tree   Index 
NXT C++ Bluetooth Library
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD