protected override bool TryCreateBleDevice(object key, out Device device)
        {
            var path = (BleDevicePath)key;

            device = WinBleDevice.TryCreate(path.DevicePath, path.DeviceID, path.FriendlyName);
            return(device != null);
        }
Exemple #2
0
 internal WinBleStream(WinBleDevice device, WinBleService service)
     : base(device, service)
 {
     _closeEventHandle = NativeMethods.CreateManualResetEventOrThrow();
     _watchEventHandle = NativeMethods.CreateManualResetEventOrThrow();
     _watchEvents      = new Queue <BleEvent>();
     _watchMap         = new Dictionary <ushort, BleCharacteristic>();
 }
Exemple #3
0
        internal static WinBleDevice TryCreate(string path, string id, string friendlyName)
        {
            var d = new WinBleDevice()
            {
                _path = path, _id = id, _friendlyName = friendlyName, _syncObject = new object()
            };

            return(d);
        }
Exemple #4
0
 public WinBleService(WinBleDevice device, NativeMethods.BTH_LE_GATT_SERVICE nativeData)
 {
     _device = device; NativeData = nativeData; _syncObject = new object();
 }