3 #define USB_STRING_DESCRIPTOR_HEADER(stringLength) ((2*(stringLength)+2) | (3<<8))
6 void write_serial(
struct aura_node *node,
const char *str)
9 uint16_t *
data = malloc(32);
13 data[i++] = USB_STRING_DESCRIPTOR_HEADER(strlen(str));
18 ret =
aura_call(node,
"set_serial", &retbuf, 0, 0, data);
19 printf(
"Serial number written with result %d, replug the device\n", ret);
24 int main(
int argc,
const char **argv) {
28 struct aura_node *n =
aura_open(
"simpleusb",
"simpleusbconfigs/pw-ctl.conf");
36 write_serial(n, argv[1]);
void aura_wait_status(struct aura_node *node, int status)
int aura_call(struct aura_node *node, const char *name, struct aura_buffer **retbuf,...)
struct aura_node * aura_open(const char *name, const char *opts)
void aura_buffer_release(struct aura_buffer *buf)
void aura_close(struct aura_node *node)