ev3duder
0.3.0
EV3 Downloader/Uploader
|
BSD sockets/Winsock2 Input/Output wrappers. More...
#include "defs.h"
Go to the source code of this file.
Data Structures | |
struct | tcp_handle |
Functions | |
void * | tcp_open (const char *serial, unsigned timeout) |
open a bluetooth device described by device. NULL leads to default action More... | |
void | tcp_close (void *) |
Closes the resource opened by bt_open . More... | |
const wchar_t * | tcp_error (void *device) |
Returns an error string describing the last error occured. More... | |
const wchar_t * | tcp_info (void *device) |
Returns an error string describing the last error occured. More... | |
Variables | |
int(* | tcp_write )(void *device, const u8 *buf, size_t count) |
writes buf[1] till buf[count - 2] to device More... | |
int(* | tcp_read )(void *device, u8 *buf, size_t count, int milliseconds) |
writes buf[1] till buf[count - 2] to device More... | |
BSD sockets/Winsock2 Input/Output wrappers.
Definition in file tcp.h.
void tcp_close | ( | void * | sock | ) |
Closes the resource opened by bt_open
.
[in] | device | handle returned by bt_open |
Closes the resource opened by bt_open
.
[in] | device | handle returned by tcp_open() |
const wchar_t* tcp_error | ( | void * | fd_ | ) |
Returns an error string describing the last error occured.
[in] | device | handle returned by bt_open |
[in] | device | handle returned by tcp_open() |
wprintf
and strerror
const wchar_t* tcp_info | ( | void * | device | ) |
void* tcp_open | ( | const char * | serial, |
unsigned | timeout | ||
) |
open a bluetooth device described by device. NULL
leads to default action
[in] | serial | of Ev3 to connect to |
[in] | timeout | for UDP recv |
open a bluetooth device described by device. NULL
leads to default action
[in] | serial | IP-Address or Serial-Number of Ev3. NULL connects to the first available |
NULL
. If serial is NULL
or the serial numbers match, a udp packet is sent to the source port on the ev3. Afterwards the Ev3 starts listening on the port it broadcasted. Then a GET request is sent and the VM starts listening and business is as usual int(* tcp_read) (void *device, u8 *buf, size_t count, int milliseconds) |
writes buf[1] till buf[count - 2] to device
[in] | device | handle returned by bt_open |
[in] | buf | buffer to write to |
[in] | count | number of characters to be read |
[in] | milliseconds | number of milliseconds to wait at maximum. -1 is indefinitely |
int(* tcp_write) (void *device, const u8 *buf, size_t count) |
writes buf[1] till buf[count - 2] to device
[in] | device | handle returned by bt_open |
[in] | buf | byte string to write, the first byte is omitted |
[in] | count | number of characters to be written (including leading ignored byte) |
hid_write
. Wrapping HIDAPI could fix this.