1 Star 0 Fork 0

威芯星智能科技(苏州)有限公司/weemesh-go-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
device_management.go 908 Bytes
一键复制 编辑 原始数据 按行查看 历史
package weemesh
import (
"net/http"
"net/url"
)
func (c *Client) GetDeviceState(sn string) (*CommonResult[bool], error) {
params := url.Values{}
params.Set("sn", sn)
request, err := http.NewRequest(http.MethodGet, c.address+"/device/state?"+params.Encode(), nil)
if err != nil {
return nil, err
}
return newRequest[bool](request, c)
}
func (c *Client) GetDeviceLatestProperty(sn string) (*CommonResult[map[string]interface{}], error) {
request, err := http.NewRequest(http.MethodGet, c.address+"/device/"+sn+"/latestProperty", nil)
if err != nil {
return nil, err
}
return newRequest[map[string]interface{}](request, c)
}
func (c *Client) GetDevice(sn string) (*CommonResult[map[string]interface{}], error) {
request, err := http.NewRequest(http.MethodGet, c.address+"/device/"+sn, nil)
if err != nil {
return nil, err
}
return newRequest[map[string]interface{}](request, c)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/winstar-smart/weemesh-go-sdk.git
git@gitee.com:winstar-smart/weemesh-go-sdk.git
winstar-smart
weemesh-go-sdk
weemesh-go-sdk
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385