Documentation
¶
Index ¶
- Variables
- func BCDToByte(b byte) int
- func BCDToFloat32(bcd []byte, format string, endian binary.ByteOrder) (float32, error)
- func BCDToTime(bcd []byte) (time.Time, error)
- func BcdToDigits(bcd []byte) string
- func BytesToFloat32(bytes []byte) float32
- func BytesToInt64(bytes []byte) int64
- func BytesToSpacedHex(data []byte) string
- func BytesToUint32(bytes []byte) uint32
- func Float32ToBCD(value float32, format string, endian binary.ByteOrder) ([]byte, error)
- func GetProjectRoot() string
- func InitLogger()
- func InterfaceToFloat32(i interface{}) (float32, error)
- func InterfaceToUint32(i interface{}) (uint32, error)
- func ReverseBytes(src []byte) []byte
- func StringToBCD(digits string, endian binary.ByteOrder) ([]byte, error)
- func TimeToBCD(t time.Time) []byte
- func Uint8ToBCD(value uint8) byte
Constants ¶
This section is empty.
Variables ¶
View Source
var LogFile *os.File
Functions ¶
func BCDToFloat32 ¶
BCDToFloat32 将BCD码字节数组转换为float32数值,支持不同字节序
func BytesToSpacedHex ¶
BytesToSpacedHex 将字节切片转换为每两个字符用空格分隔的十六进制字符串,不足的补0
func Float32ToBCD ¶
Float32ToBCD 将float32数值转换为BCD码字节数组,支持不同数据格式和字节序
func GetProjectRoot ¶
func GetProjectRoot() string
func InitLogger ¶
func InitLogger()
func InterfaceToFloat32 ¶
func InterfaceToUint32 ¶
func ReverseBytes ¶
func StringToBCD ¶
将数字字符串转换为BCD码(小端序)
func Uint8ToBCD ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.