Skip to content

Commit

Permalink
uninteresting ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Klein committed Nov 15, 2010
1 parent 193e539 commit b2515dd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/bindings.cc
Expand Up @@ -408,7 +408,11 @@ namespace NodeUsb {
interface->Set(V8STR(#name), Integer::New(interface_descriptor.name));
#define LIBUSB_ENDPOINT_DESCRIPTOR_STRUCT_TO_V8(name) \
endpoint->Set(V8STR(#name), Integer::New(endpoint_descriptor.name));


/**
* Returns complete configuration descriptor including interfaces and endpoints
* @return object
*/
Handle<Value> Device::GetConfigDescriptor(const Arguments& args) {
LOCAL(Device, self, args.This())
CHECK_USB(libusb_get_active_config_descriptor(self->device, &(self->config_descriptor)), scope)
Expand Down Expand Up @@ -457,6 +461,7 @@ namespace NodeUsb {
interface->Set(V8STR("extra"), interface_extra);

Local<Array> endpoints = Array::New();

// interate endpoints
for (int j = 0; j < interface_descriptor.bNumEndpoints; j++) {
Local<Object> endpoint = Object::New();
Expand Down Expand Up @@ -495,6 +500,10 @@ namespace NodeUsb {
#define LIBUSB_DEVICE_DESCRIPTOR_STRUCT_TO_V8(name) \
r->Set(V8STR(#name), Integer::New(self->device_descriptor.name));

/**
* Returns the device descriptor of current device
* @return object
*/
Handle<Value> Device::GetDeviceDescriptor(const Arguments& args) {
LOCAL(Device, self, args.This())
CHECK_USB(libusb_get_device_descriptor(self->device, &(self->device_descriptor)), scope)
Expand Down

0 comments on commit b2515dd

Please sign in to comment.