mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
new: exposing flags and connectable fields for BLE devices in api.rest
This commit is contained in:
parent
384815524f
commit
e90c6b5e2d
1 changed files with 14 additions and 10 deletions
|
@ -24,6 +24,8 @@ type bleDeviceJSON struct {
|
|||
MAC string `json:"mac"`
|
||||
Vendor string `json:"vendor"`
|
||||
RSSI int `json:"rssi"`
|
||||
Connectable bool `json:"connectable"`
|
||||
Flags string `json:"flags"`
|
||||
}
|
||||
|
||||
func NewBLEDevice(p gatt.Peripheral, a *gatt.Advertisement, rssi int) *BLEDevice {
|
||||
|
@ -55,6 +57,8 @@ func (d *BLEDevice) MarshalJSON() ([]byte, error) {
|
|||
MAC: d.Device.ID(),
|
||||
Vendor: d.Vendor,
|
||||
RSSI: d.RSSI,
|
||||
Connectable: d.Advertisement.Connectable,
|
||||
Flags: d.Advertisement.Flags.String(),
|
||||
}
|
||||
return json.Marshal(doc)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue