예제 #1
0
        /// <summary>
        /// Stop notification on a specified navigation value
        /// </summary>
        /// <param name="value">Navigation to stop being notified</param>
        /// <returns>true if the operation succeeded, false otherwise</returns>
        public async Task <bool> StopNotification(NavigationValue value)
        {
            bool ret;

            // List characteristics
            ret = await InitCharacteristics();

            if (ret)
            {
                // Look for the selected characteristic
                BleGattCharacteristic nav_characteristic = _navigation_characteristics[value];
                ret = await BleDevice.UnregisterValueNotificationAsync(nav_characteristic, OnNavigationNotification);
            }

            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Stop notification on a specified variometer value
        /// </summary>
        /// <param name="value">Variometer to stop being notified</param>
        /// <returns>true if the operation succeeded, false otherwise</returns>
        public async Task <bool> StopNotification(VariometerValue value)
        {
            bool ret;

            // List characteristics
            ret = await InitCharacteristics();

            if (ret)
            {
                // Look for the selected characteristic
                BleGattCharacteristic vario_characteristic = _variometer_characteristics[value];
                ret = await BleDevice.UnregisterValueNotificationAsync(vario_characteristic, OnVariometerNotification);
            }

            return(ret);
        }
예제 #3
0
        /// <summary>
        /// Stop notification on a specified altitude value
        /// </summary>
        /// <param name="altitude">Altitude to stop being notified</param>
        /// <returns>true if the operation succeeded, false otherwise</returns>
        public async Task <bool> StopNotification(Altitude altitude)
        {
            bool ret;

            // List characteristics
            ret = await InitCharacteristics();

            if (ret)
            {
                // Look for the selected characteristic
                BleGattCharacteristic alti_characteristic = _altitude_characteristics[altitude];
                ret = await BleDevice.UnregisterValueNotificationAsync(alti_characteristic, OnAltitudeNotification);
            }

            return(ret);
        }