From f8a4b8a7effbccdbaf94be7c6fd0bc61cae2d638 Mon Sep 17 00:00:00 2001 From: aeddi Date: Fri, 21 Jun 2019 16:33:05 +0200 Subject: [PATCH] fix(ble): fix os_android and os_other function signature/name --- .../gomobile/core/{android_ble.go => os_android.go} | 6 +++--- core/network/protocol/ble/driver/os_android.go | 2 +- core/network/protocol/ble/driver/os_other.go | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) rename client/react-native/gomobile/core/{android_ble.go => os_android.go} (95%) diff --git a/client/react-native/gomobile/core/android_ble.go b/client/react-native/gomobile/core/os_android.go similarity index 95% rename from client/react-native/gomobile/core/android_ble.go rename to client/react-native/gomobile/core/os_android.go index f7c4f573dc..53a05d67e3 100644 --- a/client/react-native/gomobile/core/android_ble.go +++ b/client/react-native/gomobile/core/os_android.go @@ -12,15 +12,15 @@ import ( func initBleFunc() { // TODO: Refactor this, see core/network/protocol/ble/driver/os_android.go + bledrv.InitScannerAndAdvertiser = BleManager.InitBluetoothService + bledrv.CloseScannerAndAdvertiser = BleManager.CloseBluetoothService bledrv.SetMa = BleManager.SetMultiAddr bledrv.SetPeerID = BleManager.SetPeerID bledrv.StartScanning = BleManager.StartScanning bledrv.StartAdvertising = BleManager.StartAdvertising bledrv.Write = DeviceManager.WriteToDevice bledrv.DialPeer = DeviceManager.DialPeer - bledrv.InitScannerAndAdvertiser = BleManager.InitBluetoothService - bledrv.CloseScannerAndAdvertiser = BleManager.CloseBluetoothService - bledrv.CloseConnFromMa = DeviceManager.DisconnectFromDevice + bledrv.CloseConnWithDevice = DeviceManager.DisconnectFromDevice } // TODO: Rename this function diff --git a/core/network/protocol/ble/driver/os_android.go b/core/network/protocol/ble/driver/os_android.go index b72d5c7330..ecd6e4cd99 100644 --- a/core/network/protocol/ble/driver/os_android.go +++ b/core/network/protocol/ble/driver/os_android.go @@ -17,7 +17,7 @@ ConnClosedWithDevice(remoteMa string) NotifyPeerFound(remoteAddr string, remoteID string) */ -var InitScannerAndAdvertiser func() bool = nil +var InitScannerAndAdvertiser func() = nil var CloseScannerAndAdvertiser func() = nil var SetMa func(string) = nil diff --git a/core/network/protocol/ble/driver/os_other.go b/core/network/protocol/ble/driver/os_other.go index 9f194f57a8..73fe9ae419 100644 --- a/core/network/protocol/ble/driver/os_other.go +++ b/core/network/protocol/ble/driver/os_other.go @@ -1,4 +1,4 @@ -// +build !darwin,!android +// +build !android,!darwin package driver @@ -15,11 +15,11 @@ See client/react-native/gomobile/core/android_ble.go */ // Noop implementation for platform that are not Darwin or Android -func InitScannerAndAdvertiser() bool { return false } -func CloseScannerAndAdvertiser() bool { return false } +func InitScannerAndAdvertiser() {} +func CloseScannerAndAdvertiser() {} -func setMa(_ string) {} -func setPeerID(_ string) {} +func SetMa(_ string) {} +func SetPeerID(_ string) {} func StartScanning() {} func StartAdvertising() {}