Skip to content
This repository was 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 11, 2024
1 parent aa1aca4 commit c85f2fa
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 14 deletions.
1 change: 0 additions & 1 deletion rpc/channel.go

This file was deleted.

8 changes: 2 additions & 6 deletions rpc/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ type FsItem struct {
Time int64 `json:"time,omitempty"`
}

type FsStream struct {
Stream uint16 `json:"stream"`
}

type FsSearchRequest FsPath

type FsSearchResponse []FsItem

type FsDownloadRequest FsPath

type FsDownloadResponse FsStream
type FsDownloadResponse StreamId

type FsUploadRequest FsPath

type FsUploadResponse FsStream
type FsUploadResponse StreamId

type FsDeleteRequest FsPath

Expand Down
14 changes: 14 additions & 0 deletions rpc/ota.go
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
package rpc

type OtaVersionRequest struct{}

type OtaVersionResponse map[string]any

type OtaUploadRequest struct{}

type OtaUploadResponse StreamId

type OtaResultRequest struct {
Version string `json:"version"`
}

type OtaResultResponse struct{}
1 change: 0 additions & 1 deletion rpc/payload.go

This file was deleted.

8 changes: 2 additions & 6 deletions rpc/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ type ProductItem struct {
Version string `json:"version"`
}

type ProductStream struct {
Stream uint16 `json:"stream"`
}

type ProductListRequest struct{}

type ProductListResponse []ProductItem

type ProductDownloadRequest ProductId

type ProductDownloadResponse ProductStream
type ProductDownloadResponse StreamId

type ProductUploadRequest ProductId

type ProductUploadResponse ProductStream
type ProductUploadResponse StreamId

type ProductDeleteRequest ProductId

Expand Down
38 changes: 38 additions & 0 deletions rpc/serial.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package rpc

type SerialId struct {
Id string `json:"id"`
}

type SerialItem struct {
Id string `json:"id"` //COM1 COM2 /dev/ttyS1
Name string `json:"name,omitempty"`
Options SerialOptions `json:"options"`
}

type SerialOptions struct {
BaudRate int `json:"baud_rate,omitempty"` // 9600 115200 ...
DataBits int `json:"data_bits,omitempty"` // 7 8
StopBits int `json:"stop_bits,omitempty"` // 1 2
ParityMode string `json:"parity_mode,omitempty"` // N E O 0 1
}

type SerialListRequest struct{}

type SerialListResponse []SerialItem

type SerialOpenRequest SerialItem

type SerialOpenResponse struct{}

type SerialCloseRequest SerialId

type SerialCloseResponse struct{}

type SerialWatchRequest SerialId

type SerialWatchResponse StreamId

type SerialPipeRequest SerialId

type SerialPipeResponse StreamId
4 changes: 4 additions & 0 deletions rpc/stream.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package rpc

type StreamId struct {
Id string `json:"id"`
}

type Stream struct {
}
41 changes: 41 additions & 0 deletions rpc/tcp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package rpc

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

type TcpItem struct {
Id string `json:"id"`
Name string `json:"name,omitempty"`
Options TcpOptions `json:"options"`
}

type TcpOptions struct {
IsServer bool `json:"is_server,omitempty"`
Host string `json:"host"`
Port int `json:"port"`
}

type TcpListRequest struct{}

type TcpListResponse []TcpItem

type TcpCreateRequest TcpItem

type TcpCreateResponse struct{}

type TcpDeleteRequest TcpId

type TcpDeleteResponse struct{}

type TcpRestartRequest TcpId

type TcpRestartResponse struct{}

type TcpWatchRequest TcpId

type TcpWatchResponse StreamId

type TcpPipeRequest TcpId

type TcpPipeResponse StreamId

0 comments on commit c85f2fa

Please sign in to comment.