Last Update:2004/11/04

Modify history
------Changes from the Beta1
* A waitF flag was added to four APIs.
  BOOL ExternalControl( BOOL waitF = TRUE );
  BOOL InternalControl( BOOL waitF = TRUE );
  BOOL SetRobotObjectMode( E_ROBOTOBJECT eService, E_ROBOTOBJECTMODE eMode, BOOL waitF = TRUE );
  int DoRobotFunction( E_ROBOTFUNCTION eFunction, BOOL waitF = TRUE );
* GetRobotDesign() returns DESIGN_ERS7 all the time.
* IsRemote() function was added.
* GainON() and GainOFF() functions were deleted.
* SetClock() is functional. UTC can be set.
* Deleted DISCONNECT_MODE_GAINOFF from VAIBODEF.h
* Added BUSY notify when switching between Connect <-> Remote
  #define VAIBO_CONNECT_BUSY -23 // connection is busy switching modes
  #define VAIBO_COMM_BUSY -38    // command busy
* Added an Error code that means the command is restricted
  #define VAIBO_COMM_RESTRICTION  -37 // restricted command
* Added AudioSendWAVFile()


[*] Error code list

VAIBO_NOERROR           0               // No error
VAIBO_READY             1               // Ready to send command/data
VAIBO_NOTSTART          -10             // Not started
VAIBO_WORKING           -11             // Already working
VAIBO_MEMERR            -12             // Memory allocation fail
VAIBO_SERVERSTOP        -13             // Server stopped
VAIBO_PORT_NOTOPEN      -20             // Cannot open communication port
VAIBO_PORT_OPENERR      -21             // Error opening communication port
VAIBO_NSM_ERROR         -22             // NSM starting error
VAIBO_CONNECT_BUSY      -23             // Connection processing 
VAIBO_COMM_NOREPLY      -30             // No reply from the command
VAIBO_COMM_COMMERR      -31             // Command error
VAIBO_COMM_PAUSE        -32             // Command paused
VAIBO_COMM_WAIT         -33             // Command waiting
VAIBO_COMM_IGNORE       -34             // Command ignored
VAIBO_COMM_TIMEOUT      -35             // Command timeout
VAIBO_COMM_LOCK         -36             // Server locked
VAIBO_COMM_RESTRICTION  -37             // Command restricted
VAIBO_COMM_BUSY         -38             // Command busy
VAIBO_FILE_SEADERR      -42             // File send error
VAIBO_FILE_OPENERR      -43             // File open error
VAIBO_FILE_MAKEERR      -44             // File create error
VAIBO_FILE_READERR      -45             // File read error
VAIBO_FILE_WRITEERR     -46             // File write error
VAIBO_LIMIT_MWCID       -50             // Cannot use MWCID
VAIBO_VPRFILE_NOEXIST   -60             // VPR file is not registered

IMAGETP_INITERR         -101            // Initialization error
IMAGETP_OPENERR         -102            // Cannot open
IMAGETP_NOTOPEN         -103            // It is not opened 
IMAGETP_MEMERR          -104            // Memory allocation fail
IMAGETP_CREATEERR       -105            // Create error
IMAGETP_DATAERR         -106            // Data error
IMAGETP_SAVEERR         -107            // Save error

IMAGETP_STATE_ERR       -110            // Unexpected error
IMAGETP_WORKING         -120            // Already working

IMAGETP_STATE_CLOSE     -150            // CLOSE
IMAGETP_STATE_INIT      -151            // Finished INIT
IMAGETP_STATE_OPEN      -152            // Finished OPEN
IMAGETP_STATE_SERVICE   -153            // Start SERVICE
IMAGETP_STATE_PAUSE     -154            // Pause
IMAGETP_STATE_PLAY      -155            // Data transmission

AUDIOTP_INITERR         -201            // Initialization error
AUDIOTP_OPENERR         -202            // Open error
AUDIOTP_NOTOPEN         -203            // It is not opened
AUDIOTP_MEMERR          -204            // Memory allocation fail
AUDIOTP_CREATEERR       -205            // Create error
AUDIOTP_DEVICEERR       -206            // Device open error
AUDIOTP_SENDERR         -207            // Sending data error

AUDIOTP_STATE_ERR       -210            // Unexpected error
AUDIOTP_WORKING         -220            // Already working

AUDIOTP_STATE_CLOSE     -250            // CLOSE
AUDIOTP_STATE_INIT      -251            // Finished INIT
AUDIOTP_STATE_OPEN      -252            // Finished OPEN
AUDIOTP_STATE_SERVICE   -253            // Start SERVICE
AUDIOTP_STATE_PAUSE     -254            // Pause
AUDIOTP_STATE_PLAY      -255            // Data transmission

SENSORTP_STATE_ERR      -310            // Unexpected error
SENSORTP_WORKING        -320            // Already working

SENSORTP_STATE_CLOSE    -350            // CLOSE
SENSORTP_STATE_SERVICE  -351            // Start SERVICE
SENSORTP_STATE_PAUSE    -352            // Pause
SENSORTP_STATE_PLAY     -353            // Data transmission

