|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class to interact with the filesystem on the NXT
Constructor Summary | |
private |
Filesystem( const Filesystem& p )
To prevent copy - to lazy to create a copy constructor |
|
Filesystem( Connection* connection )
|
|
~Filesystem()
|
Method Summary | |
void |
close_file( Nxt_file& file )
close a file on the nxt |
unsigned int |
create_file_list( string wild_card )
Create a file list |
void |
delete_file( string file_name, bool reply = false )
Delete a file on the NXT |
void |
delete_file( Nxt_file& file, bool reply = false )
Delete a file on the NXT |
void |
delete_flash()
Delete the flash memory - all user programs and data |
void |
download_file( string pc_name, string nxt_name )
Download a file from the NXT to the PC |
Nxt_file |
get_file_list_element( unsigned int idx )
Get a element from the file list |
unsigned int |
get_file_list_size()
Get the number of files in the file list |
unsigned int |
get_free_flash()
Get remaining flash memory |
Nxt_file |
open_file( string file_name, File_mode mode, unsigned int file_size = 0 )
Open or create a file on the NXT |
unsigned int |
read_file( Nxt_file& file, unsigned char* buffer, unsigned int num_bytes )
read a byte string from a file |
void |
upload_file( string pc_name, string nxt_name )
Upload a file from the PC to the NXT |
unsigned int |
write_file( Nxt_file& file, unsigned char* buffer, unsigned int num_bytes )
write a byte string to a file |
Constructor Detail |
private Filesystem( const Filesystem& p );
public Filesystem( Connection* connection );
*connection
- [attach a connection]public ~Filesystem();
Method Detail |
public void close_file( Nxt_file& file );
&file
- [Nxt_file struct of the file to close]public unsigned int create_file_list( string wild_card );
wild_card
- [search cretia]
public void delete_file( string file_name, bool reply = false );
file_name
- [the name of the file to delete]
reply
- [true = require reply from NXT; false = no reply from NXT]public void delete_file( Nxt_file& file, bool reply = false );
file
- [a Nxt_file struct of the file to close]
reply
- [true = require reply from NXT; false = no reply from NXT]public void delete_flash();
public void download_file( string pc_name, string nxt_name );
pc_name
- [path to the download destination (example: c:\\download.txt)]
nxt_name
- [name of the file on the NXT (example: "program.rxe")]public Nxt_file get_file_list_element( unsigned int idx );
idx
- [the element to return ( 0= first element in the list)]public unsigned int get_file_list_size();
public unsigned int get_free_flash();
public Nxt_file open_file( string file_name, File_mode mode, unsigned int file_size = 0 );
file_name
- [the name of the file to create or open]
mode
- [use the FILE_MODE enumeration how the file should be created or opended]
file_size
- [the size of the file in bytes (will be ignored in append and read mode)]public unsigned int read_file( Nxt_file& file, unsigned char* buffer, unsigned int num_bytes );
&file
- [Nxt_file struct of the file to read data from]
*buffer
- [a pointer to a buffer that can hold the read bytes]
no_bytes
- [bytes to read]public void upload_file( string pc_name, string nxt_name );
pc_name
- [path to the PC file to upload (example: c:\\upload.txt)]
nxt_name
- [name of the file on the NXT (example: "data.txt")]public unsigned int write_file( Nxt_file& file, unsigned char* buffer, unsigned int num_bytes );
&file
- [Nxt_file struct of the file to write data to]
*buffer
- [a pointer to a buffer that can hold the bytes to write]
no_bytes
- [bytes to write]
|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |