Example #1
0
        public virtual async Task Connect(SocketConnectionSettings settings)
        {
            lock (this)
            {
                Socket = new StreamSocket();
            }
            try
            {
                await Socket.ConnectAsync(settings.HostName, settings.ServiceName);
            }
            catch (Exception ex)
            {
                throw new Exception("Can't connect to imBMW Bluetooth device. Check that it's paired and online.", ex);
            }

            OnConnected();
        }
Example #2
0
        public virtual async Task Connect(SocketConnectionSettings settings)
        {
            lock (this)
            {
                Socket = new StreamSocket();
            }
            try
            {
                await Socket.ConnectAsync(settings.HostName, settings.ServiceName);
            }
            catch (Exception ex)
            {
                throw new Exception("Can't connect to imBMW Bluetooth device. Check that it's paired and online.", ex);
            }

            OnConnected();
        }
Example #3
0
 public SocketClient(SocketConnectionSettings settings)
 {
     Settings = settings;
 }