iot

package
v0.0.0-...-1ae5343 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMqttClientId

func CreateMqttClientId(deviceId string, scopeConfig *config.ScopeConfig) string

func FormatTopic

func FormatTopic(topic, deviceId string) string

func GetDateTime

func GetDateTime(timeStr string) (time.Time, error)

func GetEventTimeStamp

func GetEventTimeStamp() string

GetEventTimeStamp 设备采集数据UTC时间(格式:yyyyMMdd'T'HHmmss'Z'),如:20161219T114920Z。 设备上报数据不带该参数或参数格式错误时,则数据上报时间以平台时间为准。

func GetServer

func GetServer() *model.ServerInfo

func GetTopicRequestId

func GetTopicRequestId(topic string) string

func HmacSha256

func HmacSha256(data string, secret string) (string, error)

func Interface2JsonString

func Interface2JsonString(v interface{}) string

func OsName

func OsName() string

func SavePwd

func SavePwd(server model.ServerInfo) error

func SdkInfo

func SdkInfo() map[string]string

func Sha256FromFile

func Sha256FromFile(filePath string) (int, string, error)

func SmartFileName

func SmartFileName(filename string) string

根据当前运行的操作系统重新修改文件路径以适配操作系统

func TimeStamp

func TimeStamp() string

时间戳:为设备连接平台时的UTC时间,格式为YYYYMMDDHH,如UTC 时间2018/7/24 17:56:20 则应表示为2018072417。

func VerifyConnection

func VerifyConnection(serverCaPool *x509.CertPool) func(stats tls.ConnectionState) error

VerifyConnection 使用自定义方式校验证书,忽略主机名校验

Types

type CircularQueue

type CircularQueue struct {
	// contains filtered or unexported fields
}

func NewCircularQueue

func NewCircularQueue(capacity int) *CircularQueue

func (*CircularQueue) Len

func (cq *CircularQueue) Len() int

func (*CircularQueue) Pop

func (cq *CircularQueue) Pop() interface{}

func (*CircularQueue) Push

func (cq *CircularQueue) Push(value interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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