problem with writing label to SBC4's VINT HUB

General PhidgetSBC Discussion.
atthe
Phidgetly
Posts: 18
Joined: Tue Feb 02, 2010 3:26 pm
Contact:

problem with writing label to SBC4's VINT HUB

Postby atthe » Mon Mar 05, 2018 9:28 am

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

User avatar
Patrick
Lead Developer
Posts: 3039
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

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

Postby Patrick » Mon Mar 05, 2018 4:36 pm

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

atthe
Phidgetly
Posts: 18
Joined: Tue Feb 02, 2010 3:26 pm
Contact:

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

Postby atthe » Wed Mar 07, 2018 12:41 pm

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);


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest