public void Open() { this.Close(); if (_bda == null) return; try { //_socket = new System.Net.Sockets.Socket(); _bluetoothClient = new BluetoothClient(); _bta = new BluetoothAddress(_bda); _bluetoothClient.Connect(new BluetoothEndPoint(_bta, BluetoothService.SerialPort)); _networkStream = _bluetoothClient.GetStream(); if(_networkStream!=null) _thread = new myThread(ref _networkStream); } catch (SocketException sx) { System.Diagnostics.Debug.WriteLine("SocketException in Open(): " + sx.Message); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception in Open(): " +ex.Message); } }
static BluetoothAddress() { None = new BluetoothAddress(); }
public BluetoothEndPoint(BluetoothAddress address, Guid service, int port) { this.m_id = address; this.m_service = service; this.m_port = port; }
public BluetoothEndPoint(BluetoothAddress address, Guid service) : this(address, service, m_defaultport) { }
static BluetoothAddress() { None = new BluetoothAddress(); }