This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.go
51 lines (46 loc) · 1.66 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package ch912x
import (
"io"
"net"
)
type Module interface {
identity() (Kind, net.HardwareAddr)
moduleIP() net.IP
setClientMAC(net.HardwareAddr)
io.ReaderFrom
io.WriterTo
}
type ModuleOptions struct {
MAC net.HardwareAddr `json:"mac,omitempty"`
IP net.IP `json:"ip,omitempty"`
Mask net.IP `json:"mask,omitempty"`
Gateway net.IP `json:"gateway,omitempty"`
UseDHCP bool `json:"use_dhcp,omitempty"`
SerialNegotiate bool `json:"serial_negotiate,omitempty"`
EnabledMinorUART bool `json:"enabled_minor_uart,omitempty"`
}
type UARTService struct {
Mode UARTMode `json:"mode"`
ClientIP net.IP `json:"client_ip"`
ClientPort uint16 `json:"client_port"`
ClientDomain string `json:"client_domain"`
UseDomain bool `json:"use_domain"`
LocalPort uint16 `json:"local_port"`
PacketSize uint16 `json:"packet_size"`
PacketTimeout uint16 `json:"packet_timeout"`
RandomClientPort bool `json:"random_client_port,omitempty"`
CloseOnLost bool `json:"close_on_lost"`
ClearOnReconnect bool `json:"clear_on_reconnect"`
Baud uint32 `json:"baud"`
DataBits uint8 `json:"data_bits"`
StopBit uint8 `json:"stop_bit"`
Parity UARTParity `json:"parity"`
}
type NTPService struct {
Enabled bool `json:"enabled"`
Mode NTPMode `json:"mode"`
ClientIP net.IP `json:"client_ip"`
Polling uint16 `json:"polling"`
PulseOutput bool `json:"pulse_output"`
KeepAlive bool `json:"keep_alive"`
}