public BatteryServiceWrapper(IBluetoothManager bluetoothManager) { IGattServiceBuilder builder = bluetoothManager.NewGattServiceBuilder(); builder.SetUuid(BATTERY_SERVICE_UUID).SetServiceType(GattServiceType.Primary); BatteryLevelCharacteristicWrapper = new BatteryLevelCharacteristicWrapper(bluetoothManager); builder.AddCharacteristics(BatteryLevelCharacteristicWrapper.GattServerCharacteristic); GattServerService = builder.Build(); }
public ClientRfcommServiceWrapper(IBluetoothManager bluetoothManager) { BluetoothManager = bluetoothManager; AddressCharacteristicWrapper = new ClientRfcommAddressCharacteristicWrapper(this); GattServerService = BluetoothManager.NewGattServiceBuilder() .SetUuid(Constants.ClientRfcommServiceGuid) .AddCharacteristics(AddressCharacteristicWrapper.GattServerCharacteristic) .Build(); }
public GyroscopeServiceWrapper(IBluetoothManager bluetoothManager) { BluetoothManager = bluetoothManager; AngularVelocityCharacteristicWrapper = new GyroscopeAngularVelocityCharacteristicWrapper(this); IGattServiceBuilder builder = bluetoothManager.NewGattServiceBuilder(); GattServerService = builder.SetUuid(Constant.GyroscopeServiceGuid) .AddCharacteristics(AngularVelocityCharacteristicWrapper.GattServerCharacteristic) .Build(); }
public DeviceInfomationServiceBuilder(IBluetoothManager bluetoothManager) { BluetoothManager = bluetoothManager; var manufacturerNameStringCharacteristic = new ManufacturerNameStringCharacteristicBuilder(BluetoothManager).Build(); manufacturerNameStringCharacteristic.OnRead += OnManufacturerNameStringCharacteristicRead; manufacturerNameStringCharacteristic.OnWrite += OnManufacturerNameStringCharacteristicWrite; _ServiceBuilder = BluetoothManager.NewGattServiceBuilder().SetUuid(SERVICE_DEVICE_INFORMATION) .SetServiceType(GattServiceType.Primary) .AddCharacteristics(manufacturerNameStringCharacteristic); }
public KeyboardServiceWrapper(IBluetoothManager bluetoothManager) { BluetoothManager = bluetoothManager; KeyActionCharacteristicWrapper = new KeyActionCharacteristicWrapper(this); MouseActionCharacteristicWrapper = new MouseActionCharacteristicWrapper(this); GattServerService = BluetoothManager.NewGattServiceBuilder() .SetUuid(Guid) .AddCharacteristics(KeyActionCharacteristicWrapper.GattServerCharacteristic) .AddCharacteristics(MouseActionCharacteristicWrapper.GattServerCharacteristic) .Build(); }
public TestServiceWrapper(IBluetoothManager bluetoothManager) { IGattServiceBuilder builder = bluetoothManager.NewGattServiceBuilder(); builder.SetUuid(SERVICE_UUID).SetServiceType(GattServiceType.Primary); TestCharacteristicWrapper = new TestCharacteristicWrapper(bluetoothManager); KeepNotifyingCharacteristicWrapper = new KeepNotifyingCharacteristicWrapper(bluetoothManager); builder.AddCharacteristics(TestCharacteristicWrapper.GattServerCharacteristic); builder.AddCharacteristics(KeepNotifyingCharacteristicWrapper.GattServerCharacteristic); GattServerService = builder.Build(); }
public TcpTranspondServiceWrapper(IBluetoothManager bluetoothManager) { BluetoothManager = bluetoothManager; TranspondCharacteristicWrapper = new TranspondCharacteristicWrapper(bluetoothManager); IGattServiceBuilder builder = bluetoothManager.NewGattServiceBuilder(); GattServerService = builder.SetUuid(Uuid) .AddCharacteristics(TranspondCharacteristicWrapper.GattServerCharacteristic) .Build(); TranspondCharacteristicWrapper.GattServerCharacteristic.OnRead += GattServerCharacteristic_OnRead; TranspondCharacteristicWrapper.GattServerCharacteristic.OnWrite += GattServerCharacteristic_OnWrite; State = TcpConnState.Created; TcpClient = new TcpClient(); }
public TestGattServiceWrapper(IBluetoothManager bluetoothManager, Int32 shortUuid) { Name = "No Name M**********r"; GattRequestViewModels = new ObservableCollection <GattRequestViewModel>(); BluetoothManager = bluetoothManager; TestCharacteristicWrapper = new TestCharacteristicWrapper(bluetoothManager); IGattServiceBuilder builder = bluetoothManager.NewGattServiceBuilder(); GattServerService = builder.SetUuid(BluetoothUtils.ShortValueUuid(shortUuid)) .AddCharacteristics(TestCharacteristicWrapper.GattServerCharacteristic) .Build(); TestCharacteristicWrapper.GattServerCharacteristic.OnWrite += _OnCharacteristicWrite; TestCharacteristicWrapper.GattServerCharacteristic.OnRead += _OnCharacteristicRead; value = BitConverter.GetBytes(232); }