mirror of
https://github.com/bettercap/bettercap.git
synced 2024-11-08 06:30:13 -08:00
35 lines
639 B
Go
35 lines
639 B
Go
package hid
|
|
|
|
import (
|
|
"github.com/bettercap/bettercap/v2/network"
|
|
)
|
|
|
|
type FrameBuilder interface {
|
|
BuildFrames(*network.HIDDevice, []*Command) error
|
|
}
|
|
|
|
var FrameBuilders = map[network.HIDType]FrameBuilder{
|
|
network.HIDTypeLogitech: LogitechBuilder{},
|
|
network.HIDTypeAmazon: AmazonBuilder{},
|
|
network.HIDTypeMicrosoft: MicrosoftBuilder{},
|
|
}
|
|
|
|
func availBuilders() []string {
|
|
return []string{
|
|
"logitech",
|
|
"amazon",
|
|
"microsoft",
|
|
}
|
|
}
|
|
|
|
func builderFromName(name string) FrameBuilder {
|
|
switch name {
|
|
case "amazon":
|
|
return AmazonBuilder{}
|
|
case "microsoft":
|
|
return MicrosoftBuilder{}
|
|
default:
|
|
return LogitechBuilder{}
|
|
}
|
|
}
|