Beispiel #1
0
/**************************************************************************************************
 ** Function:       handleGetProductsID
 ** Description:    Function takes two arrays, array length, and target product.  Passes to
 **                 getProductID function.  Handles any thrown error.  In actuality would probably
 **                 require another array to store successful searches.
 ** Input:          int ids[]           || array of product IDs
 **                 std::string names[] || array of products
 **                 int numProducts     || number of products in arrays
 **                 std::string target  || item to be searched for
 ** Output:         none
 *************************************************************************************************/
void handleGetProductID(int ids[], std::string names[], int numProducts, std::string target){
    try
    {
        std::cout << getProductID(ids,names,numProducts,target) << std::endl;
    }
    catch ( std::string thrownError )
    {
        std::cout << "The item -" << thrownError << "- is not an item in the product list."
                  << "  Stop Function." << std::endl;
    }
}
Beispiel #2
0
uint32_t Cap1188_touch::getDeviceInfo(void){
    uint32_t data;

    data = getProductID();
    data <<= 8;
    data |= getMFGID();
    data <<= 8;
    data |= getRevision();
    data <<= 8;
    data |= getVendorID();

    return data;

}
  URI
  osxHIDPointingDevice::getURI(bool expanded, bool crossplatform) const {

    URI uri;

    if (crossplatform)
    {
      uri.scheme = "any";

      int vendorId, productId;
      if ((vendorId = getVendorID()))
        URI::addQueryArg(uri.query, "vendor", vendorId) ;

      if ((productId = getProductID()))
        URI::addQueryArg(uri.query, "product", productId) ;
    }

    else
    {
      uri = hiddev->getURI(expanded) ;

      // FIXME: query args for modes (report and queue) are useless as
      // long as they are not both fully supported

      if (primaryUsagePage!=OSX_DEFAULT_USAGEPAGE)
        URI::addQueryArg(uri.query, "usagePage", primaryUsagePage) ;

      if (primaryUsage!=OSX_DEFAULT_USAGE)
        URI::addQueryArg(uri.query, "usage", primaryUsage) ;
    }

    if (expanded || hiddev->debugLevel)
      URI::addQueryArg(uri.query, "debugLevel", hiddev->debugLevel) ;

    if (expanded || forced_cpi>0)
      URI::addQueryArg(uri.query, "cpi", getResolution()) ;

    if (expanded || forced_hz>0)
      URI::addQueryArg(uri.query, "hz", getUpdateFrequency()) ;

    return uri ;
  }