mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-13 19:33:39 +00:00
add EthLinkPoller;
This commit is contained in:
+12
-2
@@ -6,8 +6,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:linkname UseNetdev net.useNetdev
|
//go:linkname UseStack net.useNetdev
|
||||||
func UseNetdev(dev Stack)
|
func UseStack(stack Stack)
|
||||||
|
|
||||||
// GethostByName() errors
|
// GethostByName() errors
|
||||||
var (
|
var (
|
||||||
@@ -61,6 +61,16 @@ type Link interface {
|
|||||||
LinkStatus() LinkStatus
|
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 {
|
type LinkWifi interface {
|
||||||
Link
|
Link
|
||||||
// Connect device to network
|
// Connect device to network
|
||||||
|
|||||||
Reference in New Issue
Block a user