FTP_STATE_ERR           -410            // Unexpected error
FTP_WORKING             -420            // Already working

+ CVAIBO
[Function] Constructor
[Return] void
[Description] Initialize internal objects and variables.
[Usage]
CVAIBO::CVAIBO(
        HWND parent )   // Windows handle that wants to receive Windows Messages


+ ~CVAIBO()
[Function] Destructor
[Return] void
[Description] Destruct internal objects and variables.
[Usage] 

CVAIBO::~CVAIBO()


+ Connect
[Function] Connect to AIBO via network
[Return] Success: AIBO reference ID   Fail: Error code (see Error code list at the top of this text)
[Description] 
        - Initialize shared data access area
        - Send connection request to the VAIBOServer
        - Start to connect to AIBO
        WM_VAIBO_CONNECT Windows Message is sent when the connection is first made.
        WM_VAIBO_CLIENT_UPDATE is sent when the client application has already 
        connected to AIBO.
        If you want to set an ID and Password on AIBO, please create
        /OPEN-R/APP/DATA/P/OWNER.TXT
        as a text file on the Memory Stick Media and edit it to contain the following 2 lines: 
        OWNER=aibo
        OWNER_PASSWORD=aibo
        aibo and aibo are examples.
[Usage] 

int CVAIBO::Connect( 
                    const char *szIPAddr,   // AIBO's IP address. The format is "0.0.0.0" 
                    const char *ID = NULL,  // AIBO User ID
                    const char *PWD = NULL) // AIBO User Password


+ Disconnect
[Function] Disconnect the network from AIBO
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Disconnect the network from AIBO.
            If another client application is connected, the connection is kept.
[Usage] 

int CVAIBO::Disconnect( void )


+ SetLock
[Function] Lock / Unlock VAIBOServer
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Set Lock / Unlock VAIBOServer control authority
            If a client application locks the VAIBOServer, other applications 
            cannot send any commands through the VAIBOServer.
[Usage] 

int CVAIBO::SetLock( 
                    BOOL bLock )    // TRUE:Lock  FALSE:Unlock


+ GetProductID
[Function] Get AIBO's Product ID
[Return] void
[Description] Get the connected AIBO's product ID.
            The product ID is a unique parameter for each AIBO.
[Usage] 

void CVAIBO::GetProductID( 
                         ProductInfo *pInfo )   // Pointer to the ProductID Structure


+ GetRemoteMACAddress
[Function] Get AIBO's MAC address
[Return] void
[Description] Get the connected AIBO's MAC address.
            ERS-7 has a built-in network card, so the MAC address is a unique parameter for each AIBO(ERS-7).
[Usage] 

void CVAIBO::GetRemoteMACAddress( 
                        MACAddressInfo* pInfo ) // Pointer to the stored MAC address


+ GetRobotDesign
[Function] Get AIBO's Robot design
[Return] Robot design
[Description] Get the Robot design of the connected AIBO.
             Only the ERS-7 is supported by AIBO Remote Framework, so the Robot design is 
             a constant integer (DESIGN_ERS7).
[Usage] 

int CVAIBO::GetRobotDesign( void )


+ RequestNetService
[Function] Request to start the network service
[Return] Success: TRUE    Fail: FLASE
[Description] Request to start the network service.
            When the service is started, WM_VAIBO_SEMANTIFCS(wParam: SEM_START, lParam: START_XXXTP) is sent.
[Usage] 
BOOL CVAIBO::RequestNetService( 
                     int service ) // Service ID:FTP_ID, SENSOR_ID, IMAGE_ID, AUDIO_IN_ID, NETAUDIO_ID


+ SendCmd
[Function] Send a command to control AIBO
[Return] Success: VAIBO_NOERROR or command_ID      Fail: Error code (see Error code list at the top of this text)
[Description] Send a command to control AIBO
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID
[Usage] 

int CVAIBO::SendCmd(
            int cmd,      // APPCommand (The list is in VAIBODef.h)
            BOOL waitF,   // Wait flag
            int nParam1,  // APPCommand parameter1 (See VAIBODef.h)
            int nParam2,  // APPCommand parameter2 (See VAIBODef.h)
            int nParam3,  // No use
            int nParam4 ) // No use


The cmd, nParam1, and nParam2 parameters are defined in VAIBODef.h.
The cmd parameter is defined as a constant macro that begins with APPCMD_.
The nParam1 and nParam2 parameters are defined after the APPCMD_ in VAIBODef.h.


+ PlayMotion
[Function] Play a motion that is categorized with Large/Middle/Small/Level values.
[Return]  Success: VAIBO_NOERROR or command_ID        Fail: Error code (see Error code list at the top of this text)
[Description] Play a motion that is categorized with Large/Middle/Small/Level values.
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            The client application should be aware of the current posture and the motion's start posture. A different start posture may result in a different motion,
            even if the LMS command is the same.

[Usage] 

