Пример #1
0
 private void MListener_ConnectionComplete(object sender, MdsConnectionListenerEventArgs e)
 {
     if (e.MACAddress == mMACAddress)
     {
         connectiontcs?.TrySetResult(null);
         mListener.ConnectionComplete -= MListener_ConnectionComplete;
     }
 }
Пример #2
0
 private void MListener_Disconnect(object sender, MdsConnectionListenerEventArgs e)
 {
     if (e.MACAddress == mMACAddress)
     {
         disconnectTcs?.TrySetResult(null);
         mListener.Disconnect -= MListener_Disconnect;
     }
 }
 private void MListener_ConnectionComplete(object sender, MdsConnectionListenerEventArgs e)
 {
     if (e.Uuid == new System.Guid(mUuid))
     {
         connectiontcs?.TrySetResult(null);
         mListener.ConnectionComplete -= MListener_ConnectionComplete;
     }
 }
        private void MListener_Disconnect(object sender, MdsConnectionListenerEventArgs e)
        {
            // TODO review this - Disconnection on iOS only returns Serial number in response block,
            // yet disconnection is done using Uuid -how do we know the intended device has disconnected?

            //if (e.MACAddress == mUuid)
            //{
            disconnectTcs?.TrySetResult(null);
            mListener.Disconnect -= MListener_Disconnect;
            //}
        }
Пример #5
0
        private void MListener_DeviceConnectionComplete(object sender, MdsConnectionListenerEventArgs e)
        {
            var serial = string.Empty;

            MdsConnectionListener.Current.UuidToSerialMapper.TryGetValue(mUuid, out serial);
            if (e.Serial == serial)
            {
                connectiontcs?.TrySetResult(new MdsMovesenseDevice(serial, mUuid));
                mListener.DeviceConnectionComplete -= MListener_DeviceConnectionComplete;
            }
        }
Пример #6
0
        private void MListener_DeviceDisconnected(object sender, MdsConnectionListenerEventArgs e)
        {
            var serial = string.Empty;

            MdsConnectionListener.Current.UuidToSerialMapper.TryGetValue(mUuid, out serial);
            if (e.Serial == serial)
            {
                disconnectTcs?.TrySetResult(null);
                mListener.DeviceDisconnected -= MListener_DeviceDisconnected;
            }
        }