diff --git a/README.md b/README.md new file mode 100644 index 00000000..0e8819f6 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Transmitter classes : https://github.com/JohanDegraeve/xdripswift/blob/master/xdrip/Transmitter/README.md + +Calibration protocol : https://github.com/JohanDegraeve/xdripswift/tree/master/xdrip/Calibration \ No newline at end of file diff --git a/xdrip/Transmitter/CGMBluetoothTransmitter/CGMTransmitterDelegate.swift b/xdrip/Transmitter/CGMBluetoothTransmitter/CGMTransmitterDelegate.swift index 9c095539..278a79e8 100644 --- a/xdrip/Transmitter/CGMBluetoothTransmitter/CGMTransmitterDelegate.swift +++ b/xdrip/Transmitter/CGMBluetoothTransmitter/CGMTransmitterDelegate.swift @@ -8,7 +8,7 @@ protocol CGMTransmitterDelegate:AnyObject { /// transmitter reaches final connection status /// /// needs to be called by deriving specific transmitter class, example in CGMG4xDripTransmitter, the function is called only when subscription to read characteristic has succeeded, whereas for other like MiaoMiao, the function is called as soon as real connection is made - func cgmTransmitterDidConnect() + func cgmTransmitterDidConnect(address:String?, name:String?) /// transmitter did disconnect func cgmTransmitterDidDisconnect() diff --git a/xdrip/Transmitter/CGMBluetoothTransmitter/G4/CGMG4xDripTransmitter.swift b/xdrip/Transmitter/CGMBluetoothTransmitter/G4/CGMG4xDripTransmitter.swift index 4942f3d2..05907e3d 100644 --- a/xdrip/Transmitter/CGMBluetoothTransmitter/G4/CGMG4xDripTransmitter.swift +++ b/xdrip/Transmitter/CGMBluetoothTransmitter/G4/CGMG4xDripTransmitter.swift @@ -50,7 +50,8 @@ final class CGMG4xDripTransmitter: BluetoothTransmitter, BluetoothTransmitterDel // MARK: - BluetoothTransmitterDelegate functions - func centralManagerDidConnect() { + func centralManagerDidConnect(address:String?, name:String?) { + cgmTransmitterDelegate?.cgmTransmitterDidConnect(address: address, name: name) } func centralManagerDidFailToConnect(error: Error?) { @@ -65,9 +66,7 @@ final class CGMG4xDripTransmitter: BluetoothTransmitter, BluetoothTransmitterDel } func peripheralDidUpdateNotificationStateFor(characteristic: CBCharacteristic, error: Error?) { - os_log("in peripheralDidUpdateNotificationStateFor, it's an xdrip, assuming here full connect status", log: log, type: .info) - //In Spike and iosxdripreader, a device connection completed is transmitted in this case - cgmTransmitterDelegate?.cgmTransmitterDidConnect() + os_log("in peripheralDidUpdateNotificationStateFor", log: log, type: .info) } func peripheralDidUpdateValueFor(characteristic: CBCharacteristic, error: Error?) { diff --git a/xdrip/Transmitter/CGMBluetoothTransmitter/G5/CGMG5Transmitter.swift b/xdrip/Transmitter/CGMBluetoothTransmitter/G5/CGMG5Transmitter.swift index 297f303c..f4424974 100644 --- a/xdrip/Transmitter/CGMBluetoothTransmitter/G5/CGMG5Transmitter.swift +++ b/xdrip/Transmitter/CGMBluetoothTransmitter/G5/CGMG5Transmitter.swift @@ -178,8 +178,8 @@ class CGMG5Transmitter:BluetoothTransmitter, BluetoothTransmitterDelegate, CGMTr // MARK: BluetoothTransmitterDelegate functions - func centralManagerDidConnect() { - cgmTransmitterDelegate?.cgmTransmitterDidConnect() + func centralManagerDidConnect(address:String?, name:String?) { + cgmTransmitterDelegate?.cgmTransmitterDidConnect(address: address, name: name) } func centralManagerDidFailToConnect(error: Error?) { diff --git a/xdrip/Transmitter/CGMBluetoothTransmitter/MiaoMiao/CGMMiaoMiaoTransmitter.swift b/xdrip/Transmitter/CGMBluetoothTransmitter/MiaoMiao/CGMMiaoMiaoTransmitter.swift index ba954e93..c22b8a6d 100644 --- a/xdrip/Transmitter/CGMBluetoothTransmitter/MiaoMiao/CGMMiaoMiaoTransmitter.swift +++ b/xdrip/Transmitter/CGMBluetoothTransmitter/MiaoMiao/CGMMiaoMiaoTransmitter.swift @@ -78,8 +78,8 @@ class CGMMiaoMiaoTransmitter:BluetoothTransmitter, BluetoothTransmitterDelegate, // MARK: - BluetoothTransmitterDelegate functions - func centralManagerDidConnect() { - cgmTransmitterDelegate?.cgmTransmitterDidConnect() + func centralManagerDidConnect(address:String?, name:String?) { + cgmTransmitterDelegate?.cgmTransmitterDidConnect(address: address, name: name) } func centralManagerDidFailToConnect(error: Error?) { diff --git a/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitter.swift b/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitter.swift index acb88a44..aa178eee 100644 --- a/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitter.swift +++ b/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitter.swift @@ -278,7 +278,7 @@ class BluetoothTransmitter: NSObject, CBCentralManagerDelegate, CBPeripheralDele os_log("connected, will discover services", log: log, type: .info) peripheral.discoverServices(services) - bluetoothTransmitterDelegate?.centralManagerDidConnect() + bluetoothTransmitterDelegate?.centralManagerDidConnect(address: deviceAddress, name: deviceName) } func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { diff --git a/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitterDelegate.swift b/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitterDelegate.swift index 243672cf..dfaeec43 100644 --- a/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitterDelegate.swift +++ b/xdrip/Transmitter/GenericBluetoothTransmitter/BluetoothTransmitterDelegate.swift @@ -8,7 +8,10 @@ import CoreBluetooth protocol BluetoothTransmitterDelegate:AnyObject { /// called when centralManager didConnect was called in BlueToothTransmitter class /// the BlueToothTransmitter class handles the reconnect but the delegate class can for instance show the connection status to the user - func centralManagerDidConnect() + /// - parameters: + /// - address: the address that was received from the transmitter during connection phase + /// - name: the name that was received from the transmitter during connection phase + func centralManagerDidConnect(address:String?, name:String?) /// called when centralManager didFailToConnect was called in BlueToothTransmitter class /// the BlueToothTransmitter class handles will try to reconnect but the delegate class can for instance show the connection status to the user diff --git a/xdrip/Transmitter/README.html b/xdrip/Transmitter/README.html index 2c7df258..379d9ddb 100644 --- a/xdrip/Transmitter/README.html +++ b/xdrip/Transmitter/README.html @@ -19,7 +19,10 @@
  • conform to protocol CGMTransmitter
  • extend class BluetoothTransmitter
  • - +
  • Implement the specific protocol +
  • Available CGM transmitter classes
  • +
  • Use a transmitter class
  • Summary

    @@ -83,19 +82,23 @@ connect and reconnect, connect after app launch

    The protocol BluetoothTransmitterDelegate defines functions that allow to pass bluetooth activity information from the BluetoothTransmitter class to a specific transmitter class. Example when a disconnect occurs, the BlueToothTransmitter class handles the reconnect but the delegate class can for instance show the connection status to the user. It will be informed about -the connection status via the function centralManagerDidConnect in the BluetoothTransmitterDelegate

    +the connection status via the function centralManagerDidConnect in the BluetoothTransmitterDelegate.

    -

    CGMTransmitter defines functions that CGM transmitter classes need to implement.

    +

    The CGMTransmitter protocol defines functions that CGM transmitter classes need to implement.

    The CGM transmitter communicates back to the caller via the CGMTransmitterDelegate protocol.
    Needs to be conformed to, for instance by a view controller, or manager, .. whatever
    This protocol allows passing information like new readings, sensor detected, and also connect/disconnect, bluetooth status change

    -

    Following specific transmitter classes exist:
    -CGMG4xDripTransmitter
    -CGMG5Transmitter

    +

    Following specific transmitter classes exist:

    -

    Steps for adding new (CGM) transmitter types

    + + +

    Steps to adding new (CGM) transmitter types

    Every new type of bluetoothtransmitter needs to

    @@ -112,7 +115,9 @@ This protocol allows passing information like new readings, sensor detected, and

    conform to protocol BluetoothTransmitterDelegate

    -

    The functions that not be implemented:

    +

    The protocol is used to pass back information from the BluetoothTransmitter class to the specific Transmitter class.

    + +

    The functions that need to be implemented:

    func centralManagerDidConnect()

    @@ -153,6 +158,18 @@ For other types of transmitters there may be nothing to do.

    can the cgm transmitter detect that a new sensor is placed ? Will return true only for Libre type of transmitters, eg MiaoMiao
    If it returns true the the transmitter should also use newSensorDetected

    +

    address

    + +

    This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it.

    + +

    name

    + +

    This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it.

    + +

    startScanning

    + +

    This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it.

    +

    extend class BluetoothTransmitter

    A new transmitter class needs to extend BluetoothTransmitter and

    @@ -208,6 +225,8 @@ The advantage of scanning with advertisement UUID is that the app can also scan

    The new transmitter class needs to store a property of type CGMTransmitterDelegate
    This is used to pass back information to the controller

    +

    Define it as a weak var

    +

    Functions in CGMTransmitterDelegate:

    cgmTransmitterDidConnect

    @@ -234,63 +253,100 @@ This will typically be called in centralManagerDidUpdateState

    When a sensor is not detected, only applicable to transmitters that have this functionality

    -

    newReadingsReceived

    +

    cgmTransmitterInfoReceived

    This is the most important function, it passes new readings to the delegate

    +

    also battery info, sensor state, firmware & hardware info if applicable

    +

    transmitterNeedsPairing

    The transmitter needs pairing, app should give warning to user to keep the app in the foreground

    -

    Functions and properties available in transmitter classes

    +

    Implement the transmitter protocol

    -

    Functions in BluetoothTransmitter classes

    +

    The specific protocol needs to be implemented.

    -

    disconnect

    +

    See as example already existing cgm transmitter classes.

    + +

    All functions in the parent class can be overriden.

    + +

    Following additional functions can be used :

    + +

    Functions and properties available in transmitter classes

    + +

    Functions in BluetoothTransmitter classes

    + +

    These functions should only be used by classes that extend the BluetoothTransmitter class.

    + +
    disconnect

    will call centralManager.cancelPeripheralConnection

    -

    startScanning

    +
    startScanning

    Will scan for the device.
    This should only be used the first time the app connects to a specific device and should not be done for transmittertypes that -start scanning at initialization
    -//TODO: needs more clarification

    +start scanning at initialization

    -

    writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool

    +
    writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool
    -

    calls peripheral.writeValue for characteristic CBUUID_WriteCharacteristic

    +

    calls peripheral.writeValue for characteristic CBUUID_WriteCharacteristic

    -

    writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool

    +

    Make sure that the parent class has initialized the parameter writeCharacteristic.
    +This may not be the case of the deriving transmitter class has overriden the method func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?)

    + +
    writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool

    calls peripheral.writeValue for characteristic that is given as argment : characteristicToWriteTo

    -

    setNotifyValue(_ enabled: Bool, for characteristic: CBCharacteristic)

    +
    setNotifyValue(_ enabled: Bool, for characteristic: CBCharacteristic)

    calls setNotifyValue for characteristic with value enabled

    -

    Properties in BluetoothTransmitter classes

    - -

    address

    - -

    the peripheral address, available after successfully connecting

    - -

    name

    - -

    the peripheral name, available after successfully connecting

    - -

    Functions in CGM Transmitter classes

    - -

    canDetectNewSensor

    - -

    can the cgm transmitter detect a new sensor ?

    -

    Available CGM transmitter classes

    MiaoMiao

    -

    MiaoMiao transmitter is fully implemented

    +

    MiaoMiao transmitter is fully implemented
    +class CGMMiaoMiaoTransmitter

    xDripG4

    -

    xDripG4 transmitter is fully implemented

    +

    xDripG4 transmitter is fully implemented
    +class CGMG4xDripTransmitter

    + +

    Dexcom G5

    + +

    Dexcom G5 is implemented:

    + + + +

    Use a Transmitter class

    + + diff --git a/xdrip/Transmitter/README.md b/xdrip/Transmitter/README.md index 8c5b51b5..8ceaf88c 100644 --- a/xdrip/Transmitter/README.md +++ b/xdrip/Transmitter/README.md @@ -14,7 +14,10 @@ - [peripheralDidUpdateNotificationStateFor](#peripheraldidupdatenotificationstatefor) - [peripheralDidUpdateValueFor](#peripheraldidupatevaluefor) - [conform to protocol CGMTransmitter](#protocolCGMTransmitter) - - [canDetectNewSensor](#canDetectNewSensorprotocol) + - [canDetectNewSensor](#canDetectNewSensor) + - [address](#address) + - [name](#name) + - [startScanning](#startScanning) - [extend class BluetoothTransmitter](#extendclassbuetoothtransmitter) - [initialize the super class BluetoothTransmitter](#initializebluetoothtransmitter) - [BluetoothTransmitter.DeviceAddressAndName](#deviceaddressname) @@ -28,23 +31,21 @@ - [didUpdateBluetoothState](#didUpdateBluetoothState) - [newSensorDetected](#newSensorDetected) - [sensorNotDetected](#sensorNotDetected) - - [newReadingsReceived](#newReadingsReceived) + - [cgmTransmitterInfoReceived](#cgmTransmitterInfoReceived) - [transmitterNeedsPairing](#transmitterNeedsPairing) -- [Functions and properties available in transmitter classes](#functionsandpropertiesavailableintransmitterclasses) - - [Functions in BluetoothTransmitter classes](#functionsinbluetoothtransmitterclasses) - - [disconnect](#disconnect) - - [startScanning](#startScanning) - - [writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool](#writeDataToPeripheral) - - [writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool](#writeDataToPeripheral) - - [setNotifyValue](#setNotifyValue) - - [Properties in BluetoothTransmitter classes](#propertiesinbluetoothtransmitterclasses) - - [address](#address) - - [name](#name) - - [Functions in CGM Transmitter classes](#functionsincgmtransmitterclasses) - - [canDetectNewSensor](#canDetectNewSensor) + - [Implement the specific protocol](#implementtheprotocol) + - [Functions and properties available in transmitter classes](#functionsandpropertiesavailableintransmitterclasses) + - [Functions in BluetoothTransmitter classes](#functionsinbluetoothtransmitterclasses) + - [disconnect](#disconnect) + - [startScanning](#startScanning) + - [writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool](#writeDataToPeripheral) + - [writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool](#writeDataToPeripheral) + - [setNotifyValue](#setNotifyValue) - [Available CGM transmitter classes](#availablecgmtransmitterclasses) - [MiaoMiao](#MiaoMiao) - [xDripG4](#xDripG4) + - [Dexcom G5](#DexcomG5) +- [Use a transmitter class](#useatransmitterclass) # Summary @@ -69,10 +70,15 @@ Needs to be conformed to, for instance by a view controller, or manager, .. what This protocol allows passing information like new readings, sensor detected, and also connect/disconnect, bluetooth status change
    Following specific transmitter classes exist:
    -**CGMG4xDripTransmitter**
    -**CGMG5Transmitter**
    -#Steps for adding new (CGM) transmitter types +* **CGMMiaoMiaoTransmitter**
    + +* **CGMG4xDripTransmitter**
    + +* **CGMG5Transmitter**
    + + +# Steps to adding new (CGM) transmitter types Every new type of bluetoothtransmitter needs to @@ -85,7 +91,9 @@ If it's a CGM transmitter (it could also be a bloodglucose meter that transmits ## conform to protocol BluetoothTransmitterDelegate -The functions that not be implemented: +The protocol is used to pass back information from the BluetoothTransmitter class to the specific Transmitter class. + +The functions that need to be implemented: ### func centralManagerDidConnect() @@ -126,6 +134,18 @@ This will be the most important function, because it contains the data that need can the cgm transmitter detect that a new sensor is placed ? Will return true only for Libre type of transmitters, eg MiaoMiao
    If it returns true the the transmitter should also use newSensorDetected +###
    address + +This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it. + +### name + +This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it. + +### startScanning + +This function is already implemented in the parent class BluetoothTransmitter, there's no need to implement it. + ## extend class BluetoothTransmitter A new transmitter class needs to extend BluetoothTransmitter and @@ -179,6 +199,8 @@ write characteristic UUID The new transmitter class needs to store a property of type CGMTransmitterDelegate
    This is used to pass back information to the controller
    +Define it as a weak var + Functions in CGMTransmitterDelegate: ### cgmTransmitterDidConnect @@ -205,64 +227,101 @@ When a new sensor is detected, only applicable to transmitters that have this fu When a sensor is not detected, only applicable to transmitters that have this functionality -### newReadingsReceived +### cgmTransmitterInfoReceived This is the most important function, it passes new readings to the delegate +also battery info, sensor state, firmware & hardware info if applicable + ### transmitterNeedsPairing The transmitter needs pairing, app should give warning to user to keep the app in the foreground -# Functions and properties available in transmitter classes +## Implement the transmitter protocol -## Functions in BluetoothTransmitter classes +The specific protocol needs to be implemented. -### disconnect +See as example already existing cgm transmitter classes. + +All functions in the parent class can be overriden. + +Following additional functions can be used : + +### Functions and properties available in transmitter classes + +#### Functions in BluetoothTransmitter classes + +These functions should only be used by classes that extend the BluetoothTransmitter class. + +##### disconnect will call centralManager.cancelPeripheralConnection -### startScanning +##### startScanning Will scan for the device.
    This should only be used the first time the app connects to a specific device and should not be done for transmittertypes that start scanning at initialization
    -//TODO: needs more clarification -### writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool +##### writeDataToPeripheral(data:Data, type:CBCharacteristicWriteType) -> Bool -calls peripheral.writeValue for characteristic CBUUID\_WriteCharacteristic +calls peripheral.writeValue for characteristic CBUUID\_WriteCharacteristic
    -### writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool +Make sure that the parent class has initialized the parameter writeCharacteristic.
    +This may not be the case of the deriving transmitter class has overriden the method func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + +##### writeDataToPeripheral(data:Data, characteristicToWriteTo:CBCharacteristic, type:CBCharacteristicWriteType) -> Bool calls peripheral.writeValue for characteristic that is given as argment : characteristicToWriteTo -### setNotifyValue(_ enabled: Bool, for characteristic: CBCharacteristic) +##### setNotifyValue(_ enabled: Bool, for characteristic: CBCharacteristic) calls setNotifyValue for characteristic with value enabled -## Properties in BluetoothTransmitter classes - -### address - -the peripheral address, available after successfully connecting - -### name - -the peripheral name, available after successfully connecting - -## Functions in CGM Transmitter classes - -### canDetectNewSensor - -can the cgm transmitter detect a new sensor ? - # Available CGM transmitter classes ## MiaoMiao -MiaoMiao transmitter is fully implemented +MiaoMiao transmitter is fully implemented
    +class CGMMiaoMiaoTransmitter ## xDripG4 -xDripG4 transmitter is fully implemented +xDripG4 transmitter is fully implemented
    +class CGMG4xDripTransmitter +## Dexcom G5 + +Dexcom G5 is implemented: + +* no backfilling +* not yet tested with transmitter on sensor + +# Use a Transmitter class + +* conform to protocol CGMTransmitterDelegate + +* implement the functions in CGMTransmitterDelegate + + * cgmTransmitterDidConnect : Called when the transmitter has connected. The function gives the name and address.
    +Store the address in permanent storage, next time the transmitter is initialized, give it the address value
    +It will ease the initial connect + + * cgmTransmitterDidDisconnect : To give info to the user that the transmitter has disconnected, if needed to give that info. + + * deviceDidUpdateBluetoothState : Gives the status of Bluetooth (on/off ..)
    +Specifically useful if first scan still needs to occur. May not be useful at all. + + * newSensorDetected : Typically for MiaoMiao, can be used to automatically start the sensor, no need to ask the user to do this. + + * sensorNotDetected : Typically for MiaoMiao + + * func cgmTransmitterInfoReceived(glucoseData:inout [RawGlucoseData], transmitterBatteryInfo:TransmitterBatteryInfo?, sensorState:SensorState?, sensorTimeInMinutes:Int?, firmware:String?, hardware:String?) +Can contain lots of data, like new readings (raw readings), ... + + * cgmTransmitterNeedsPairing : Warn the user that app should stay in foreground + +* Define a variable of type CGMTransmitter and initialize it with any of the transmitter classes + + * In intializer, give it the address if known, or nil if not. If needed also transmitter id and pass it the CGMTransmitterDelegate + diff --git a/xdrip/View Controllers/Home/RootHomeViewController.swift b/xdrip/View Controllers/Home/RootHomeViewController.swift index c6c4465c..a95c682d 100644 --- a/xdrip/View Controllers/Home/RootHomeViewController.swift +++ b/xdrip/View Controllers/Home/RootHomeViewController.swift @@ -31,7 +31,6 @@ final class RootHomeViewController: UIViewController, CGMTransmitterDelegate { // Setup View setupView() - //let test:CGMG4xDripTransmitter = CGMG4xDripTransmitter(addressAndName: CGMG4xDripTransmitter.G4DeviceAddressAndName.notYetConnected) log = OSLog(subsystem: Constants.Log.subSystem, category: Constants.Log.categoryFirstView) os_log("firstview viewdidload", log: log!, type: .info) @@ -49,8 +48,8 @@ final class RootHomeViewController: UIViewController, CGMTransmitterDelegate { address = storedAddress } //test = CGMMiaoMiaoTransmitter(address: address, delegate: self, timeStampLastBgReading: timeStampLastBgReading) - //test = CGMG4xDripTransmitter(address: address, transmitterID: "6LSDU", delegate:self) - test = CGMG5Transmitter(address: address, transmitterID: "406QWK", delegate: self) + test = CGMG4xDripTransmitter(address: address, transmitterID: "6LSDU", delegate:self) + //test = CGMG5Transmitter(address: address, transmitterID: "406QWK", delegate: self) UNUserNotificationCenter.current().delegate = self @@ -358,8 +357,8 @@ extension RootHomeViewController: UNUserNotificationCenterDelegate { // MARK: - CGMTransmitter protocol functions - func cgmTransmitterDidConnect() { - if let address = test?.address(), let name = test?.name() { + func cgmTransmitterDidConnect(address:String?, name:String?) { + if let address = address, let name = name { self.address = address self.name = name UserDefaults.standard.bluetoothDeviceAddress = address