/* USB::DevHandle#usb_bulk_write(endpoint, bytes, timeout) */ static VALUE rusb_bulk_write( VALUE v, VALUE vep, VALUE vbytes, VALUE vtimeout) { usb_dev_handle *p = get_usb_devhandle(v); int ep = NUM2INT(vep); int timeout = NUM2INT(vtimeout); char *bytes; int size; int ret; StringValue(vbytes); bytes = RSTRING_PTR(vbytes); size = RSTRING_LEN(vbytes); ret = usb_bulk_write(p, ep, bytes, size, timeout); check_usb_error("usb_bulk_write", ret); return INT2NUM(ret); }