Skip to content

BaseClsPara Class

The base class for all UBoard communication parameter data.

BaseClsPar.isOK()

Return valuedescription
TrueIndicates that the data request is normal.
FalseIndicates that the data transmission failed or there was an exception during processing.
kotlin
// serial driver
private lateinit var driver: UBoard

fun your_method() {
    // addr
    val para = Children of BaseClsPar()
    if (!para.isOK) {
        throw Exception("unknown failed")
    }
    println("isOK: ${para.isOK}")
    println("resultCode: ${para.resultCode}")
}

BaseClsPar.getResultCode()

Return valuedescription
0The request is normal with no errors.
201Failed to open the serial port.
202Failed to close the serial port.
203Data transmission error.
204Timeout for data returned by the driver board.
205Driver board returned data with incorrect starting flag.
206Driver board returned data with an excessive length.
207Incorrect checksum for the returned data.
208The received data frame command is incorrect.
209Incorrect address for the returned data.
210Processing, data transmission failed.
211System processing exception.
212Driver board returned an exception error.
213Data stream is abnormal or has been closed.
214Serial port is not open, communication failed.
215Driver board processing failed, returning fault code.

UBoard Class

The communication class for the channel board serial port. It must be created using USDK.getInstance().create().

kotlin
// serial address
var commid = "/dev/ttyS0"

USDK.getInstance().create(commid)
methoddescription
EF_OpenDevOpen the serial port
EF_CloseDevReboot your vending machine
readHardwareConfigRead the hardware configuration
ReadHardwareConfigQuery the hardware version of the driver board.
GetSoftwareVersionQuery the driver board software version.
getMinPayoutAmountRead the minimum denomination supported by the peripheral.
getPayAmounttodo
initPaymenttodo
notifyPaymenttodo
notifyResulttodo
changeBalancetodo
getChangeStatustodo
findChangeResulttodo
setAcceptMoneytodo
getAcceptUnittodo
getMoneyBalancetodo
syncSystemTimetodo
ageVerificationage verification
setWorkModetodo
setPayChanneltodo
pulseBalancetodo
GetBoxStatusQuery the current status of the locker.
GetYPostodo
GetXPostodo
GetDropStatusQuery the drop detection status.
GetArrayStatustodo
GetIOStatustodo
GetYIOStatustodo
GetXIOStatustodo
GetYStatustodo
GetXStatustodo
ResetLiftElevator reset.
RunMototodo
MotoTimeouttodo
SetPickYtodo
SetPickXtodo
ToYtodo
ToXtodo
SeYPostodo
SeXPostodo
ShipmentVending Machine Shipment and Shipment Status Query
ReadTempRead temperature and humidity.
DriveOutputtodo
ArrayOutputtodo
GetXStatustodo
GetXStatustodo

© All rights reserved. Dingshang Metal Products Co., Ltd.