mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
new: aliases are now centralized and can be used for any type of device (closes #504)
This commit is contained in:
parent
96853e663b
commit
7e7f2ef645
11 changed files with 115 additions and 51 deletions
|
@ -42,6 +42,7 @@ type HIDDevice struct {
|
|||
sync.Mutex
|
||||
LastSeen time.Time
|
||||
Type HIDType
|
||||
Alias string
|
||||
Address string
|
||||
RawAddress []byte
|
||||
channels map[int]bool
|
||||
|
@ -53,6 +54,7 @@ type hidDeviceJSON struct {
|
|||
LastSeen time.Time `json:"last_seen"`
|
||||
Type string `json:"type"`
|
||||
Address string `json:"address"`
|
||||
Alias string `json:"alias"`
|
||||
Channels []string `json:"channels"`
|
||||
Payloads []string `json:"payloads"`
|
||||
PayloadsSize uint64 `json:"payloads_size"`
|
||||
|
@ -102,6 +104,7 @@ func (dev *HIDDevice) MarshalJSON() ([]byte, error) {
|
|||
LastSeen: dev.LastSeen,
|
||||
Type: dev.Type.String(),
|
||||
Address: dev.Address,
|
||||
Alias: dev.Alias,
|
||||
Channels: dev.channelsListUnlocked(),
|
||||
Payloads: make([]string, 0),
|
||||
PayloadsSize: dev.payloadsSz,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue