cmds

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

* @Author: Keven * @version: v1.0.1 * @Date: 2021-09-28 13:31:03 * @LastEditors: Keven * @LastEditTime: 2021-09-28 13:31:03

* @Author: Feng * @version: v1.0.0 * @Date: 2020-07-10 15:56:51 * @LastEditors: Keven * @LastEditTime: 2021-09-28 13:36:37

Index

Constants

This section is empty.

Variables

View Source
var CRC16MODBUS = &crc.Parameters{Width: 16, Polynomial: 0x8005, Init: 0xFFFF, ReflectIn: true, ReflectOut: true, FinalXor: 0x0}

CRC16MODBUS crc 校验参数

Functions

func CmdWithCrc

func CmdWithCrc(cmd string) (cmdcrc string)

CmdWithCrc return cmd string with crc

func CopenDoor

func CopenDoor(ip, mes string) (err error)

func SerialSend

func SerialSend(cmd, serName, serBaud string, checkCrc, crcLH bool, crcType *crc.Parameters) (res string, err error)

SerialSend 发送 串口命令,返回数据

  • @params: cmd 命令字串,checkCrc 是否检查crc, crcType检查的crc 类型,crcLH 是否大端开头
  • @return:res 返回数据,err 错误

Types

type Cabinet2Cmd

type Cabinet2Cmd struct {
}

func (*Cabinet2Cmd) OpenDoorCmd

func (c2 *Cabinet2Cmd) OpenDoorCmd(cno, doorno int) (err error)

func (*Cabinet2Cmd) StatusCmd

func (c2 *Cabinet2Cmd) StatusCmd(cno int) (doors []string, errs []ErrAll, err error)

func (*Cabinet2Cmd) UnsetDayCmd

func (c2 *Cabinet2Cmd) UnsetDayCmd(cno int) (unsetDay UnSetDay, err error)

func (*Cabinet2Cmd) YqdatasCmd

func (c2 *Cabinet2Cmd) YqdatasCmd(cno int) (yqdata YqData, err error)

type ErrAll

type ErrAll struct {
	Ingrid     int
	Charging   string
	ChargeFull string
	Haserr     int
	Battery    string
	No2        string
	No         string
	So2        string
	H2         string
	H2s        string
	Co2        string
	Co         string
	O2         string
	Ch4        string
}

func Cstatus

func Cstatus(ip, cmd string) (cdoors []string, cerrs []ErrAll, err error)

Cstatus * * todo:need test * @msg: * @param Cstatusl * @return:

type PositionData

type PositionData struct {
	PositionID int
	Date       time.Time
	CH4        int
	O2         int
	CO         int
}

type UnSetDay

type UnSetDay struct {
	DoorNo int
	YqType string
	CH4    unZeroValid
	O2     unZeroValid
	CO     unZeroValid
	CO2    unZeroValid
	H2S    unZeroValid
	H2     unZeroValid
	SO2    unZeroValid
	NO     unZeroValid
	NO2    unZeroValid
}

func CunSetDay

func CunSetDay(ip, mes string) (unset UnSetDay, err error)

type YqData

type YqData struct {
	DataID int
	DoorNo int
	Datas  []PositionData
}

func Cyqdatas

func Cyqdatas(ip, mes string) (yqData YqData, err error)

*

  • Cyqdatas 处理 仪器定位点数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL