utils

package
v0.0.0-...-d22efa2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Windows      = "windows"
	Linux_a7     = "linux_a7"
	Linux_nano   = "linux_nano"
	Linux_nano46 = "linux_nano_46"
	Linux_rk3568 = "linux_rk3568" //4.19.193
	// Linux_nx       = "linux_nx"
	Linux_3352     = "linux_3352" //3.2.0
	Linux_desk     = "Linux_desk"
	Linux_jetson_5 = "linux_jetson_5"
)

Variables

View Source
var CRC16Table = []uint16{}/* 256 elements not displayed */
View Source
var CRC16TableRfid = [256]uint16{}/* 256 elements not displayed */

Functions

func BashOutput

func BashOutput(write string) (string, error)

************************************************************************* * 函数名称: BashOutput * 功能描述: bash脚本输出得到信息 * 输入参数: write 要输出脚本的写入值 * 返 回 值: string 返回值 * 其它说明: 无 *************************************************************************

func CRC16CheckSum

func CRC16CheckSum(data []byte) uint16

func CRC16RFIDSum

func CRC16RFIDSum(data []byte) uint16

func ChangeNetworInterfaces

func ChangeNetworInterfaces(newIP, newGate, newMak string)

修改/etc/network/interfaces文件

func DnsSet

func DnsSet(dns1, dns2 string)

设置dns

func GetBetweenStr

func GetBetweenStr(str, start, end string) string

func GetCurrentTime

func GetCurrentTime() int64

获取当前系统时间,返回int64

func GetEthIp

func GetEthIp(lan string) string

获取设备本机的ip地址

func GetEthIpByte

func GetEthIpByte(lan string) []byte

获取设备本机的ip地址[]byte格式

func GetEthMac

func GetEthMac(lan string) (string, error)

获取设备本机的mac地址

func GetEthMacByte

func GetEthMacByte(lan string) []byte

获取设备本机的mac地址 []byte格式

func GetEthStatus

func GetEthStatus(lan string) (bool, error)

获取设备本机网口的连接状态

func GetExpendTime

func GetExpendTime(startTime time.Time) int64

输入time.Time 获取两个时间间隔,返回int64

func GetInterfaces

func GetInterfaces(lan string) (net.Interface, error)

获取设备本机的mac地址

func GetInterval

func GetInterval(lasttime int64) int64

获取两个时间间隔,返回int64

func GetIpFormXaddr

func GetIpFormXaddr(xaddr string) string

func GetPlatform

func GetPlatform() string

************************************************************************* * 函数名称: GetPlatform * 功能描述: 获取当前所在的平台 * 输入参数: 无 * 返 回 值: string 所在平台名称 * 其它说明: 无 *************************************************************************

func GetPlatformValue

func GetPlatformValue() string

直接取值,不会每次都调用系统参数

func GetSetSystem

func GetSetSystem(url string) bool

通过ntp获取系统时间

func GetTimeInterval

func GetTimeInterval(startTime time.Time, endTime time.Time) int64

获取两个时间的间隔

func GetWorkPath

func GetWorkPath() string

func GetuIntString

func GetuIntString(digit uint) string

func RebootSystem

func RebootSystem()

func SetSystemTime

func SetSystemTime(dateTime string)

设置系统时间

func SetTimeToHardSystem

func SetTimeToHardSystem()

把当前时间写入硬件系统

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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