diff --git a/bluetooth/manager.go b/bluetooth/manager.go index bea57c7..5c6a566 100644 --- a/bluetooth/manager.go +++ b/bluetooth/manager.go @@ -302,6 +302,15 @@ func (m *BluetoothManager) ConnectNetwork(address string) error { return fmt.Errorf("bnep0 interface is not up") } + if m.wsHub != nil { + m.wsHub.Broadcast(utils.WebSocketEvent{ + Type: "bluetooth/network/connect", + Payload: utils.NetworkConnectedPayload{ + Address: address, + }, + }) + } + return nil } diff --git a/utils/types.go b/utils/types.go index 1cfa7fd..76f869d 100644 --- a/utils/types.go +++ b/utils/types.go @@ -39,4 +39,8 @@ type DeviceDisconnectedPayload struct { type DevicePairedPayload struct { Device *BluetoothDeviceInfo `json:"device"` +} + +type NetworkConnectedPayload struct { + Address string `json:"address"` } \ No newline at end of file