public void connect(uint uuid) { monotooth.Device.DeviceFactory fac = monotooth.Device.DeviceFactory.GetFactory(); monotooth.Device.ILocalDevice localdev = fac.CreateLocalDevice(); monotooth.Device.DevicePool devpool = localdev.Inquire(); foreach(monotooth.Device.IRemoteDevice remotedev in devpool) { monotooth.Service.ServicePool servpool = remotedev.InquireServices(uuid); monotooth.Connections.RFCommConnectionFactory rfcommfac = monotooth.Connections.RFCommConnectionFactory.GetFactory(); monotooth.Connections.RFCommConnection conn = rfcommfac.CreateRFCommConnection(localdev.Address,remotedev.Address); if(servpool.Count>0) { this.usedconn = conn; this.usedconn.Connected = true; this.usedconn.connect(servpool[0].rfcomm_port); } } }
/// <summary>The default constructor.</summary> /// <param name="conn">The used connection that this stream will use. </param> public BluetoothStream(monotooth.Connections.RFCommConnection conn) { this.sock = conn; }
public LinuxServiceConnection(monotooth.Connections.RFCommConnection conn) { this.usedconn = conn; }