|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class to get/set brick name, get/set battery level, R/W to mailbox, start/stop programs, play sound, stop sound ect...
Constructor Summary | |
Brick( Connection* connection )
|
Method Summary | |
void |
beep( unsigned int time, bool reply = false )
Make the NXT beep |
unsigned int |
get_battery_level()
Get the battery level |
string |
get_bt_address()
Get the Bluetooth address of the NXT |
string |
get_current_program()
Get the current executing program |
void |
get_device_info( Device_info& info )
Retrieve BT-address, brick name and free flash memory with a single call |
void |
get_device_version( Device_version& version )
Retrieve Firmware version and Protrocol version with a single call |
string |
get_firmware_version()
Get the firmware version currently running on the NXT |
unsigned int |
get_flash_memory()
Get free flash memory |
string |
get_name()
Get the name of the NXT |
string |
get_protocol_version()
Get the protocol version currently running on the NXT |
void |
keep_alive( bool reply = false )
Keep the NXT alive |
void |
play_soundfile( string file, bool loop, bool reply = false )
Play a soundfile from the NXT's flash |
void |
play_tone( unsigned int freq, unsigned int time, bool reply = false )
Make the NXT play a tone |
string |
read_msg( int inbox, bool remove )
Read a message from the NXT's mailbox |
void |
set_name( string name, bool reply = false )
Set the name of the NXT |
void |
start_program( string file, bool reply = false )
Start executing a program from the NXT's flash |
void |
stop_programs( bool reply = false )
Stop executing program |
void |
stop_soundplayback( bool reply = false )
Stop all sound playback |
void |
write_msg( string message, int inbox, bool reply = false )
Write a message to the NXT's mailbox |
Constructor Detail |
public Brick( Connection* connection );
*connection
- [attach a connection]Method Detail |
public void beep( unsigned int time, bool reply = false );
time
- [duration in ms]
reply
- [true = require reply from NXT; false = no reply from NXT]public unsigned int get_battery_level();
public string get_bt_address();
public string get_current_program();
public void get_device_info( Device_info& info );
info
- [used to store the return values]public void get_device_version( Device_version& version );
version
- [used to store the return values]public string get_firmware_version();
public unsigned int get_flash_memory();
public string get_name();
public string get_protocol_version();
public void keep_alive( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public void play_soundfile( string file, bool loop, bool reply = false );
file
- [file name *.rso (sound file) (maximum 19 characters)]
loop
- [true = loop sound file indefinitely; false = play file once]
reply
- [true = require reply from NXT; false = no reply from NXT]public void play_tone( unsigned int freq, unsigned int time, bool reply = false );
freq
- [frequency in Hz (200-14000 Hz)]
time
- [duration in ms]
reply
- [true = require reply from NXT; false = no reply from NXT]public string read_msg( int inbox, bool remove );
inbox
- [specifies the inbox on the NXT(0-9)]
remove
- [true = remove the string from the inbox; false = leave the string in the inbox]public void set_name( string name, bool reply = false );
name
- [new name of the NXT (maximum 15 characters)]
reply
- [true = require reply from NXT; false = no reply from NXT]public void start_program( string file, bool reply = false );
file
- [file name *.rxe (downloaded program), *.rpg (On brick programs), *.rtm (Try me programs) (maximum 19 characters)]
reply
- [true = require reply from NXT; false = no reply from NXT]public void stop_programs( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public void stop_soundplayback( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public void write_msg( string message, int inbox, bool reply = false );
message
- [string to be send to the inbox (maximum 57 characters)]
inbox
- [specifies the inbox on the NXT(0-9)]
reply
- [true = require reply from NXT; false = no reply from NXT]
|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |