package com.module.pay.strategy

import com.module.pay.serialport.SerialPortUtil
import com.quyunshuo.androidbaseframemvvm.base.utils.SpUtils
import com.quyunshuo.androidbaseframemvvm.common.constant.MMKVName

object PaySendDataICTStrategy : PaySendDataStrategy {
    private var serialPortUtil: SerialPortUtil? = null

    init {
        //工厂构建
        val createStrategy = SerialPortFactory().createStrategy(StrategyType.ICT)
        serialPortUtil = SerialPortUtil(createStrategy)
        serialPortUtil?.openSerialPort("/dev/"+ SpUtils.getString(MMKVName.TTYS_MDB,"ttyS5"),9600,0,1)
    }

    override fun billInit() {
        serialPortUtil?.sendSerialPort("31")
    }



    override fun squeezeMoney() {
        serialPortUtil?.sendSerialPort("02")
    }
}