public NordicUARTViewModel()
 {
     uartService = GattServiceManager.GetGATTServiceManager().GetServiceForNordicUart().FirstOrDefault() as UARTService;
     DeviceSelectionViewModel = new ToolboxDeviceSelectionViewModel();
     dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
     SetWelcomeMessage();
 }
Exemplo n.º 2
0
        private void GetProximityMonitorServices()
        {
            List <IGattService> result = GattServiceManager.GetGATTServiceManager().GetServicesForProximityMonitor();

            foreach (var item in result)
            {
                switch (item.Name)
                {
                case ToolboxIdentifications.GattServiceNames.LINK_LOSS:
                    LinkLossService = item as ILinkLossService;
                    break;

                case ToolboxIdentifications.GattServiceNames.BATTERY:
                    BatteryService = item as IBatteryService;
                    break;

                case ToolboxIdentifications.GattServiceNames.IMMEDIATE_ALERT:
                    ImmediateAlertService = item as IImmediateAlertService;
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 3
0
 void RegisterHeartRateService()
 {
     heartRateService = GattServiceManager.GetGATTServiceManager().GetHeartRateService();
     batteryService   = GattServiceManager.GetGATTServiceManager().GetBatteryService();
     heartRateService.HeartRateValueChangeCompleted += heartRate_ValueChangeCompleted;
     heartRateService.SensorLocation_Detected       += sensorLocation_detected;
     batteryService.ValueChangeCompleted            += battery_ValueChangeCompleted;
 }
 public NordicUartControlButtonViewModel()
 {
     uartService   = GattServiceManager.GetGATTServiceManager().GetServiceForNordicUart().FirstOrDefault() as UARTService;
     IsOnEditModel = false;
     InitializeSelectedControlButton(IsOnEditModel);
     InitializeAllControlButton();
     DeviceSelectionViewModel = new ToolboxDeviceSelectionViewModel();
     dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
 }
 public DeviceFirmwareUpdateViewModel()
 {
     DeviceSelectionViewModel    = new ToolboxDeviceSelectionViewModel();
     deviceFirmwareUpdateService = GattServiceManager.GetGATTServiceManager().GetDeviceFirmwareUpdateService();
     deviceFirmwareUpdateService.ServiceChanged += deviceFirmwareUpdateService_ServiceChanged;
     deviceFirmwareUpdateService.DeviceFirmwareUpdateComplete += deviceFirmwareUpdateService_DeviceFirmwareUpdateComplete;
     deviceFirmwareUpdateService.PacketReceiptConfirmed       += deviceFirmwareUpdateService_PacketReceiptConfirmed;
     dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
     LoadDFUSettings();
 }
        public void GetGlocuseServices()
        {
            var glucoseMonitorServices = GattServiceManager.GetGATTServiceManager().GetServiceForGlucoseMonitor();

            dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            foreach (var service in glucoseMonitorServices)
            {
                switch (service.Name)
                {
                case ToolboxIdentifications.GattServiceNames.GLUCOSE:
                    RegisterGlucoseMeasurementListener(service);
                    break;

                case ToolboxIdentifications.GattServiceNames.BATTERY:
                    RegisterBatteryLevelListener(service);
                    break;

                default:
                    break;
                }
            }
        }
        private void GetService()
        {
            bloodPressureMonitorServices = GattServiceManager.GetGATTServiceManager().GetServicesForBloodPressureMonitor();
            dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            foreach (var service in bloodPressureMonitorServices)
            {
                switch (service.Name)
                {
                case ToolboxIdentifications.GattServiceNames.BLOOD_PRESSURE:
                    this.BloodPressureServiceHandler = service as IBloodPressureService;
                    RegisterBloodPressureMeasurementListener(service);
                    break;

                case ToolboxIdentifications.GattServiceNames.BATTERY:
                    this.BatteryServiceHandler = service as IBatteryService;
                    RegisterBatteryLevelListener(service);
                    break;

                default:
                    break;
                }
            }
        }