int CVAIBO::PlayMotion( 
                        LPARAM lmsCmd,    // LMS command ( L_ID << 24 ) | ( M_ID << 16 ) | ( S_ID << 8 ) | ( Level )
                        BOOL exF,         // Extension flag (See MWCID and LMS command list)
                        BOOL waitF,       // Wait flag
                        BOOL infinityF  ) // Infinity command flag (See MWCID and LMS command list)


+ PlayMotionWithAngle
[Function] Play a motion that is categorized with Large/Middle/Small/Level values and angles.
[Return]  Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Same as PlayMotion().
[Usage] 

int CVAIBO::PlayMotionWithAngle( 
                        LPARAM lmsCmd,     // LMS command ( L_ID << 24 ) | ( M_ID << 16 ) | ( S_ID << 8 ) | ( Level )
                        int angleH,        // Horizontal angle (Degree)
                        int angleV,        // Vertical angle (Degree)
                        BOOL exF,          //  Extension flag (See MWCID and LMS command list)
                        BOOL waitF,             //  Wait flag
                        BOOL infinityF,         // Infinity command flag (See MWCID and LMS command list)
                        unsigned int unTarget ) // TargetID(PINK, BOLL, BONE, FACE...) 


+ IsConnect
[Function] Get the connection status of VAIBOServer to AIBO.
[Return] FALSE: Disconnecting    TRUE: Connecting
[Description] Get the connection status of VAIBOServer to AIBO.
[Usage] 

BOOL CVAIBO::IsConnect( void )


+ IsLock
[Function] Get the lock/unlock status of VAIBOServer
[Return] FALSE: Unlock   TRUE: Lock
[Description] Get the lock/unlock status of VAIBOServer.
[Usage]  

BOOL CVAIBO::IsLock( void )


+ GetStateSensorTP
[Function] Get the status of SensorTP
[Return] SENSORTP_STATE_xxx  (See VAIBODef.h)
[Description] Get the status of SensorTP.
[Usage]  

int CVAIBO::GetStateSensorTP( void )


+ GetStateImageTP
[Function] Get the status of ImageTP
[Return] IMAGETP_STATE_xxx  (See VAIBODef.h)
[Description] Get the status of ImageTP
[Usage] 

int CVAIBO::GetStateImageTP( void )


+ GetStateAudioTP
[Function] Get the status of AudioTP
[Return] AUDIOTP_STATE_xxx  (See VAIBODef.h)
[Description] Get the status of AudioTP
[Usage]  

int CVAIBO::GetStateAudioTP( void )


+ GetStateNetAudio
[Function] Get the status of NetAudio
[Return] AUDIOTP_STATE_xxx (See VAIBODef.h)
[Description] Get the status of NetAudio
[Usage] 

int CVAIBO::GetStateNetAudio( void )


+ IsFTPOpen
[Function] Get the status of the FTP service (Open/Close)
[Return] FALSE: FTP is closed   TRUE: FTP is opened
[Description] Get the status of the FTP service (Open/Close)
[Usage] 

BOOL CVAIBO::IsFTPOpen( void )


+ GetInputSemantics
[Function] Get InputSemantics data
[Return] void
[Description] Get InputSemantics data
[Usage] 

void CVAIBO::GetInputSemantics( 
                  int *semID,            // Semantics data ID
                  int *pSubInfoArray,    // Semantics data sub-information(SubInfo)
                  int *pEtcInfoArray )   // Semantics data etc-information(EtcInfo)
                                            (the elements are ComStatus, Level, Pitch, Position) 


+ GetSemInfo
[Function] Get Semantics Information
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Get Semantics Information
[Usage]  

int CVAIBO::GetSemInfo( 
                      int *pInfoArray ) // Array of semantics SubInfo


+ SensorTransferStart
[Function] Start SensorTP sensor data transmission
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Start SensorTP sensor data transmission
[Usage] 

int CVAIBO::SensorTransferStart( void )


+ SensorTransferStop
[Function] Stop SensorTP sensor data transmission
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Stop SensorTP sensor data transmission
[Usage]  

int CVAIBO::SensorTransferStop( void )


+ SensorGetData
[Function] Get SensorTP data (sensor data)
[Return] void
[Description] Get SensorTP data (sensor data)
        Memory area (SensorRec * numOfData) must be allocated before calling this function.
[Usage] 

void CVAIBO::SensorGetData( 
               int numOfData,           // Number of Sensor data
               SensorRecP pSensorRec )  // buffer for transmitted sensor data (should be allocated before calling)

+ SensorSetSkipRate
[Function] Set the skip rate for SensorTP data transmission.
[Return] void
[Description] Set the skip rate for SensorTP data transmission.
[Usage]  

void CVAIBO::SensorSetSkipRate( 
                int skipCount ) // SensorTP skip rate


+ SensorGetSkipRate
[Function] Get the skip rate for SensorTP data transmission.
[Return] skip rate
[Description] Get the skip rate for SensorTP data transmission.
[Usage]  

int CVAIBO::SensorGetSkipRate( void )


+ ImageInit
[Function] Initialize Image object
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Create objects for IMAGE and initialize internal variables of the objects.
[Usage] 

