Page 1 of 1

problem with writing label to SBC4's VINT HUB

Posted: Mon Mar 05, 2018 9:28 am
by atthe
Hello,

I tried python and C manager samples with SBC4. In 'attach' callback I try to write label to attached device, but this call simply hang the code flow. And label is never changed.

Can label of VINT HUB of SBC4 be changed at all?
If 'yes' then 'how?'

Thanks

Re: problem with writing label to SBC4's VINT HUB

Posted: Mon Mar 05, 2018 4:36 pm
by Patrick
To write the label on a VINT Hub, you need to create a PhidgetHubHandle and open it. You can't set properties on handles you get back from the Manager, because these are read-only, not opened.

-Patrick

Re: problem with writing label to SBC4's VINT HUB

Posted: Wed Mar 07, 2018 12:41 pm
by atthe
Thank you, Patrick,

code like this works fine (errors checking removed for simplicity):

Code: Select all

    PhidgetHubHandle hub_handle;
    PhidgetHub_create(&hub_handle);
    Phidget_setDeviceSerialNumber((PhidgetHandle)hub_handle, serialNumber);
    Phidget_openWaitForAttachment((PhidgetHandle)hub_handle, 3000);
    Phidget_writeDeviceLabel((PhidgetHandle)hub_handle, labelSet.c_str());
    const char* labelGet = NULL;
    Phidget_getDeviceLabel((PhidgetHandle)hub_handle, &labelGet);