add new vendor id for pcb test
This commit is contained in:
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId "in.sminnovations.hpostesting.dev"
|
applicationId "in.sminnovations.hpostesting.dev"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 75
|
versionCode 80
|
||||||
versionName "2.1.75"
|
versionName "2.1.80"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ object Constants {
|
|||||||
const val HEMO_CUBE_V2_PRODUCT_ID = 60000
|
const val HEMO_CUBE_V2_PRODUCT_ID = 60000
|
||||||
const val HEMO_CUBE_V2_VENDOR_ID = 4292
|
const val HEMO_CUBE_V2_VENDOR_ID = 4292
|
||||||
|
|
||||||
|
const val HEMO_CUBE_PCB_VENDOR_ID = 678
|
||||||
|
|
||||||
const val ERROR_NORMAL = 400
|
const val ERROR_NORMAL = 400
|
||||||
const val ERROR_CRITICAL = 401
|
const val ERROR_CRITICAL = 401
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val deviceType = when {
|
val deviceType = when {
|
||||||
availableDrivers.isNotEmpty() -> {
|
availableDrivers.isNotEmpty() -> {
|
||||||
val device = availableDrivers[0].device
|
val device = availableDrivers[0].device
|
||||||
Toast.makeText(this, R.string.device, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Connected, productId: ${device.productId}, vendorId: ${device.vendorId}", Toast.LENGTH_SHORT).show()
|
||||||
when {
|
when {
|
||||||
device.productId == Constants.HOMO_CUBE_ID && device.vendorId == Constants.VENDOR_ID -> {
|
device.productId == Constants.HOMO_CUBE_ID && device.vendorId == Constants.VENDOR_ID -> {
|
||||||
binding.cvItem1.visibility = View.VISIBLE
|
binding.cvItem1.visibility = View.VISIBLE
|
||||||
@@ -124,6 +124,15 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Constants.DEVICE_TYPE_HOMOCUBE
|
Constants.DEVICE_TYPE_HOMOCUBE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device.productId == 8963 && device.vendorId == 1659 -> {
|
||||||
|
binding.cvItem1.visibility = View.VISIBLE
|
||||||
|
binding.cvItem3.visibility = View.VISIBLE
|
||||||
|
binding.cvItem2.visibility = View.GONE
|
||||||
|
binding.cvItem4.visibility = View.GONE
|
||||||
|
DataHolder.deviceType.postValue(Constants.DEVICE_TYPE_HOMOCUBE)
|
||||||
|
Constants.DEVICE_TYPE_HOMOCUBE
|
||||||
|
}
|
||||||
|
|
||||||
device.productId == Constants.DEVICE_PRODUCT_ID && device.vendorId == Constants.DEVICE_VENDOR_ID -> {
|
device.productId == Constants.DEVICE_PRODUCT_ID && device.vendorId == Constants.DEVICE_VENDOR_ID -> {
|
||||||
Log.d(
|
Log.d(
|
||||||
TAG,
|
TAG,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<usb-device vendor-id="1027" product-id="24577" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
<usb-device vendor-id="1027" product-id="24577" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
||||||
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
||||||
<usb-device vendor-id="4292" product-id="60000" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
<usb-device vendor-id="4292" product-id="60000" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
||||||
|
<usb-device vendor-id="1659" product-id="8963" />
|
||||||
|
|
||||||
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
|
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
|
||||||
<!-- <usb-device vendor-id="4292" product-id="60000" /> <!– 0xea60: CP2102 and other CP210x single port devices –>-->
|
<!-- <usb-device vendor-id="4292" product-id="60000" /> <!– 0xea60: CP2102 and other CP210x single port devices –>-->
|
||||||
|
|||||||
Reference in New Issue
Block a user