Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
定义
Browse files Browse the repository at this point in the history
  • Loading branch information
zgwit committed Aug 18, 2024
1 parent 508a85c commit 7bbef82
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions rpc/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const (
DEVICE_DELETE
DEVICE_READ
DEVICE_WRITE
DEVICE_STATUS
DEVICE_EVENT
DEVICE_ACTION
)
Expand Down
11 changes: 11 additions & 0 deletions rpc/fs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package rpc

const (
FS_LIST uint8 = iota
FS_STATE
FS_DOWNLOAD
FS_UPLOAD
FS_REMOVE
FS_MOVE
FS_MKDIR
FS_FORMAT
)

type FsPath struct {
Path string `json:"path"`
}
Expand Down
7 changes: 7 additions & 0 deletions rpc/gateway.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package rpc

const (
GATEWAY_STATUS uint8 = iota
GATEWAY_EVENT
GATEWAY_SETTING
GATEWAY_METRICS
)

type GatewayStatusRequest struct {
Battery int `json:"battery,omitempty"`
Rssi int `json:"rssi,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions rpc/gpio.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package rpc

const (
GPIO_LIST uint8 = iota
GPIO_WRITE
GPIO_READ
GPIO_STATUS
)

type GpioPath struct {
Path string `json:"path"`
}
Expand Down
7 changes: 7 additions & 0 deletions rpc/product.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package rpc

const (
PRODUCT_LIST uint8 = iota
PRODUCT_DOWNLOAD
PRODUCT_UPLOAD
PRODUCT_DELETE
)

type ProductId struct {
Id string `json:"id"`
}
Expand Down
8 changes: 8 additions & 0 deletions rpc/serial.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package rpc

const (
SERIAL_LIST uint8 = iota
SERIAL_OPEN
SERIAL_CLOSE
SERIAL_WATCH
SERIAL_PIPE
)

type SerialId struct {
Id string `json:"id"`
}
Expand Down
9 changes: 9 additions & 0 deletions rpc/tcp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package rpc

const (
TCP_LIST uint8 = iota
TCP_CREATE
TCP_DELETE
TCP_RESTART
TCP_WATCH
TCP_PIPE
)

type TcpId struct {
Id string `json:"id"`
}
Expand Down

0 comments on commit 7bbef82

Please sign in to comment.