MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / hid_write

Function hid_write

lib/hidapi/linux/hid.c:1025–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023
1024
1025int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length)
1026{
1027 int bytes_written;
1028
1029 if (!data || (length == 0)) {
1030 errno = EINVAL;
1031 register_device_error(dev, strerror(errno));
1032 return -1;
1033 }
1034
1035 bytes_written = write(dev->device_handle, data, length);
1036
1037 register_device_error(dev, (bytes_written == -1)? strerror(errno): NULL);
1038
1039 return bytes_written;
1040}
1041
1042
1043int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)

Callers

nothing calls this directly

Calls 2

strerrorFunction · 0.85
register_device_errorFunction · 0.70

Tested by

no test coverage detected