ECRobot C++ API for LEGO MINDSTORMS NXT  1.0.10
ecrobot::BTConnection Class Reference

Bluetooth connection helper class. More...

#include <BTConnection.h>

List of all members.

Public Member Functions

 BTConnection (Bluetooth &bt, Lcd &lcd, Nxt &nxt)
 Constructor.
SINT connect (const CHAR *passkey, const CHAR *devname=0)
 Establish Bluetooth connection as a slave device and display the status in the LCD.
SINT connect (const CHAR *passkey, const U8 address[7])
 Establish Bluetooth connection as a master device and display the status in the LCD.

Detailed Description

Bluetooth connection helper class.


Constructor & Destructor Documentation

ecrobot::BTConnection::BTConnection ( Bluetooth bt,
Lcd lcd,
Nxt nxt 
) [inline]

Constructor.

Parameters:
btReference of a Bluetooth object.
lcdReference of a LCD object.
nxtReference of a NXT object.
Returns:
-

Member Function Documentation

SINT ecrobot::BTConnection::connect ( const CHAR *  passkey,
const CHAR *  devname = 0 
)

Establish Bluetooth connection as a slave device and display the status in the LCD.

Note that the connection process can be canceled by keep pushing ENTR button on the NXT for longer than 0.5sec.

Parameters:
passkeyBluetooth passkey (up to 16 characters. I.e. "1234")
devnameBluetooth user freindly device name (optional parameter. e.g. "NXT")
Returns:
1(connected)/0(canceled)/-1(failed)
SINT ecrobot::BTConnection::connect ( const CHAR *  passkey,
const U8  address[7] 
)

Establish Bluetooth connection as a master device and display the status in the LCD.

Note that the connection process can be canceled by keep pushing ENTR button on the NXT for longer than 0.5sec.

Parameters:
passkeyBluetooth passkey (up to 16 characters. I.e. "1234")
addressBluetooth Device Address to be connected (7bytes hex array data)
Returns:
1(connected)/0(canceled)/-1(failed)

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Friends Defines