Little-Wire
 All Classes Functions Groups Pages
General

General library functions. More...

Classes

struct  lwCollection
 

Typedefs

typedef usb_dev_handle littleWire
 
typedef struct lwCollection lwCollection
 

Functions

int littlewire_search ()
 
littleWire * littlewire_connect_byID (int desiredID)
 
littleWire * littlewire_connect_bySerialNum (int mySerial)
 
littleWire * littleWire_connect ()
 
unsigned char readFirmwareVersion (littleWire *lwHandle)
 
void changeSerialNumber (littleWire *lwHandle, int serialNumber)
 
int customMessage (littleWire *lwHandle, unsigned char *receiveBuffer, unsigned char command, unsigned char d1, unsigned char d2, unsigned char d3, unsigned char d4)
 
int littleWire_error ()
 
char * littleWire_errorName ()
 

Variables

lwCollection lwResults [16]
 
int lw_totalDevices
 

Detailed Description

General library functions.

Function Documentation

void changeSerialNumber ( littleWire *  lwHandle,
int  serialNumber 
)

Changes the USB serial number of the Little Wire

Parameters
serialNumberSerial number integer value (100-99)
Returns
(none)

Definition at line 153 of file littleWire.c.

int customMessage ( littleWire *  lwHandle,
unsigned char *  receiveBuffer,
unsigned char  command,
unsigned char  d1,
unsigned char  d2,
unsigned char  d3,
unsigned char  d4 
)

Sends a custom message to the device.
Useful when developing new features in the firmware.

Parameters
receiveBufferReturned data buffer
commandFirmware command
d1data[0] for the command
d2data[1] for the command
d3data[2] for the command
d4data[3] for the command
Returns
status

Definition at line 384 of file littleWire.c.

littleWire* littleWire_connect ( )

Tries to connect to the first littleWire device that libusb can find.

Parameters
(none)
Returns
littleWire pointer for healthy connection, NULL for a failed trial.

Definition at line 136 of file littleWire.c.

littleWire* littlewire_connect_byID ( int  desiredID)

Tries to connect to the spesific littleWire device by array id.

Parameters
desiredIDarray index of the lwResults array.
Returns
littleWire pointer for healthy connection, NULL for a failed trial.

Definition at line 104 of file littleWire.c.

littleWire* littlewire_connect_bySerialNum ( int  mySerial)

Tries to connect to the spesific littleWire with a given serial number.
If multiple devices have the same serial number, it connects to the last one it finds

Parameters
mySerialSerial number of the desired littlewire device.
Returns
littleWire pointer for healthy connection, NULL for a failed trial.

Definition at line 118 of file littleWire.c.

int littleWire_error ( )

Returns the numeric value of the status of the last communication attempt

Parameters
(none)
Returns
Numeric value of the status of the last communication attempt

Definition at line 538 of file littleWire.c.

char* littleWire_errorName ( )

Returns the string version of the last communication attempt status if there was an error

Parameters
(none)
Returns
String version of the last communication attempt status if there was an error

Definition at line 543 of file littleWire.c.

int littlewire_search ( )

Tries to cache all the littleWire devices and stores them in lwResults array.
Don't actually connects to any of the device(s).

Parameters
(none)
Returns
Total number of littleWire devices found in the USB system.

Definition at line 60 of file littleWire.c.

unsigned char readFirmwareVersion ( littleWire *  lwHandle)

Reads the firmware version of the Little Wire
Format: 0xXY => X: Primary version Y: Minor version

Parameters
(none)
Returns
Firmware version

Definition at line 146 of file littleWire.c.