public IOBluetoothDeviceSearchDeviceAttributes( BluetoothDeviceAddress address, string name, BluetoothServiceClassMajor serviceClassMajor, BluetoothDeviceClassMajor deviceClassMajor, BluetoothDeviceClassMinor deviceClassMinor) { if (name == null) { throw new ArgumentNullException("name"); } if (Encoding.UTF8.GetByteCount(name) > 256) { throw new ArgumentOutOfRangeException("name is too long"); } this.address = address; this.name = new byte[256]; Encoding.UTF8.GetBytes(name, 0, name.Length, this.name, 0); this.serviceClassMajor = serviceClassMajor; this.deviceClassMajor = deviceClassMajor; this.deviceClassMinor = deviceClassMinor; }
public BluetoothClassOfDevice(BluetoothServiceClassMajor inServiceClassMajor, BluetoothDeviceClassMajor inDeviceClassMajor, BluetoothDeviceClassMinor inDeviceClassMinor) { bluetoothClassOfDevice = (((uint)inServiceClassMajor << 13) & 0x00FFE000) | (((uint)inDeviceClassMajor << 8) & 0x00001F00) | (((uint)inDeviceClassMinor << 2) & 0x000000FC); }
public BluetoothClassOfDevice (BluetoothServiceClassMajor inServiceClassMajor, BluetoothDeviceClassMajor inDeviceClassMajor, BluetoothDeviceClassMinor inDeviceClassMinor) { bluetoothClassOfDevice = (((uint)inServiceClassMajor << 13) & 0x00FFE000) | (((uint)inDeviceClassMajor << 8) & 0x00001F00) | (((uint)inDeviceClassMinor << 2) & 0x000000FC); }
public IOBluetoothDeviceSearchDeviceAttributes ( BluetoothDeviceAddress address, string name, BluetoothServiceClassMajor serviceClassMajor, BluetoothDeviceClassMajor deviceClassMajor, BluetoothDeviceClassMinor deviceClassMinor) { if (name == null) throw new ArgumentNullException ("name"); if (Encoding.UTF8.GetByteCount (name) > 256) throw new ArgumentOutOfRangeException ("name is too long"); this.address = address; this.name = new byte[256]; Encoding.UTF8.GetBytes (name, 0, name.Length, this.name, 0); this.serviceClassMajor = serviceClassMajor; this.deviceClassMajor = deviceClassMajor; this.deviceClassMinor = deviceClassMinor; }