int CVAIBO::ImageInit( void )


+ ImageOpen
[Function] Start receiving image data (camera data)
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Open the network port and start receiving image data (camera data)
[Usage]  

int CVAIBO::ImageOpen( void )


+ ImageClose
[Function] Stop receiving image data
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Close the network port and stop receiving image data.
[Usage] 

int CVAIBO::ImageClose( void )

+ ImagePause
[Function] Pause receiving image data
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Pause receiving image data.
[Usage]  

int CVAIBO::ImagePause( void )


+ ImageResume
[Function] Resume receiving image data
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Resume receiving image data
[Usage]  

int CVAIBO::ImageResume( void )


+ ImageGetData
[Function] Get image data
[Return] IMAGETP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Get image data
[Usage] 

int CVAIBO::ImageGetData( 
                    unsigned char *buff,  // buffer for image data (the buffer should be allocated)
                    int size )            // data size (size is retrieved from the parameter with WM_IMAGETP_UPDATE)


+ ImageSetWindowHandle
[Function] Set window handle to show the image
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Automatically show updated images (movie) in the specified window. The window area must fit the image size.
[Usage]  

int CVAIBO::ImageSetWindowHandle(
                                  HWND wnd,      // Window handle to display the image (movie)
                                  HWND wndDlg)   // Parent window handle

+ ImageOutputCaptureData
[Function] Save a picture as a bitmap file 
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Save a picture as a bitmap file
[Usage]  

int CVAIBO::ImageOutputCaptureData(
                                    LPCTSTR strOutputFileName)  // Bitmap file name


+ ImageGetFrameRate
[Function] Get the frame rate of image transmission
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Get the frame rate of image transmission
[Usage]  

int CVAIBO::ImageGetFrameRate()


+ CameraSetModeDefault
[Function] Set the camera mode to default.
[Return] Success: TRUE      Fail: FALSE
[Description] Set the camera mode to default.
[Usage] 
 
BOOL    CVAIBO::CameraSetModeDefault()


+ CameraSetModeManual
[Function] Set the camera mode to manual settings.
[Return] Success: TRUE    Fail: FALSE
[Description] Set the camera mode to manual settings.
[Usage]  

BOOL    CVAIBO::CameraSetModeManual( 
                                    int nShutterSpeed,  // Shutter speed
                                    int nExposure )     // Exposure


+ CameraSetParamExposure
[Function] Set camera parameter (Exposure)
[Return] Success: TRUE    Fail: FALSE
[Description] Set camera parameter (Exposure)
[Usage]  

BOOL    CVAIBO::CameraSetParamExposure( 
                                       int nExposure )  // Exposure


+ CameraSetParamShutterSpeed
[Function] Set camera parameter (Shutter speed)
[Return] Success: TRUE    Fail: FALSE
[Description] Set camera parameter (Shutter speed)
[Usage]  

BOOL    CVAIBO::CameraSetParamShutterSpeed( 
                                          int nShutterSpeed )  // Shutter speed


+ CameraSetModeAEAWB
[Function] Set the camera mode to AE(Auto Exposure) and AWB(Auto White Balance)
[Return] Success: TRUE    Fail: FALSE
[Description] Set the camera mode to AE(Auto Exposure) and AWB(Auto White Balance)
[Usage]  

BOOL    CVAIBO::CameraSetModeAEAWB()


+ AudioInit
[Function] Initialize Audio objects
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Create objects for Audio and initialize internal parameters of the objects
[Usage]  

int CVAIBO::AudioInit( void )


+ AudioGetOpen
[Function] Start getting audio data
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Open the network port and start getting audio data.
       The audio data formats are ATP16K_XXX and ATP8K_XXX which are defined in VAIBODef.h
[Usage]  

int CVAIBO::AudioGetOpen( 
                         int mode )  // audio data format (Defined in VAIBODef.h)

+ AudioSendOpen
[Function]  Start sending audio data
[Return]  AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Open the network port and start sending audio data.
       The following audio data formats are defined in VAIBODef.h
        ATP16K_16BIT_MONO_MIX       3           // 16kHz,16Bit,Mono Mix
        ATP8K_16BIT_MONO_MIX        7           // 8kHz,16Bit,Mono Mix
        ATP16K_8BIT_MONO_MIX        11          // 16kHz,8Bit,Mono Mix
        ATP8K_8BIT_MONO_MIX         15          // 8kHz,8Bit,Mono Mix
[Usage]  

int CVAIBO::AudioSendOpen( 
                          int mode )  // audio data format (Defined in VAIBODef.h)


+ AudioSendSetMode
[Function] Change sending audio mode
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Change sending audio mode.
       The following audio data formats are defined in VAIBODef.h
        ATP16K_16BIT_MONO_MIX       3           // 16kHz,16Bit,Mono Mix
        ATP8K_16BIT_MONO_MIX        7           // 8kHz,16Bit,Mono Mix
        ATP16K_8BIT_MONO_MIX        11          // 16kHz,8Bit,Mono Mix
        ATP8K_8BIT_MONO_MIX         15          // 8kHz,8Bit,Mono Mix
