Turn laser on and off while receiving depth image

Hi. I am trying to turn the laser on and off while receiving depth images. I checked the examples on how to disable the laser using xnUSBOpenDeviceByPath / xnUSBSendControl and this works. But AFAIK, I cant use those while the device is open and blocked? Is there a way to acces the USB Handle using the astra API or OpennNI?

I also found this example: Multi-camera Control using OpenNI and the S/N

I managed to compile the project on linux. But it looks like xnUSBOpenDeviceByPath can’t open the already runnign device and the app crashes.

Looks like it works when using libusb directly

                libusb_device_handle *dev;

                libusb_context *ctx;
                libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices
                ssize_t cnt = libusb_get_device_list (ctx, &devs); //get the list of devices

                int nr_mot(0);
                for (int i = 0; i < cnt; ++i)
                    struct libusb_device_descriptor desc;
                    const int r = libusb_get_device_descriptor (devs[i], &desc);
                    if (r < 0)

                    printf("Device: %i Vendor: %i Product: %i\n", i, desc.idVendor, desc.idProduct);

                    // Search for the aux
                    if (desc.idVendor == 0x2bc5 && desc.idProduct == 0x0402)

                        if ((libusb_open (devs[i], &dev) != 0) || (dev == 0))
                            printf("Cannot open aux");
                        // Claim the aux
                        printf("Openning device aux %d on 0\n", i);
                        libusb_claim_interface (dev, 0);


                //libusb_free_device_list (devs, 1); // free the list, unref the devices in it

                    uint8_t buf1[10];
                    *(uint16_t*)buf1 = 0;
                    int cmd_len = 2;

                    uint8_t obuf[0x400];
                    uint8_t ibuf[0x200];

                    cam_hdr *chdr = (cam_hdr*)obuf;
                    chdr->magic[0] = 0x47;
                    chdr->magic[1] = 0x4d;
                    chdr->cmd = 85;
                    chdr->tag = 1; //must be ++
                    chdr->len = cmd_len / 2;
                    memcpy(obuf + sizeof(*chdr), buf1, cmd_len);

                    std::cout << libusb_control_transfer(dev,  LIBUSB_REQUEST_TYPE_VENDOR, 0x00, 0x0000,0x0000, obuf, cmd_len + sizeof(*chdr), 5000) << std::endl;
                    unsigned int actual_len;
                    std::cout << libusb_control_transfer(dev,  LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN, 0x00, 0x0000, 0x0000, ibuf, 0x200, 5000) << std::endl;

(I cannot reply on “Multi-camera Control using OpenNI and the S/N”, it is limited to 3 replies for new users…

Yes, they work individually and, when both connected, they have different URI’s.
The one that gives the error is always the second camera. If I connect 3 cameras, again, the second receives the error.

Is it possible to turn multiple sensor laser on and off using Orbbec’s SDK? Any document or sample code available?
Thanks in advance!