mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-17 13:23:26 +00:00
rtl8720dn: add support for rtl8720dn
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package rtl8720dn
|
||||
|
||||
import "io"
|
||||
|
||||
type RTL8720DN struct {
|
||||
port io.ReadWriter
|
||||
seq uint64
|
||||
received chan bool
|
||||
debug bool
|
||||
|
||||
connectionType ConnectionType
|
||||
socket int32
|
||||
client uint32
|
||||
length int
|
||||
root_ca *string
|
||||
}
|
||||
|
||||
type ConnectionType int
|
||||
|
||||
const (
|
||||
ConnectionTypeNone ConnectionType = iota
|
||||
ConnectionTypeTCP
|
||||
ConnectionTypeUDP
|
||||
ConnectionTypeTLS
|
||||
)
|
||||
|
||||
func New(r io.ReadWriter) *RTL8720DN {
|
||||
ret := &RTL8720DN{
|
||||
port: r,
|
||||
seq: 1,
|
||||
received: make(chan bool, 1),
|
||||
debug: false,
|
||||
}
|
||||
|
||||
go ret.readThread()
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (r *RTL8720DN) SetSeq(s uint64) {
|
||||
r.seq = s
|
||||
}
|
||||
|
||||
func (r *RTL8720DN) Debug(b bool) {
|
||||
r.debug = b
|
||||
}
|
||||
|
||||
func (r *RTL8720DN) SetRootCA(s *string) {
|
||||
r.root_ca = s
|
||||
}
|
||||
|
||||
func (r *RTL8720DN) Version() (string, error) {
|
||||
return r.Rpc_system_version()
|
||||
}
|
||||
Reference in New Issue
Block a user