#include <iNXT.h>
Public Types | |
enum | tBuffer { kBufferStandard, kBufferHighSpeed } |
Enumeration of buffer types on the NXT. | |
Public Methods | |
virtual iFile * | createFile (ViConstString fileName, tStatus &status)=0 |
Creates a file object for the file with the specified name on this NXT. More... | |
virtual void | destroyFile (iFile *filePtr)=0 |
Destroys the specified file object. More... | |
virtual iFileIterator * | createFileIterator (ViConstString fileNamePattern, tStatus &status)=0 |
Creates an iterator to the files on this NXT. More... | |
virtual void | destroyFileIterator (iFileIterator *fileIteratorPtr)=0 |
Destroys the specified file iterator. More... | |
virtual iModule * | createModule (ViConstString moduleName, ViUInt32 moduleID, ViUInt32 moduleSizeInBytes, ViUInt32 ioMapSizeInBytes, tStatus &status)=0 |
Creates a module object for the module with the specified name on this NXT. More... | |
virtual void | destroyModule (iModule *modulePtr)=0 |
Destroys the specified module object. More... | |
virtual iModuleIterator * | createModuleIterator (ViConstString moduleNamePattern, tStatus &status)=0 |
Creates an iterator to the modules on this NXT. More... | |
virtual void | destroyModuleIterator (iModuleIterator *moduleIteratorPtr)=0 |
Destroys the specified module iterator. More... | |
virtual void | getFirmwareVersion (ViUInt8 &protocolVersionMajorRef, ViUInt8 &protocolVersionMinorRef, ViUInt8 &firmwareVersionMajorRef, ViUInt8 &firmwareVersionMinorRef, tStatus &status)=0 |
Retrieves the firmware version of this NXT. More... | |
virtual ViUInt32 | sendDirectCommand (ViBoolean requireResponse, const ViByte commandBufferPtr[], ViUInt32 commandBufferSizeInBytes, ViPBuf responseBufferPtr, ViUInt32 responseBufferSizeInBytes, tStatus &status)=0 |
Sends the specified direct command to this NXT. More... | |
virtual void | downloadFirmware (const ViByte firmwareBufferPtr[], ViUInt32 firmwareBufferSizeInBytes, tStatus &status)=0 |
Downloads firmware to this NXT. More... | |
virtual ViUInt32 | write (const ViByte bufferPtr[], ViUInt32 numberOfBytes, tStatus &status)=0 |
Writes, in a generic fashion, to this NXT. More... | |
virtual ViUInt32 | read (ViPBuf bufferPtr, ViUInt32 numberOfBytes, tStatus &status)=0 |
Reads, in a generic fashion, from this NXT. More... | |
virtual void | bootIntoFirmwareDownloadMode (tStatus &status)=0 |
Reboots this NXT into firmware-download mode. More... | |
virtual void | setName (ViConstString newName, tStatus &status)=0 |
Sets the name of this NXT. More... | |
virtual void | getDeviceInfo (ViChar name[], ViByte bluetoothAddress[], ViUInt8 signalStrength[], ViUInt32 &availableFlash, tStatus &status)=0 |
Retrieves basic information about this NXT. More... | |
virtual void | eraseUserFlash (tStatus &status)=0 |
Erases all files from this NXT, leaving only the firmware. More... | |
virtual ViUInt32 | pollAvailableLength (tBuffer bufferSelector, tStatus &status)=0 |
Polls the data buffer on this NXT for the number of bytes available to be read. | |
virtual ViUInt32 | readBufferData (ViPBuf dataBuffer, tBuffer bufferSelector, ViUInt32 numberOfBytesToRead, tStatus &status)=0 |
Reads data from the data buffer on this NXT. More... | |
virtual void | getResourceString (ViChar resourceString[], tStatus &status)=0 |
Retrieves the resource string for this NXT's session. | |
virtual void | bluetoothFactoryReset (tStatus &status)=0 |
Resets the Bluetooth module on this NXT to its factory settings. | |
Static Public Methods | |
nFANTOM100_kExport iNXT *_VI_FUNCC | createNXT (ViConstString resourceString, tStatus &status, ViBoolean checkFirmwareVersion=true) |
Creates an NXT object. More... | |
nFANTOM100_kExport void _VI_FUNCC | destroyNXT (iNXT *nxtPtr) |
Destroys an NXT object. More... | |
nFANTOM100_kExport iNXTIterator *_VI_FUNCC | createNXTIterator (ViBoolean searchBluetooth, ViUInt32 bluetoothSearchTimeoutInSeconds, tStatus &status) |
Creates an NXT iterator. More... | |
nFANTOM100_kExport void _VI_FUNCC | destroyNXTIterator (iNXTIterator *iterPtr) |
Destroys an NXT iterator object. | |
nFANTOM100_kExport void _VI_FUNCC | pairBluetooth (ViConstString resourceName, ViConstString passkey, ViChar pairedResourceName[], tStatus &status) |
Pairs with an NXT via Bluetooth. More... | |
nFANTOM100_kExport void _VI_FUNCC | unpairBluetooth (ViConstString resourceName, tStatus &status) |
Unpairs with an NXT via Bluetooth. More... | |
nFANTOM100_kExport ViBoolean _VI_FUNCC | isPaired (ViConstString resourceName, tStatus &status) |
Determines if the NXT associated with the specified resource string is paired. More... | |
nFANTOM100_kExport void | findDeviceInFirmwareDownloadMode (ViChar resourceName[], tStatus &status) |
Finds the NXT that is currently in firmware-download mode. More... | |
Protected Methods | |
virtual | ~iNXT ()=0 |
Destructor. |
|
Reboots this NXT into firmware-download mode. This is required before invoking the downloadFirmware method. The reboot does not occur is the specified status is fatal.
|
|
Creates a file object for the file with the specified name on this NXT. Invoking this method does not actually create a file on the NXT. Rather, this method creates a file object which may be used to open a file on this NXT, for reading or writing, or may be used to delete a file on the NXT. A file is not created if the specified status is fatal. The returned file object should be destroyed using the iNXT::destroyFile method.
|
|
Creates an iterator to the files on this NXT. The iterator traverses those files on this NXT that match the specified file name pattern. The iterator is not created if the specified status is fatal. The returned file iterator object should be destroyed using the iNXT::destroyFileIterator method.
|
|
Creates a module object for the module with the specified name on this NXT. Invoking this method does not actually create a module on the NXT. Rather, this method creates a module object which may be used to access an I/O map on this NXT. A module is not created if the specified status is fatal. The returned module object should be destroyed using the iNXT::destroyModule method.
|
|
Creates an iterator to the modules on this NXT. The iterator traverses those modules on this NXT that match the specified module name pattern. The iterator is not created if the specified status is fatal. The returned module iterator object should be destroyed using the iNXT::destroyModuleIterator method.
|
|
Creates an NXT object. Creates an NXT object representing the specified NXT. The NXT object is not created if the specified status is fatal. The returned NXT object should be destroyed using the iNXT::destroyNXT method.
|
|
Creates an NXT iterator. The NXT iterator can be used to find all NXTs that are connected (USB) or in range (Bluetooth). The NXT iterator is not created if the specified status is fatal. The returned NXT iterator object should be destroyed using the iNXT::destroyNXTIterator method.
|
|
Destroys the specified file object. Invoking this method does not actually delete a file on the NXT. Rather, this method destroys a file object which may have been used to open a file on this NXT for reading or writing, or may have been used to delete a file on the NXT.
|
|
Destroys the specified file iterator.
|
|
Destroys the specified module object. Invoking this method does not actually delete a module on this NXT. Rather, this method destroys a module object which may have been used to access an I/O map on this NXT.
|
|
Destroys the specified module iterator.
|
|
Destroys an NXT object.
|
|
Downloads firmware to this NXT. The NXT must already be in firmware-download mode.
|
|
Erases all files from this NXT, leaving only the firmware. All programs, sounds, and data logs are erased. The erasure does not occur if specified status is fatal.
|
|
Finds the NXT that is currently in firmware-download mode. Note that only a single NXT may be in firmware-download mode at a time.
|
|
Retrieves basic information about this NXT. Retrieves the name of this NXT, its Bluetooth address, the Bluetooth signal strength, and the number of bytes available. Information retrieval is not done if specified status is fatal.
|
|
Retrieves the firmware version of this NXT. Returns the protocol and firmware versions installed on this NXT. The current version of this driver supports a protocol major version number of 1 and a firmware major version number of 1. If either of these major version numbers is a value other than 1, the driver will not attempt to communicate to the NXT. The returned versions are undefined if the specified status is fatal.
|
|
Determines if the NXT associated with the specified resource string is paired. The determination is not done if the specified status is fatal.
|
|
Pairs with an NXT via Bluetooth. Programmatically pairs the specified NXT to this computer and, on Windows, creates a virtual serial port to use for communication with that NXT. However, clients should not depend on the creation of this virtual serial port. The pairing is not done if the specified status is fatal.
|
|
Reads, in a generic fashion, from this NXT. Reads a response directly from this NXT. In general, this method isn't used and, instead, the sendDirectCommand and other more specific methods are invoked when communication to the NXT. The command is not sent if the specified status is fatal.
|
|
Reads data from the data buffer on this NXT. Data is not read if the specified status is fatal.
|
|
Sends the specified direct command to this NXT. For more information on direct commands, refer to the LEGO MINDSTORMS NXT Direct commands document. The command is not sent if the specified status is fatal. The command buffer must be non-NULL and the command buffer size in bytes must be non-zero. If require response is set to true, the response buffer must be non-NULL and the response buffer size in bytes must be non-zero. If require response is set to false, the response buffer must be NULL and the response buffer size in bytes must be zero. Both of the buffer size parameters must be small enough to fit in one packet for whichever bus the NXT is connected over (USB or Bluetooth). This means the maximum length for a direct command over USB is 63 bytes; over Bluetooth, 65,533 bytes. If any of these requirements are violated, VI_ERROR_USER_BUF will be returned.
|
|
Sets the name of this NXT. The specified name will be displayed on the NXT, show up during Bluetooth scans, and returned when the getDeviceInfo method is called.
|
|
Unpairs with an NXT via Bluetooth. Programmatically destroys the Bluetooth pairing that was previously established between this computer and the specified NXT. On Mac OS X, this method has no effect and doesn't generate a fatal status. The unpairing is not done if the specified status is fatal.
|
|
Writes, in a generic fashion, to this NXT. Writes a command directly to this NXT. In general, this method isn't used and, instead, the sendDirectCommand and other more specific methods are invoked when communication to the NXT. The write doesn not occur if the specified status is fatal.
|
© Copyright 2005-2006, National Instruments Corporation. All rights reserved.