mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-03 06:27:47 +00:00
add EthLinkPoller;
This commit is contained in:
+12
-2
@@ -6,8 +6,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//go:linkname UseNetdev net.useNetdev
|
||||
func UseNetdev(dev Stack)
|
||||
//go:linkname UseStack net.useNetdev
|
||||
func UseStack(stack Stack)
|
||||
|
||||
// GethostByName() errors
|
||||
var (
|
||||
@@ -61,6 +61,16 @@ type Link interface {
|
||||
LinkStatus() LinkStatus
|
||||
}
|
||||
|
||||
type EthLinkPoller interface {
|
||||
Link
|
||||
// SendEth sends an Ethernet packet
|
||||
SendEth(pkt []byte) error
|
||||
// RecvEthHandle sets recieve Ethernet packet callback function
|
||||
RecvEthHandle(func(pkt []byte) error)
|
||||
// PollOne tries to receive one Ethernet packet and returns true if one was
|
||||
PollOne() (bool, error)
|
||||
}
|
||||
|
||||
type LinkWifi interface {
|
||||
Link
|
||||
// Connect device to network
|
||||
|
||||
Reference in New Issue
Block a user