General library functions.
More...
|
typedef usb_dev_handle | littleWire |
|
typedef struct lwCollection | lwCollection |
|
General library functions.
void changeSerialNumber |
( |
littleWire * |
lwHandle, |
|
|
int |
serialNumber |
|
) |
| |
Changes the USB serial number of the Little Wire
- Parameters
-
serialNumber | Serial 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
-
receiveBuffer | Returned data buffer |
command | Firmware command |
d1 | data[0] for the command |
d2 | data[1] for the command |
d3 | data[2] for the command |
d4 | data[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
-
- 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
-
desiredID | array 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
-
mySerial | Serial 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.
Returns the numeric value of the status of the last communication attempt
- Parameters
-
- 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
-
- 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
-
- 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
-
- Returns
- Firmware version
Definition at line 146 of file littleWire.c.