libftdi Archives

Subject: Re: How to query the device serial number of an already opened connection

From: Alex Scarbro <alex.scarbro@xxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 19 Oct 2015 22:29:38 +0100
Hello Ryan,

Thank you for your reply. 

Yes, I have already used this function - as per the "find_all" example. Unfortunately, whilst it works perfectly to list all the available detected when used in conjunction with the ftdi_usb_find_all(), I'm interested in what the serial number is of the opened device - since the ftdi_usb_open() function could actually open any FTDI device with the same VID/PIDs.

I realise I could use the ftdi_usb_open_desc() function, and In fact I am already, but I also want to offer the LCDproc user the option of just opening by VID/PID, since the ftdi_usb_get_strings() sometimes times out:

" ftdi_usb_get_strings failed: -7 (error sending control message: Connection timed out) "

Best regards,

Alex

On Mon, Oct 19, 2015 at 5:40 PM, Ryan Tennill <rtennill@xxxxxxxxxxxxxxxx> wrote:
I believe what you're looking for is provided by ftdi_usb_get_strings() with the caveat that it closes the device after use.

http://www.intra2net.com/en/developer/libftdi/documentation/group__libftdi.html#ga17e8eae09e58bd3bfeeab8decfce7fd9

Ryan


On 10/18/2015 10:36 AM, Alex Scarbro wrote:
Hello,

I'm working on an improved LCDproc HD44780 driver using the FTDI FT2232D to add keypad support.

I have both interfaces working perfectly, but would like to tell the user what the serial number is of the interface that has been opened.

Is it possible to query the serial number of an interface that has already been opened?

e.g.

    /* open LCD channel*/
    ftdi_init(&p->ftdic);
    ftdi_set_interface(&p->ftdic, INTERFACE_A);
    ftdi_usb_open(&p->ftdic, ftdiVendorIdLcd, ftdiProductIdLcd);

    <QUERY OPENED SERIAL NUMBER HERE>

    printf("Opened device serial number is: %s",serilaNo);
    ftdi_deinit(&p->ftdic);

Best regards,

Alex


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx



-- 

217-351-2655 ext. 126
Distant Focus Corporation
4114B Fieldstone Rd
Champaign, IL 61822
http://jupiter.distantfocus.com/projects/


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx





libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread