hex

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Byte2Str

func Byte2Str(src []byte) string

func FormatTime

func FormatTime(timeIns time.Time) string

func ParseTime

func ParseTime(timeStr string) time.Time

func ReadBCD

func ReadBCD(pkt []byte, idx *int, n int) string

对应JT808类型BCD[n]

func ReadByte

func ReadByte(pkt []byte, idx *int) uint8

对应JT808类型BYTE

func ReadBytes

func ReadBytes(pkt []byte, idx *int, n int) []byte

对应JT808类型BYTE[n]

func ReadDoubleWord

func ReadDoubleWord(pkt []byte, idx *int) uint32

对应JT808类型DWORD

func ReadGBK

func ReadGBK(pkt []byte, idx *int, n int) string

对应JT808类型String

func ReadString

func ReadString(pkt []byte, idx *int, n int) string

对应JT808类型BYTE[n]

func ReadTime

func ReadTime(pkt []byte, idx *int) *time.Time

输入JT808协议定义的时间format, 转换为time.Time

func ReadWord

func ReadWord(pkt []byte, idx *int) uint16

对应JT808类型WORD

func Str2Byte

func Str2Byte(src string) []byte

func WriteBCD

func WriteBCD(pkt []byte, bcd string) []byte

对应JT808类型BCD[n]

func WriteByte

func WriteByte(pkt []byte, num uint8) []byte

对应JT808类型BYTE

func WriteBytes

func WriteBytes(pkt, arr []byte) []byte

对应JT808类型BYTE[n]

func WriteDoubleWord

func WriteDoubleWord(pkt []byte, num uint32) []byte

对应JT808类型DWORD

func WriteGBK

func WriteGBK(pkt []byte, str string) []byte

对应JT808类型String

func WriteString

func WriteString(pkt []byte, str string) []byte

对应JT808类型BYTE[n]

func WriteTime

func WriteTime(pkt []byte, timeIns time.Time) []byte

输入time.Time, 转换为JT808协议定义的时间format

func WriteWord

func WriteWord(pkt []byte, num uint16) []byte

对应JT808类型WORD

Types

This section is empty.

Jump to

Keyboard shortcuts

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