Comm::NXTComm Class Reference

#include <comm.h>

List of all members.

Public Member Functions

 NXTComm ()
bool Open ()
 Initiates the NXT connection.
bool OpenBT ()
 Initiates the NXT connection through Bluetooth.
bool OpenBT (char *name)
 Initiates a specific NXT connection through Bluetooth.
void Close ()
 Closes the NXT connection.
void SendDirectCommand (ViBoolean response, ViByte *dc_buf, int dc_buf_size, ViByte *re_buf, int re_buf_size)
 Sends a direct command to the NXT.
double GetProtocolVersion ()
double GetFirmwareVersion ()
std::string GetName ()
bool SetName (char *name)
double GetAvailableFlash ()
 Returns the amount of flash memory left.
NXTFile GetNXTFile (std::string filename, bool &isFatal)
 Retrieves a specified file into an NXTFile.
NXTFileIterator GetFileIterator (std::string pattern, bool &isFatal)
 Searches for files on the NXT and stores the results in an NXTFileIterator.
void destroyFileIterator (NXTFileIterator &iter)
 Destroys an NXTFileIterator.
void destroyFile (NXTFile &file)
 Destroys an NXTFile.
NXTModuleIterator GetModuleIterator (std::string pattern, int &statusCode)
 Searches for modules on the NXT and stores the results in an NXTModuleIterator.
void destroyModuleIterator (NXTModuleIterator &iter)
 Destroys an NXTModuleIterator.
NXTModule GetModule (std::string moduleName, int moduleID, int moduleSize, int ioMapSize, int &statCode)
 Retrieves a specified module into an NXTModule.
void destroyModule (NXTModule &module)
 Destroys an NXTModule.

Public Attributes

nFANTOM100::tStatus status
nFANTOM100::iNXTIterator * nxtIteratorPtr
nFANTOM100::iNXT * nxtPtr
nFANTOM100::iFileIterator * fileIteratorPtr


Detailed Description

Definition at line 193 of file comm.h.


Constructor & Destructor Documentation

Comm::NXTComm::NXTComm (  )  [inline]

Definition at line 202 of file comm.h.

References fileIteratorPtr, nxtIteratorPtr, and nxtPtr.


Member Function Documentation

bool Comm::NXTComm::Open (  ) 

Initiates the NXT connection.

Returns true if it completed without error. Returns false if it failed. You should not continue to use the interface functions if this happens. Refer to example.cpp for info on how to properly handle this.

bool Comm::NXTComm::OpenBT (  ) 

Initiates the NXT connection through Bluetooth.

Returns true if it completed without error. Returns false if it failed. You should not continue to use the interface functions if this happens. Refer to example.cpp for info on how to properly handle this.

bool Comm::NXTComm::OpenBT ( char *  name  ) 

Initiates a specific NXT connection through Bluetooth.

Returns true if it completed without error. Returns false if it failed. You should not continue to use the interface functions if this happens. Refer to example.cpp for info on how to properly handle this.

void Comm::NXTComm::Close (  ) 

Closes the NXT connection.

void Comm::NXTComm::SendDirectCommand ( ViBoolean  response,
ViByte *  dc_buf,
int  dc_buf_size,
ViByte *  re_buf,
int  re_buf_size 
)

Sends a direct command to the NXT.

This low-level function is used to send commands to the NXT - just like all the other functions do. The only difference is that this function is harder to use, but in turn, provides much more control of the NXT. For a reference about direct commands, look in the PDF titled Appendix 2.

Parameters:
response Whether or not you want to recieve a response from the direct command.
dc_buf The buffer that contains the direct command.
dc_buf_size The number of bytes in the direct command buffer.
re_buf The buffer that will contain the response to the direct command if specified.
re_buf_size The number of bytes in the response buffer.

double Comm::NXTComm::GetProtocolVersion (  ) 

double Comm::NXTComm::GetFirmwareVersion (  ) 

std::string Comm::NXTComm::GetName (  ) 

bool Comm::NXTComm::SetName ( char *  name  ) 

double Comm::NXTComm::GetAvailableFlash (  ) 

Returns the amount of flash memory left.

NXTFile Comm::NXTComm::GetNXTFile ( std::string  filename,
bool &  isFatal 
)

Retrieves a specified file into an NXTFile.

NXTFileIterator Comm::NXTComm::GetFileIterator ( std::string  pattern,
bool &  isFatal 
)

Searches for files on the NXT and stores the results in an NXTFileIterator.

void Comm::NXTComm::destroyFileIterator ( NXTFileIterator &  iter  ) 

Destroys an NXTFileIterator.

void Comm::NXTComm::destroyFile ( NXTFile &  file  ) 

Destroys an NXTFile.

NXTModuleIterator Comm::NXTComm::GetModuleIterator ( std::string  pattern,
int &  statusCode 
)

Searches for modules on the NXT and stores the results in an NXTModuleIterator.

void Comm::NXTComm::destroyModuleIterator ( NXTModuleIterator &  iter  ) 

Destroys an NXTModuleIterator.

NXTModule Comm::NXTComm::GetModule ( std::string  moduleName,
int  moduleID,
int  moduleSize,
int  ioMapSize,
int &  statCode 
)

Retrieves a specified module into an NXTModule.

void Comm::NXTComm::destroyModule ( NXTModule &  module  ) 

Destroys an NXTModule.


Member Data Documentation

nFANTOM100::tStatus Comm::NXTComm::status

Definition at line 196 of file comm.h.

nFANTOM100::iNXTIterator* Comm::NXTComm::nxtIteratorPtr

Definition at line 197 of file comm.h.

Referenced by NXTComm().

nFANTOM100::iNXT* Comm::NXTComm::nxtPtr

Definition at line 198 of file comm.h.

Referenced by NXTComm().

nFANTOM100::iFileIterator* Comm::NXTComm::fileIteratorPtr

Definition at line 200 of file comm.h.

Referenced by NXTComm().


The documentation for this class was generated from the following file:
SourceForge.net Logo