public override monotooth.Connections.RFCommConnection CreateRFCommConnection(monotooth.BluetoothAddress from, monotooth.BluetoothAddress to) { LinuxRFCommConnection conn = new LinuxRFCommConnection(); conn.from = from; conn.to = to; return conn; }
/// <summary>Returns an address as string. </summary> /// <returns>A string from the address.</returns> public static string AddressAsString(monotooth.BluetoothAddress ba) { if(ba == null) throw new ArgumentException("ba","May not be null!"); if(ba.Array.Length == 0) throw new ArgumentException("ba","May not be empty!"); if(ba.Array.Length != 6) throw new ArgumentException("ba","Too short for address format!"); string ret = ""; foreach (byte b in ba.b) { if (b < 16) { ret+="0"+Convert.ToString(b,16)+":"; } else { ret+=Convert.ToString(b,16)+":"; } } ret = ret.Remove(ret.Length-1,1); ret = ret.ToUpper(); return ret; }
private static extern int ba2str(monotooth.BluetoothAddress ba, System.Text.StringBuilder bld);
/// <summary>Removes a service from the pool. </summary> /// <param name="ser">A service to be removed from the pool. </param> public virtual void Remove(monotooth.Service.Service ser) { this.List.Remove(ser); }
/// <summary>Add a service to this pool.</summary> /// <param name="ser">A service to be added to the pool. </param> public virtual void Add(monotooth.Service.Service ser) { this.List.Add(ser); }
public WindowsRemoteDevice(monotooth.BluetoothAddress ba, String name) { this.address = ba; this.name = name; }
public override monotooth.Connections.ServiceConnection CreateServiceConnection(monotooth.Connections.RFCommConnection conn) { return new LinuxServiceConnection(conn); }
/// <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; }
/// An abstract method to create service connections /// <returns>OS-specific service connection</returns> public abstract monotooth.Connections.ServiceConnection CreateServiceConnection(monotooth.Connections.RFCommConnection conn);
/// An abstract method that is used to create RFCOMM connections public abstract monotooth.Connections.RFCommConnection CreateRFCommConnection(monotooth.BluetoothAddress from, monotooth.BluetoothAddress to);
private static extern int rfcomm_listen(monotooth.BluetoothAddress from, int channel, int backlog);
private static extern int rfcomm_connect(monotooth.BluetoothAddress from, monotooth.BluetoothAddress to, int channel);
private static extern void baswap(monotooth.BluetoothAddress ba, monotooth.BluetoothAddress ba2);
private static extern IntPtr search_services_from_with_uuid(monotooth.BluetoothAddress ba, uint uuid);
private static extern int hci_read_remote_name(int dd, monotooth.BluetoothAddress ba, int len, System.Text.StringBuilder b, int timeout);
public LinuxRemoteDevice(monotooth.BluetoothAddress ba, string name) { this.address = ba; this.name = name; }
public override monotooth.Connections.RFCommConnection CreateRFCommConnection(monotooth.BluetoothAddress from, monotooth.BluetoothAddress to) { return new WindowsRFCommConnection(); }
private static extern int l2cap_connect(monotooth.BluetoothAddress to, ushort psm);