Skip to content

get an active device's serial number? #548

Closed
@svenevs

Description

@svenevs

I'm using the C++ wrappers, so I have some class like

class Kinect360_Impl : public Freenect::FreenectDevice {
public:
    Kinect360_Impl(freenect_context *_ctx, int _index)
        : Freenect::FreenectDevice(_ctx, _index)
        , mCtx(_ctx)
        , mIndex(_index) {
        setDepthFormat(FREENECT_DEPTH_MM, FREENECT_RESOLUTION_MEDIUM);
    }

and could ideally emulate the loop here

libfreenect/src/core.c

Lines 194 to 199 in 83e57e1

for(item = attrlist ; item != NULL; item = item->next , index++) {
if (strlen(item->camera_serial) == strlen(camera_serial) && strcmp(item->camera_serial, camera_serial) == 0) {
freenect_free_device_attributes(attrlist);
return freenect_open_device(ctx, dev, index);
}
}

since I've stored both the index and the context, and instead of comparing strings, I'm actually just checking what index I'm at. But this is a hidden function

int count = fnusb_list_device_attributes(ctx, &attrlist);

so now I would need to start re-doing that code. Is there any way to do this differently, or is this the only option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions