readHardwareConfig
Read the hardware configuration
kotlin
// serial driver
private lateinit var driver: UBoard
fun your_method() {
cc.uling.usdk.board.mdb.para.HCReplyPara().apply {
driver.readHardwareConfig(this)
}.let {
if (it.isOK) {
println("isWithCoin: ${it.isWithCoin}, isWithCash: ${it.isWithCash}, isWithPOS: ${it.isWithPOS}, isWithPulse: ${it.isWithPulse}, isWithIdentify: ${it.isWithIdentify}, code: ${it.code}")
}
}
}
HCReplyPara Attribute Description
Attribute | Type | Default Value | Description |
---|---|---|---|
version | Int | Hardware Version | |
withCoin | bool | Coin Acceptor | |
withCash | bool | Bill Validator | |
withPOS | bool | POS Machine | |
withPulse | bool | Pulse Payment | |
withIdentify | bool | Identity Recognition | |
code | bool | Currency Code, e.g., Chinese Yuan (CNY) 0086, US Dollar (USD) 0001. |
Note: Fields starting with with*
may have a value of false, indicating that the current vending machine is not equipped with this hardware device.
If the payment hardware device is not equipped, you can use a QR code or other payment systems.
ReadHardwareConfig
Query the hardware version of the driver board.
kotlin
// The slave addr, by default, is 1.
// If you have a vending machine is combo type, the addr may vary.
var addr = 1
HCReplyPara(addr).apply {
driver.ReadHardwareConfig(this)
}.apply {
if (this.isOK) {
println("row: ${this.row}, col: ${this.col}")
}
}
HCReplyPara Attribute Description
Attribute | Type | Default Value | Description |
---|---|---|---|
version | string | Hardware Version Number | |
row | int | Number of Channels | |
column | int | Number of Columns |
This refers to the maximum number of channels supported by the current hardware. By default, it starts from 0, and the maximum value is (row * column -1).
eg: row is 10, column is 10, it starts from 0, the maximum value is 99.
Channels List | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Layer 1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Layer 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
Layer 3 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
Layer 4 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
Layer 5 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
Layer 6 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
Layer 7 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
Layer 8 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
Layer 9 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 |
Layer 10 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |