package com.flightfeather.uav.socket.processor
|
|
import com.flightfeather.uav.common.utils.FileUtil
|
import com.flightfeather.uav.socket.DeviceSession
|
import io.netty.channel.ChannelHandlerContext
|
import java.text.SimpleDateFormat
|
import java.util.*
|
|
abstract class BaseProcessor {
|
|
abstract var tag: String
|
|
val deviceSession = DeviceSession()
|
|
abstract fun dealStringMsg(msg: String, ctx: ChannelHandlerContext?)
|
|
/**
|
* 保存至txt文本
|
*/
|
fun saveToTxt(msg: String) {
|
val data = "[${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}]data=> $msg"
|
FileUtil.instance?.saveObdData(data)
|
}
|
}
|