Documentation ¶
Overview ¶
package dashbutton allows users of dashbutton to detect dashbutton clicks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { HardwareAddr net.HardwareAddr IP net.IP }
Device contains network information of dash button.
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor sniff arp packets on specified network.
func NewInterceptor ¶
func NewInterceptor(iface *net.Interface) (*Interceptor, error)
New interceptor
func (*Interceptor) Add ¶
func (i *Interceptor) Add(dash net.HardwareAddr)
Add hardware address of dashbutton into watch group to detect clicks.
func (*Interceptor) Clicks ¶
func (i *Interceptor) Clicks() <-chan Device
Start loop and return channel which produces Device on click
func (*Interceptor) Close ¶
func (i *Interceptor) Close()
Close pcap handle and channels. loop will be stopped.
func (*Interceptor) Remove ¶
func (i *Interceptor) Remove(dash net.HardwareAddr)
Remove hardware address of dashbutton from watch group.
Click to show internal directories.
Click to hide internal directories.