コード例 #1
0
 public ClientDeviceConfigPage(IGattServer gattServer, ClientCharacteristicConfigurationDescriptorWrapper clientCharacteristicConfigurationDescriptorWrapper)
 {
     ConnectedDeviceList = new ObservableCollection <Model>();
     GattServer          = gattServer;
     ClientCharacteristicConfigurationDescriptorWrapper = clientCharacteristicConfigurationDescriptorWrapper;
     InitializeComponent();
     DeviceListView.ItemsSource    = ConnectedDeviceList;
     DeviceListView.ItemAppearing += DeviceListView_ItemAppearing;
 }
コード例 #2
0
 public KeyActionCharacteristicWrapper(KeyboardServiceWrapper serviceWrapper)
 {
     KeyboardServiceWrapper = serviceWrapper;
     ClientCharacteristicConfigurationDescriptorWrapper = new ClientCharacteristicConfigurationDescriptorWrapper(KeyboardServiceWrapper.BluetoothManager);
     GattServerCharacteristic = KeyboardServiceWrapper.BluetoothManager.NewGattCharacteristicBuilder()
                                .SetUuid(Guid)
                                .AddDescriptors(ClientCharacteristicConfigurationDescriptorWrapper.GattServerDescriptor)
                                .SetPermissions(Permissions)
                                .SetProperties(Properties)
                                .Build();
 }
コード例 #3
0
        public TestCharacteristicWrapper(IBluetoothManager bluetoothManager)
        {
            ClientCharacteristicConfigurationDescriptorWrapper = new ClientCharacteristicConfigurationDescriptorWrapper(bluetoothManager);

            IGattCharacteristicBuilder builder = bluetoothManager.NewGattCharacteristicBuilder();

            builder.SetUuid(UUID).SetPermissions(PERMISSIONS).SetProperties(PROPERTIES);
            builder.AddDescriptors(ClientCharacteristicConfigurationDescriptorWrapper.GattServerDescriptor);
            GattServerCharacteristic         = builder.Build();
            GattServerCharacteristic.OnRead += _OnRead;
        }
コード例 #4
0
        public GyroscopeAngularVelocityCharacteristicWrapper(GyroscopeServiceWrapper serviceWrapper)
        {
            ClientCharacteristicConfigurationDescriptorWrapper = new ClientCharacteristicConfigurationDescriptorWrapper(serviceWrapper.BluetoothManager);
            GyroscopeServiceWrapper = serviceWrapper;
            var builder = GyroscopeServiceWrapper.BluetoothManager.NewGattCharacteristicBuilder();

            GattServerCharacteristic = builder.SetUuid(Uuid)
                                       .AddDescriptors(ClientCharacteristicConfigurationDescriptorWrapper.GattServerDescriptor)
                                       .SetPermissions(Permission)
                                       .SetProperties(Properties)
                                       .Build();
            GattServerCharacteristic.OnRead += GattServerCharacteristic_OnRead;
        }
コード例 #5
0
        public RfcommServerAddressCharacteristicWrapper(RfcommServerServiceWrapper serviceWrapper)
        {
            RfcommServerServiceWrapper = serviceWrapper;
            ClientCharacteristicConfigurationDescriptorWrapper = new ClientCharacteristicConfigurationDescriptorWrapper(serviceWrapper.BluetoothManager);
            var characteristic = RfcommServerServiceWrapper.BluetoothManager.NewGattCharacteristicBuilder()
                                 .SetUuid(Constants.RfcommServerAddressCharacteristicGuid)
                                 .AddDescriptors(ClientCharacteristicConfigurationDescriptorWrapper.GattServerDescriptor)
                                 .SetPermissions(Permission)
                                 .SetProperties(Properties)
                                 .Build();

            GattServerCharacteristic         = characteristic;
            GattServerCharacteristic.OnRead += GattServerCharacteristic_OnRead;
        }
コード例 #6
0
            public ClientRfcommAddressCharacteristicWrapper(ClientRfcommServiceWrapper serviceWrapper)
            {
                RfcommAddressDict = new Dictionary <IBluetoothDevice, ulong>();
                ClientCharacteristicConfigurationDescriptorWrapper = new ClientCharacteristicConfigurationDescriptorWrapper(serviceWrapper.BluetoothManager);
                ClientRfcommServiceWrapper = serviceWrapper;
                var characteristic = ClientRfcommServiceWrapper.BluetoothManager.NewGattCharacteristicBuilder()
                                     .SetUuid(Constants.ClientRfcommAddressCharacteristicGuid)
                                     .AddDescriptors(ClientCharacteristicConfigurationDescriptorWrapper.GattServerDescriptor)
                                     .SetPermissions(Permission)
                                     .SetProperties(Properties)
                                     .Build();

                GattServerCharacteristic          = characteristic;
                GattServerCharacteristic.OnRead  += GattServerCharacteristic_OnRead;
                GattServerCharacteristic.OnWrite += GattServerCharacteristic_OnWrite;
            }
コード例 #7
0
 public Model(IBluetoothDevice bluetoothDevice, ClientCharacteristicConfigurationDescriptorWrapper clientCharacteristicConfigurationDescriptorWrapper)
 {
     BluetoothDevice = bluetoothDevice;
     ClientCharacteristicConfigurationDescriptorWrapper = clientCharacteristicConfigurationDescriptorWrapper;
 }