Documentation ¶
Index ¶
- Constants
- func EliminateChecksum(data []byte) []byte
- func EliminateIdentityBit(data []byte) []byte
- type ErrReader
- type ErrWrite
- func (ew *ErrWrite) Write(p []byte)
- func (ew ErrWrite) WriteBCD(s string, length int)
- func (ew ErrWrite) WriteByte(c byte)
- func (ew ErrWrite) WriteString(s string)
- func (ew ErrWrite) WriteStringWithFill(s string, maxLength int, from StartingEnd)
- func (ew ErrWrite) WriteUint16(data uint16)
- func (ew ErrWrite) WriteUint32(data uint32)
- func (ew ErrWrite) WriteUint8(data uint8)
- type Reader
- type StartingEnd
- type Writer
- func (w Writer) WriteBCD(s string, length int) error
- func (w Writer) WriteData(data []byte, maxLength int, from StartingEnd) error
- func (w Writer) WriteString(s string) error
- func (w Writer) WriteStringWithFill(s string, maxLength int, from StartingEnd) error
- func (w Writer) WriteUint16(data uint16) error
- func (w Writer) WriteUint32(data uint32) error
- func (w Writer) WriteUint8(data uint8) error
Constants ¶
View Source
const Escape uint8 = 0x7d
View Source
const IdentityBit uint8 = 0x7e
IdentityBit 标识位
Variables ¶
This section is empty.
Functions ¶
func EliminateIdentityBit ¶
EliminateIdentityBit 去除首尾校验码
Types ¶
type ErrReader ¶
func (*ErrReader) ReadString ¶
func (*ErrReader) ReadUint16 ¶
func (*ErrReader) ReadUint32 ¶
type ErrWrite ¶
func (ErrWrite) WriteString ¶
func (ErrWrite) WriteStringWithFill ¶
func (ew ErrWrite) WriteStringWithFill(s string, maxLength int, from StartingEnd)
func (ErrWrite) WriteUint16 ¶
func (ErrWrite) WriteUint32 ¶
func (ErrWrite) WriteUint8 ¶
type StartingEnd ¶
type StartingEnd int
StartingEnd 起始端
const ( // Front 前置占位 Front StartingEnd = iota // Behind 后置占位 Behind )
type Writer ¶
Writer JTT808数据缓冲写入对象
func (Writer) WriteData ¶
func (w Writer) WriteData(data []byte, maxLength int, from StartingEnd) error
WriteData 写入数据
func (Writer) WriteString ¶
func (Writer) WriteStringWithFill ¶
func (w Writer) WriteStringWithFill(s string, maxLength int, from StartingEnd) error
Click to show internal directories.
Click to hide internal directories.