|
2 tahun lalu | |
---|---|---|
.idea | 2 tahun lalu | |
netAtSDK | 2 tahun lalu | |
server | 2 tahun lalu | |
services | 2 tahun lalu | |
.gitignore | 2 tahun lalu | |
README.md | 2 tahun lalu | |
config.toml | 2 tahun lalu | |
go.mod | 2 tahun lalu | |
go.sum | 2 tahun lalu | |
main.go | 2 tahun lalu |
type BaseArgs struct {
IMEI string
}
返回的lat, lng为原始坐标
GetGPSInfo
请求参数:
type BaseArgs struct {
IMEI string
}
type GPSInfoReply struct {
Lat float64
Lng float64
}
GetIMEI
请求参数:
type BaseArgs struct {
IMEI string
}
*string
GetICCID
go
type BaseArgs struct {
IMEI string
}
返回参数: *string
第一个参数 0 不启用该通道; 1 TCP/UDP 透传; 2 MQTT 透传; 3 塔石 DTU 云连接; 4 塔石 IOT 云连接; 5 HTTP 传输模式; 6 阿里云直连 B 取值范围 1~4,代表 4 个不同的 SOCKET 通道,省略时仅配置通道 1 默认值:+DTUMODE:1,0,0,0 默认第一路为 TCP/UDP 透传,其他几路为默认关闭
SetDTUMode
请求参数:
type SetDTUModeArgs struct {
BaseArgs
Mode int // 模式
Channel int // 通道
}
*string
A 取值范围 1-4,代表 4 个不同的 SOCKET 通道 B 为 TCP 或者 UDP C 为服务器地址,可填域名或 IP,长度最大 255 D 为端口号,范围 1~65535
SetServerAddr
go
type ServerAddrArgs struct {
BaseArgs
Channel int // 通道
LinkType string // 连接类型
Ip string // Ip或域名
Port int // 端口
}
返回参数: EmptyResult
GetServerAddr
BaseArgs
type Addr struct { Channel int // 通道 LinkType string // 连接类型 Addr string // IP或域名 Port int // 端口 }
#### 1.7 设置串口参数
格式:AT+UARTCFG=A,B,C,D
A 串口波特率,支持的波特率为 115200、57600、38400、19200、14400、9600、4800、 2400、1200
B 数据位,取值范围 0~1 0 7 位数据位 1 8 位数据位
C 校验位,取值范围 0~2 0 无校验 NONE 1 奇校验 ODD 2 偶校验 EVEN
D 停止位,取值范围 0~1 0 1 位停止位 1 2 位停止位
默认值:+UARTCFG:9600,1,0,0(9600,8,N,1)
* 方法名: `SetUARTParam`
* 请求参数:
```go
type UARTArgs struct {
BaseArgs
Rate int // 波特率
DBit int // 数据位
CBit int // 校验位
SBit int // 停止位
}
EmptyResult
返回值含义参考1.7说明
GetUARTParam
BaseArgs
返回参数:
type UARTReply struct {
Rate int // 波特率
DBit int // 数据位
CBit int // 校验位
SBit int // 停止位
}
SetDTUID
go
type DTUIDArgs struct {
BaseArgs
Mode int
IdType int
Format int
Content string
Channel int
}
返回参数: EmptyResult
GetDTUID
BaseArgs
type DTUIDReply struct {
DTUIDs []*DTUID
}
type DTUID struct {
Mode int
IdType int
Format int
Content string
Channel int
}
GetKeepAlive
BaseArgs
type KeepAliveReply struct {
Channels []*KeepAlive
}
type KeepAlive struct {
Duration int // 心跳间隔
Format int // 数据格式
Content string // 心跳包内容
Channel int // 通道
}
SetKeepAlive
请求参数:
type KeepAliveArgs struct {
BaseArgs
Duration int // 心跳间隔
Format int // 数据格式
Content string // 心跳包内容
Channel int // 通道
}
EmptyResult
A 自定义轮询使能,取值范围 0-1 0 关闭自定义轮询功能 1 开启自定义轮询功能 B 轮询时间间隔,取值范围 1-3600,表示每条启用指令间的时间间隔,单位秒 C 轮询数据输入格式,取值范围 0-1 0 ASCII 格式,设置为 0 表示之后输入的轮询指令均为以 ASCII 形式轮询, 即输入什么字串就轮询什么字串 1 HEX 格式, 设置为 1 表示之后输入的轮询指令需要满足 HEX 格式,轮 询时会自动转成 16 进制对应的 ASCII 字串 默认值:+POLL:0,10,1
SetPOLL
go
type PollArgs struct {
BaseArgs
Sw int // 是否使能
Duration int // 轮询间隔
Format int // 内容格式
}
返回参数: EmptyResult
GetPOLL
BaseArgs
返回参数:
type PollReply struct {
Sw int // 是否使能
Duration int // 轮询间隔
Format int // 内容格式
}
SetPollStr
go
type PollStrArgs struct {
BaseArgs
Index int // 轮询字串号,取值范围 1-10
Sw int // 字串轮询使能
Crc int // CRC使能
Content string // 轮询内容
}
返回参数: EmptyResult
GetPollStr
请求参数: BaseArgs
返回参数:
type PollStrReply struct {
Strings []*PollStr
}
type PollStr struct {
Sw int // 字串轮询使能
Crc int // CRC使能
Content string // 轮询内容
}