+ public boolean isAltusMetrum() {
+ if (getVendor() != libaltosConstants.USB_VENDOR_ALTUSMETRUM)
+ return false;
+ if (getProduct() < libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MIN)
+ return false;
+ if (getProduct() > libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MAX)
+ return false;
+ return true;
+ }
+
+ public boolean matchProduct(int want_product) {
+
+ if (!isAltusMetrum())
+ return false;
+
+ if (want_product == Any)
+ return true;
+
+ if (want_product == BaseStation)
+ return matchProduct(TeleDongle) || matchProduct(TeleTerra);
+
+ int have_product = getProduct();
+
+ if (have_product == AltusMetrum) /* old devices match any request */
+ return true;
+
+ if (want_product == have_product)
+ return true;
+
+ return false;