Skip to content

Commit

Permalink
fix(ble): fix os_android and os_other function signature/name
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Jun 21, 2019
1 parent 94287b1 commit f8a4b8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/network/protocol/ble/driver/os_android.go
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions core/network/protocol/ble/driver/os_other.go
@@ -1,4 +1,4 @@
// +build !darwin,!android
// +build !android,!darwin

package driver

Expand All @@ -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() {}
Expand Down

0 comments on commit f8a4b8a

Please sign in to comment.