Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 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>();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public WinBleService(WinBleDevice device, NativeMethods.BTH_LE_GATT_SERVICE nativeData)
 {
     _device = device; NativeData = nativeData; _syncObject = new object();
 }