[Usage]  

int CVAIBO::AudioSendSetMode( 
                             int nMode )  // audio data format (Defined in VAIBODef.h)


+ AudioClose
[Function]  Close the network port and stop getting audio data.
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description]  Close the network port and stop getting audio data.
[Usage]  

int CVAIBO::AudioClose( void )


+ AudioGetData
[Function] Get audio data
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Get audio data
[Usage]  

int CVAIBO::AudioGetData( 
                         unsigned char *buff,  // buffer that stores data (the buffer should be allocated)
                         int size )            // data size (size is retrieved from the parameter with WM_AUDIOTP_UPDATE)


+ AudioSendData
[Function] Send audio data
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Send audio data
[Usage] 

int CVAIBO::AudioSendData( 
                          char *buff,  // Audio data buffer
                          int size )   // size of data which is sent to AIBO


+ AudioSendWAVFile
[Function] Send audio data (file)
[Return] AUDIOTP_NOERROR or Error code (see Error code list at the top of this text)
[Description] Send audio data (file)
[Usage] 

int CVAIBO::AudioSendWAVFile( 
                           LPCTSTR szFile )  // Audio data file name (full path)


+ AudioSendPlay
[Function] Start playing audio
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Start playing audio. This function will return when audio play starts.
[Usage] 

int CVAIBO::AudioSendPlay( 
                          BOOL isKutipaku )  // TRUE:with moving mouth    FALSE:without moving mouth


+ AudioSendStop
[Function] Stop playing audio
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Stop playing audio
[Usage] 

int CVAIBO::AudioSendStop( void )


+ FTPMMSendWAVFile
[Function] Send WAVE file by MMFTP
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Send WAVE file by MMFTP. WM_VAIBO_SEMANTICS(wParam: SEM_DONE, lParam: DONE_SEND_WAV) is sent
        when the file transmission is complete. The file name should be the full path name.
        The previous file is overwritten.
[Usage] 

int CVAIBO::FTPMMSendWAVFile( 
                             LPCTSTR szFile )  // File name (full path)


+ FTPMMSendMWCFile
[Function] Send MWC file by MMFTP
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Send MWC file by MMFTP.
[Usage]  

int CVAIBO::FTPMMSendMWCFile(
                             LPCTSTR szFile)  // File name


+ FTPMMSendMOTIONFile
[Function] Send MOTION file by MMFTP
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Send MOTION file by MMFTP
[Usage] 

int CVAIBO::FTPMMSendMOTIONFile(
                                LPCTSTR szFile)  // File name


+ FTPMMSendAUDIOFile
[Function] Send AUDIO file by MMFTP
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Send AUDIO file by MMFTP
[Usage]  

int CVAIBO::FTPMMSendAUDIOFile(
                               LPCTSTR szFile)  // File name


+ FTPMMSendLEDFile
[Function] Send LED file by MMFTP
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Send LED file by MMFTP
[Usage]  

int CVAIBO::FTPMMSendLEDFile(
                             LPCTSTR szFile)  // File name


+ UpdateContents
[Function] Update contents
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] This function should be called after sending MWC and contents data (MOTION, AUDIO, LED) to
         update AIBO's contents control table.
[Usage]  

int CVAIBO::UpdateContents()


+ PlayContents
[Function] Play contents
[Return] Success: VAIBO_NOERROR or command_ID   Fail: Error code (see Error code list at the top of this text)
[Description] 
            Play contents. 
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
[Usage]  

int CVAIBO::PlayContents(
                         int nMwcID,  // contents ID(MWCID=Middle Ware Command ID)
                         BOOL waitF)  // Wait flag


+ DoKick
[Function] Kick
[Return] Success: VAIBO_NOERROR or command_ID    Fail: Error code (see Error code list at the top of this text)
[Description] 
            Make AIBO kick. 
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            AIBO's posture should be WALK/STAND before calling this function.
            Kick patterns are defined in VAIBO.h
[Usage]

int CVAIBO::DoKick( 
                   int kick,     // Kick pattern (DK_LEFT_FORWARD, DK_LEFT, DK_RIGHT_FORWARD, DK_RIGHT)
                   BOOL waitF )  // Wait flag


+ DoHeader
[Function] Header
[Return] Success: VAIBO_NOERROR or command_ID    Fail: Error code (see Error code list at the top of this text)
[Description] Make AIBO perform a header. 
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            AIBO's posture should be WALK/STAND before calling this function.
            Heading patterns are defined in VAIBO.h
[Usage]

int CVAIBO::DoHeader( 
                    int header,   // Heading pattern (DH_FORWARD)
                    BOOL waitF )  // Wait flag


+ DoWalking
[Function] Walking
[Return] Success: VAIBO_NOERROR or command_ID     Fail: Error code (see Error code list at the top of this text)
[Description] Make AIBO walk. 
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            Walking patterns are defined in VAIBO.h
            In case of angle = 0, distance = 0, default settings are used (walk 10,000cm, turn 20 degrees)
