discoverpixy
Public Member Functions | List of all members
PixyInterpreter Class Reference
Inheritance diagram for PixyInterpreter:
Inheritance graph
[legend]
Collaboration diagram for PixyInterpreter:
Collaboration graph
[legend]

Public Member Functions

int init ()
 Spawns an 'interpreter' thread which attempts to connect to Pixy using the USB interface. On successful connection, this thread will capture and store Pixy 'block' object data which can be retreived using the getBlocks() method. More...
 
void close ()
 Terminates the USB connection to Pixy and the 'iterpreter' thread.
 
int blocks_are_new ()
 Get status of the block data received from Pixy. More...
 
int get_blocks (int max_blocks, Block *blocks)
 Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'. More...
 
int send_command (const char *name, va_list arguments)
 Sends a command to Pixy. More...
 
int send_command (const char *name,...)
 Sends a command to Pixy. More...
 
int service ()
 
int init ()
 Spawns an 'interpreter' thread which attempts to connect to Pixy using the USB interface. On successful connection, this thread will capture and store Pixy 'block' object data which can be retreived using the getBlocks() method. More...
 
void close ()
 Terminates the USB connection to Pixy and the 'iterpreter' thread.
 
int blocks_are_new ()
 Get status of the block data received from Pixy. More...
 
int get_blocks (int max_blocks, Block *blocks)
 Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'. More...
 
int send_command (const char *name, va_list arguments)
 Sends a command to Pixy. More...
 
int send_command (const char *name,...)
 Sends a command to Pixy. More...
 
int service ()
 

Member Function Documentation

int PixyInterpreter::blocks_are_new ( )

Get status of the block data received from Pixy.

Returns
0 Stale Data: Block data has previously been retrieved using 'pixy_get_blocks()'.
1 New Data: Pixy sent new data that has not been retrieve yet.
int PixyInterpreter::blocks_are_new ( )

Get status of the block data received from Pixy.

Returns
0 Stale Data: Block data has previously been retrieved using 'pixy_get_blocks()'.
1 New Data: Pixy sent new data that has not been retrieve yet.
int PixyInterpreter::get_blocks ( int  max_blocks,
Block blocks 
)

Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'.

Parameters
[in]max_blocksMaximum number of Blocks to copy to the address pointed to by 'blocks'.
[out]blocksAddress of an array in which to copy the blocks to. The array must be large enough to write 'max_blocks' number of Blocks to.
Returns
Non-negative Success: Number of blocks copied
PIXY_ERROR_USB_IO USB Error: I/O
PIXY_ERROR_NOT_FOUND USB Error: Pixy not found
PIXY_ERROR_USB_BUSY USB Error: Busy
PIXY_ERROR_USB_NO_DEVICE USB Error: No device
PIXY_ERROR_INVALID_PARAMETER Invalid pararmeter specified
int PixyInterpreter::get_blocks ( int  max_blocks,
Block blocks 
)

Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'.

Parameters
[in]max_blocksMaximum number of Blocks to copy to the address pointed to by 'blocks'.
[out]blocksAddress of an array in which to copy the blocks to. The array must be large enough to write 'max_blocks' number of Blocks to.
Returns
Non-negative Success: Number of blocks copied
PIXY_ERROR_USB_IO USB Error: I/O
PIXY_ERROR_NOT_FOUND USB Error: Pixy not found
PIXY_ERROR_USB_BUSY USB Error: Busy
PIXY_ERROR_USB_NO_DEVICE USB Error: No device
PIXY_ERROR_INVALID_PARAMETER Invalid pararmeter specified
int PixyInterpreter::init ( )

Spawns an 'interpreter' thread which attempts to connect to Pixy using the USB interface. On successful connection, this thread will capture and store Pixy 'block' object data which can be retreived using the getBlocks() method.

Returns
0 Success
-1 Error: Unable to open pixy USB device
int PixyInterpreter::init ( )

Spawns an 'interpreter' thread which attempts to connect to Pixy using the USB interface. On successful connection, this thread will capture and store Pixy 'block' object data which can be retreived using the getBlocks() method.

Returns
0 Success
-1 Error: Unable to open pixy USB device
int PixyInterpreter::send_command ( const char *  name,
va_list  arguments 
)

Sends a command to Pixy.

Parameters
[in]nameRemote procedure call identifier string.
[in,out]argumentsArgument list to function call.
Returns
-1 Error
int PixyInterpreter::send_command ( const char *  name,
va_list  arguments 
)

Sends a command to Pixy.

Parameters
[in]nameRemote procedure call identifier string.
[in,out]argumentsArgument list to function call.
Returns
-1 Error
int PixyInterpreter::send_command ( const char *  name,
  ... 
)

Sends a command to Pixy.

Parameters
[in]nameRemote procedure call identifier string.
Returns
-1 Error
int PixyInterpreter::send_command ( const char *  name,
  ... 
)

Sends a command to Pixy.

Parameters
[in]nameRemote procedure call identifier string.
Returns
-1 Error

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: