Changeset a92d0c9 in libvcomm


Ignore:
Timestamp:
02/05/15 16:49:57 (5 years ago)
Author:
Tarmo Kople <tarmo@…>
Branches:
master
Children:
678d396
Parents:
d0bb1b6
git-author:
Tarmo Kople <tarmo@…> (02/05/15 16:26:40)
git-committer:
Tarmo Kople <tarmo@…> (02/05/15 16:49:57)
Message:

+ New VID & PID support

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 90-irvoodoo.rules

    r99340c9 ra92d0c9  
    99# (one each way) for compatibility with older systems. 
    1010 
    11 # HIDAPI/libusb 
    12 #SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", MODE="0666" 
    13  
    14  
    1511# If you are using the hidraw implementation, then do something like the 
    1612# following, substituting the VID and PID with your device. Busnum 1 is USB. 
    1713 
    1814# HIDAPI/hidraw 
    19 KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0004", MODE="0666" 
     15KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="80e1", MODE="0666" 
    2016 
    2117# Once done, optionally rename this file for your device, and drop it into 
  • vcomm.c

    r99340c9 ra92d0c9  
    2727 
    2828VCOMMAPI int VCOMMCALL Vopen(hid_device **vhandle, char *serial) { 
     29        int status; 
     30        status = Vopen_by_vid_pid(vhandle, VENDOR_ID_OLD, PRODUCT_ID_OLD, serial); 
     31        if(status == SUCCESS){ 
     32                return SUCCESS;         // Found by old VID & PID 
     33        }else if (status != ERR_DEV_NOT_FOUND) { 
     34                return status;          // Error opening IRvoodoo 
     35        } 
     36        status = Vopen_by_vid_pid(vhandle, VENDOR_ID, PRODUCT_ID, serial); 
     37        return status; 
     38} 
     39 
     40VCOMMAPI int VCOMMCALL Vopen_by_vid_pid(hid_device **vhandle, unsigned short vid, unsigned short pid , char *serial) { 
    2941 
    3042        char bufserial[33]; 
     
    3244        v_dev = NULL; 
    3345 
    34         devs = hid_enumerate(VENDOR_ID, PRODUCT_ID); // Get linked list of IRvoodoo info structs 
     46        devs = hid_enumerate(vid, pid); // Get linked list of IRvoodoo info structs 
    3547 
    3648        // Loop while last HID is found(4 EP found) 
  • vcomm.h

    re7768a6 ra92d0c9  
    6262#endif 
    6363 
    64 #define VENDOR_ID 0x1fc9  /**< IRvoodoo USB VID */ 
    65 #define PRODUCT_ID 0x0004 /**< IRvoodoo USB PID  */ 
     64#define VENDOR_ID_OLD 0x1fc9  /**< IRvoodoo USB VID */ 
     65#define PRODUCT_ID_OLD 0x0004 /**< IRvoodoo USB PID  */ 
     66#define VENDOR_ID 0x1FC9  /**< IRvoodoo USB VID */ 
     67#define PRODUCT_ID 0x80E1 /**< IRvoodoo USB PID  */ 
    6668 
    6769#ifdef __cplusplus 
     
    8385 */ 
    8486VCOMMAPI int VCOMMCALL Vopen(hid_device **vhandle, char *serial); 
     87/** 
     88 * \brief Open an IRvoodoo connection by USB VID & PID. 
     89 * 
     90 *      @ingroup vapi 
     91 *      @param[out] vhandle IRvoodoo connection handle 
     92 *      @param[in] serial Open specific IRvoodoo device by USB serial number.\n 
     93 *      @param[vid] USB VID\n 
     94 *      @param[pid] USB PID\n 
     95 *      Use @b NULL instead of serial to open first IRvoodoo device found. 
     96 * 
     97 *  @returns 
     98 *      This function returns 0 on success or error code on error. 
     99 * 
     100 */ 
     101VCOMMAPI int VCOMMCALL Vopen_by_vid_pid(hid_device **vhandle, unsigned short vid, unsigned short pid , char *serial); 
    85102/** 
    86103 * \brief Close an IRvoodoo connection. 
Note: See TracChangeset for help on using the changeset viewer.