[Usage]  

int CVAIBO::DoWalking( 
                      int walk,      // walking pattern (See DoWalking parameters defined in VAIBO.h)
                      int angle,     // angle [deg]
                      int distance,  // distance [cm]
                      BOOL waitF )   // Wait flag


+ DoApproach
[Function] Approach the target
[Return] Success: VAIBO_NOERROR or command_ID     Fail: Error code (see Error code list at the top of this text)
[Description] Make AIBO approach the target. 
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            Walking patterns are defined in VAIBO.h
            TargetID is defined in VAIBO.h under Target ID(SEMLABEL).
[Usage] 

int CVAIBO::DoApproach(
                      int walk,                 // walking pattern (See DoWalking parameters defined in VAIBO.h)
                      unsigned int unTarget,    // TargetID (See Target ID(SEMLABEL) defined in VAIBO.h)
                      BOOL waitF )              // Wait flag

+ DoGetOffStation
[Function] Get off of the station
[Return] Success: VAIBO_NOERROR or command_ID     Fail: Error code (see Error code list at the top of this text)
[Description] Get off of the station.
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
[Usage] 
int CVAIBO::DoGetOffStation(
                      BOOL waitF )              // Wait flag


+ SetPosture
[Function] Move AIBO to the specified posture
[Return] Success: VAIBO_NOERROR or command_ID     Fail: Error code (see Error code list at the top of this text)
[Description] Move AIBO to the specified posture
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
            Posture parameters are defined in VAIBO.h 
[Usage] 

int CVAIBO::SetPosture( 
                       WORD pos,     // Posture (Posture parameters are defined in VAIBO.h as POS_XXX)
                       BOOL waitF )  // Wait flag


+ GetPosture
[Function] Get posture
[Return] ST_POS_XXX  (Defined in VAIBODef.h)
[Description] Get AIBO's current posture
[Usage]  

WORD CVAIBO::GetPosture( void )


+ GetStatus
[Function] Get AIBO's status
[Return] ST_STAT_XXX  (Defined in VAIBODef.h)
[Description] Get AIBO's status.
[Usage]  

int CVAIBO::GetStatus( void )


+ ChangeHeadAngle
[Function] Change head angle
[Return] Success: VAIBO_NOERROR or command_ID     Fail: Error code (see Error code list at the top of this text)
[Description] Change AIBO's head angle (horizontal, vertical)
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            of the corresponding command_ID.
[Usage] 

int CVAIBO::ChangeHeadAngle( 
                            int angleH,   // horizontal[deg]
                            int angleV,   // vertical[deg]
                            int nSpeed,   // 1(slow) - 4(fast)
                            BOOL waitF )  // Wait flag


+ TurnBody
[Function] Turn body and move head to the current head angle
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Turn the body while keeping the head in the same direction. 
              When you set the angle to the current head angle, AIBO will turn its body and keep the camera on target.
              AIBO will face forwards (target) when turning is finished.
[Usage]  

int CVAIBO::TurnBody( 
                     int angle,    // Set to current head horizontal angle
                     BOOL waitF )  // Wait flag


+ MotionStop
[Function] Stop motion
[Return] Success: VAIBO_NOERROR  Fail: Error code (see Error code list at the top of this text)
[Description] Abort playing motion and stop
[Usage]  

int CVAIBO::MotionStop()


+ GetBatteryLevel
[Function] Get Battery level
[Return] Battery remain (%)
[Description] Get Battery level
[Usage]  

int CVAIBO::GetBatteryLevel( void )


+ SetBatteryLevelNotify
[Function] Set notify battery level ON/OFF
[Return] void
[Description] onF = TRUE; notify battery level ON. onF = FALSE; notify battery level OFF.
              If notify is ON, a WM_VAIBO_BATTERY_LVL Windows message is sent when the remaining battery level equals the lParam value.
[Usage]  

void CVAIBO::SetBatteryLevelNotify( 
                                   BOOL onF,       // ON/OFF Notify low battery level
                                   int interval )  // notify interval [Sec]


+ ExternalControl
[Function] Make AIBO remotely controlled
[Return] Success: TRUE    Fail: FALSE
[Description] Make AIBO remotely controlled
[Usage]  

BOOL    CVAIBO::ExternalControl(
                                 BOOL waitF )  // Wait flag



+ InternalControl
[Function] Make AIBO internally controlled
[Return] Success: TRUE    Fail: FALSE
[Description] Make AIBO internally controlled
[Usage]  

BOOL    CVAIBO::InternalControl(
                                 BOOL waitF )  // Wait flag


+ ChangeDisconnectMode
[Function] Change disconnect mode
[Return] Success: TRUE    Fail: FALSE
[Description] Change the mode when AIBO is disconnected.
   The modes are defined in VAIBODef.h as DISCONNECT_MODE_XXX
[Usage]  

BOOL    CVAIBO::ChangeDisconnectMode( 
                  int nMode )  // Mode when disconnected (defined in VAIBODef.h as DISCONNECT_MODE_XXX)

+ SetRobotObjectMode
[Function] Set the status of AIBO objects
[Return] Success: TRUE    Fail: FALSE
[Description] Set the status (start/stop) of AIBO objects
         The type of objects is defined in VAIBODef.h in enum E_ROBOTOBJECT {}
         The type of object status is defined in VAIBODef.h in enum E_ROBOTOBJECTMODE {}
[Usage]  

BOOL    CVAIBO::SetRobotObjectMode(
                         E_ROBOTOBJECT eService,    // Type of object in AIBO
                         E_ROBOTOBJECTMODE eMode )  // Type of mode status
                         BOOL waitF )               // Wait flag


+ SetClock
[Function] Set AIBO's internal clock
[Return] Success :VAIBO_NOERROR or command_ID      Fail: Error code (see Error code list at the top of this text)
[Description] Set AIBO's internal clock
            In the case of (waitF = FALSE), the function returns immediately without waiting for the result
            and returns the command_ID.
            If you want to get the result of each command (success or fail), you can check the semantics data 
            that has this command_ID
            UU: UTC     -12 - +12  // TimeZone
            HH: Hour    0-23
            MM: Minute  0-59
            SS: Seconds 0-59
[Usage] 
 
int CVAIBO::SetClock( 
                     LPARAM date,  // 0xYYYYMMDD
                     LPARAM time,  // 0xUUHHMMSS
                     BOOL waitF )  // Wait flag


+ IsControlReady
[Function] Query status that AIBO is controllable
[Return] TRUE : controllable   FALSE : incontrollable
[Description] Query status that AIBO is controllable. If another client application has locked AIBOServer, 
    this function returns FALSE.
[Usage]  

BOOL CVAIBO::IsControlReady( void )


+ IsRemote
[Function] Query status that AIBO is controlled remotely
[Return] TRUE : External control (Controlled by PC application)   FALSE : Internal control
[Description] Query status that AIBO is controlled remotely. If an applications has 
    taken control of AIBO, this function returns TRUE.
[Usage]  

BOOL CVAIBO::IsRemote( void )


+ SetObserverWnd
[Function] Add a window that can get Windows Messages
[Return] void
[Description] Add a window that can get Windows Messages. Only one window handle is added. The previous windows handle 
is overwritten.
[Usage]  

void CVAIBO::SetObserverWnd(
                            HWND hObserver)  // Window handle


+ GetLocalIPAddress
[Function] Get the local IP address
[Return] void
[Description] Get the local IP address
[Usage]  
void CVAIBO::GetLocalIPAddress( 
                               char *szIPAddr )  // pointer where the IP address is stored


+ GetLastCmdID
[Function] Get last command ID
[Return] CmdID
[Description] Get last command ID. 
        You can get the result of last command by comparing the returned CmdID with the CmdID that is stored in semantics data.
[Usage]  

int CVAIBO::GetLastCmdID()


+ GetRobotObject
[Function] Get AIBO object status
[Return] E_ROBOTOBJECTMODE 
                eRobotObjectModeStart:  start
                eRobotObjectModeStop:   stop
[Description] Get AIBO object status
[Usage] 

E_ROBOTOBJECTMODE   CVAIBO::GetRobotObject(
                          E_ROBOTOBJECT eService )  //  Type of AIBO object (defined in VAIBODef.h)


+ GetProtocolVersion
[Function] Get the protocol version of each service
[Return] Success: TRUE   Fail: FALSE
[Description] Get the protocol version of each service
         The version can be retrieved after the service has started.
         Type of ServiceID is defined in VAIBODef.h as the RequestNetService parameter
[Usage]

BOOL        CVAIBO::GetProtocolVersion(
                           int nServiceID,      // ServiceID (Defined in VAIBODef.h as RequestNetService)
                           int nVersion[4]      // Stored version


+ DoRobotFunction
[Function] Execute an internal AIBO function
[Return] Success: TRUE   Fail: FALSE
[Description] Execute an internal AIBO function (Ex. self charge)
         Type of internal function is defined in VAIBO.h as enum E_ROBOTFUNCTION {}
[Usage] 

BOOL        CVAIBO::DoRobotFunction(
                        E_ROBOTFUNCTION eFunction,     // defined in VAIBO.h as enum E_ROBOTFUNCTION {}
                        BOOL waitF = TRUE )


+ StopRobotFunction
[Function] Stop executing an internal AIBO function
[Return] Success: TRUE   Fail: FALSE
[Description]  Stop executing an internal AIBO function
[Usage] 
BOOL        CVAIBO::StopRobotFunction()


+ VPRSetMode
[Function] Set VPR(Visual Pattern Recognition) mode
[Return] Success: TRUE   Fail: FALSE
[Description] Set VPR mode
        Type of VPR mode is defined in VAIBO.h as enum EVPRMODE {}
[Usage] 
BOOL        CVAIBO::VPRSetMode(
                        EVPRMODE eMode )        // VPR mode


+ VPRTrainModel
[Function] Train VPR model
[Return] Success: TRUE   Fail: FALSE
[Description] Train VPR mode
      Min-Max Model ID, Min-Max Model Sub ID, and VPR training policy are defined in VAIBO.h

[Usage] 
BOOL        CVAIBO::VPRTrainModel(
                        int nModelID,           // modelID 
                        int nModelSubID,        // model sub ID 
                        EVPRPOLICY ePolicy )    // VPR training policy


+ VPRRemoveModel
[Function] Delete VPR model
[Return] Success: TRUE   Fail: FALSE
[Description] Delete VPR model
[Usage] 
BOOL        CVAIBO::VPRRemoveModel(
                        int nModelID,           // model ID (VPRMODELID_MIN -- VPRMODELID_MAX )
                        int nModelSubID )       // model sub ID  (VPRMODELSUBID_MIN -- VPRMODELSUBID_MAX )


+ VPRQueryModel
[Function] Query trained VPR model.
[Return] Success: TRUE   Fail: FALSE
[Description] Query trained VPR model.
         The result can be retrieved with the WM_VAIBO_INPUT_SEMANTICS Message (labelID = SEMID_VPR_RESULT)
[Usage] 
BOOL        CVAIBO::VPRQueryModel(
                        int nModelID )          // model ID (VPRMODELID_MIN -- VPRMODELID_MAX )


+ VPRGetImage
[Function] Get the image of a trained VPR model
[Return] Success: TRUE   Fail: FALSE
[Description] Get the image (file name) of a trained VPR model
[Usage] 
BOOL        CVAIBO::VPRGetImage(
                        int nModelID,           // model ID (VPRMODELID_MIN -- VPRMODELID_MAX)
                        int nModelSubID,        // model sub ID (VPRMODELSUBID_MIN -- VPRMODELSUBID_MAX)
                        char* strFileName )     // file name (output) 


+ SetVolume
[Function] Set sound volume
[Return] Success: TRUE   Fail: FALSE
[Description] Set sound volume
[Usage] 
BOOL    CVAIBO::SetVolume(
                        int nVolume )           // Volume (AIBO_VOLUME_MIN(0) - AIBO_VOLUME_MAX(3))


+ RequestVolume
[Function] Get sound volume
[Return] Success: TRUE   Fail: FALSE
[Description] Send request to get sound volume. The result is sent in Subinfo[0] of SEM_VOLUME semantics.
        The value is 0 - 3
[Usage] 
BOOL    CVAIBO::RequestVolume()

+ SetUserIdPwd
[Function] Store user ID and Password to the registry
[Return] void
[Description] Store user ID and Password to the registry
[Usage]     

void    CVAIBO::SetUserIdPwd(
                                       char *szUserID,  // User ID 
                                       char *szPswd)    // User Password

+ GetUserIdPwd
[Function] Get user ID and Password from the registry
[Return] void
[Description] Get user ID and Password from the registry
[Usage]     

void    CVAIBO::GetUserIdPwd(
                                       char *szUserID,  // User ID 
                                       char *szPswd)    // User Password
+ CATPDirectSound
[Function] Constructor
[Return] void
[Description] Constructor class
[Usage]     

CATPDirectSound::CATPDirectSound()


+ ~CATPDirectSound
[Function] Destructor
[Return] void
[Description] Destructor class
[Usage]     

CATPDirectSound::~CATPDirectSound()


+ Init
[Function] Initialize class
[Return] void
[Description] Initialize class
[Usage]     

BOOL    CATPDirectSound::Init(
                              HWND hAppWnd)  // Parent window handle


+ StartPlay
[Function] Start playing sound (AIBO -> PC)
[Return] Success: TRUE   Fail: FALSE
[Description] Start playing sound (AIBO -> PC)
            Wave mode is defined in ATPDirectSound.h
[Usage]     

BOOL    CATPDirectSound::StartPlay(
                                   int nMode)  // Wave mode (eWaveMode16k16bStereo,..) 


+ EndPlay
[Function] End playing sound (AIBO -> PC)
[Return] Success: TRUE   Fail: FALSE
[Description] End playing sound (AIBO -> PC)
[Usage]     

BOOL    CATPDirectSound::EndPlay()


+ PlayWaveData
[Function] Input wave data to play
[Return] Success: TRUE   Fail: FALSE
[Description] Input wave data to play
[Usage]     

BOOL    CATPDirectSound::PlayWaveData(
                                      char* pData,  // Wave data 
                                      int nSize)    // data size


+ StartCapture
[Function] Start capturing sound
[Return] Success: TRUE   Fail: FALSE
[Description] Start capturing sound
[Usage]     

BOOL    CATPDirectSound::StartCapture(
         int nMode,     // Wave mode(eWaveMode16k16bStereo,..) 
         void ( *pCaptureProc )( void* pCaptureData, DWORD dwCaptureLength, BOOL isEnd, void* pParam ),  
             // Capture function
         void* pParam)  // Parameter for capture function


+ EndCapture
[Function] End capturing sound
[Return] Success: TRUE   Fail: FALSE
[Description] End capturing sound
[Usage]     
BOOL    CATPDirectSound::EndCapture()
