Beispiel #1
0
 private void OnFirmwareCheckStarted(
     bool isRequired,
     Device device,
     FirmwareUpdateInformation updateInformation)
 {
     Hide();
 }
Beispiel #2
0
        public FirmwareUpdateInformation GetFirmwareUpdateInformationInternal()
        {
            const string GetUpdateIconMethod = "GetAppIcon";

            // These strings really should be grabbed from the bridge, but we don't have
            //		access to them, so we might as well as save on the transport costs.
            const string FirmwareUpdateButtonTitle   = "Update Firmware";
            const string FirmwareContinueButtonTitle = "Continue";
            const string FirmwareUpdateTitle         = "Firmware Update";
            const string FirmwareUpdateMessage       = "New firmware available.";

            FirmwareUpdateAlertOption okay = new FirmwareUpdateAlertOption();

            okay.style = AlertStyle.Affirmative;
            okay.title = FirmwareUpdateButtonTitle;

            FirmwareUpdateAlertOption cancel = new FirmwareUpdateAlertOption();

            cancel.style = AlertStyle.Negative;
            cancel.title = FirmwareContinueButtonTitle;

            AndroidJavaObject firmwareObject = AndroidPlugin.GetFirmwareUpdateInformation();

            FirmwareUpdateInformation firmwareUpdateInfo = new FirmwareUpdateInformation();

            firmwareUpdateInfo.icon    = (BoseUpdateIcon)firmwareObject.Call <int>(GetUpdateIconMethod);
            firmwareUpdateInfo.title   = FirmwareUpdateTitle;
            firmwareUpdateInfo.message = FirmwareUpdateMessage;
            firmwareUpdateInfo.options = new FirmwareUpdateAlertOption[] { okay, cancel };

            return(firmwareUpdateInfo);
        }
Beispiel #3
0
        /// <summary>
        /// Initiates the check for firmware status to begin.
        /// </summary>
        private void OnFirmwareUpdateCheck(bool isRequired, Device device, FirmwareUpdateInformation updateInformation)
        {
            ToggleLockScreen(true);

            if (FirmwareCheckStarted != null)
            {
                FirmwareCheckStarted.Invoke(isRequired, device, updateInformation);
            }
        }
Beispiel #4
0
        private void OnFirmwareCheckStarted(
            bool isRequired,
            Device device,
            FirmwareUpdateInformation updateInformation)
        {
            _messageText.Clear();

            _updateInformation = updateInformation;

            var appLocaleKey = GetAppSpecificLocaleKey(updateInformation.icon);

            if (isRequired)
            {
                _headerText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_UPDATE_REQUIRED_TITLE);
                _scrollText.SetLocaleKey(
                    LocaleConstants.CONNECTION_TASK_UPDATE_REQUIRED_MESSAGE,
                    appLocaleKey);
                _updateButtonText.SetLocaleKey(
                    LocaleConstants.CONNECTION_TASK_OPEN_THE_APP,
                    appLocaleKey);
                _continueButtonText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_CONTINUE_WITHOUT_BOSE_AR);
            }
            else
            {
                _headerText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_UPDATE_AVAILABLE_TITLE);
                _scrollText.SetLocaleKey(
                    LocaleConstants.CONNECTION_TASK_UPDATE_AVAILABLE_MESSAGE,
                    appLocaleKey);
                _updateButtonText.SetLocaleKey(
                    LocaleConstants.CONNECTION_TASK_OPEN_THE_APP,
                    appLocaleKey);
                _continueButtonText.SetLocaleKey(LocaleConstants.CONNECTION_TASK_CONTINUE_WITHOUT_UPDATING_TITLE);
            }

            switch (updateInformation.icon)
            {
            case BoseUpdateIcon.Connect:
                _appGroupIcon.sprite = _boseConnectIcon;
                break;

            case BoseUpdateIcon.Music:
                _appGroupIcon.sprite = _boseMusicIcon;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            Show();
        }
        public FirmwareUpdateInformation GetFirmwareUpdateInformationInternal()
        {
            BridgeFirmwareUpdateInformation bridgeFirmwareInformation = new BridgeFirmwareUpdateInformation();

            WearableGetFirmwareUpdateInformation(ref bridgeFirmwareInformation);
            FirmwareUpdateInformation firmwareUpdateInformation = new FirmwareUpdateInformation();

            firmwareUpdateInformation.icon    = (BoseUpdateIcon)bridgeFirmwareInformation.updateIcon;
            firmwareUpdateInformation.title   = bridgeFirmwareInformation.title;
            firmwareUpdateInformation.message = bridgeFirmwareInformation.message;
            firmwareUpdateInformation.options = new FirmwareUpdateAlertOption[bridgeFirmwareInformation.numOptions];

            for (int i = 0; i < bridgeFirmwareInformation.numOptions; i++)
            {
                BridgeFirmwareUpdateAlertOption alertOption = new BridgeFirmwareUpdateAlertOption();
                WearableGetFirmwareUpdateAlertOption(ref alertOption, i);
                firmwareUpdateInformation.options[i].style = (AlertStyle)alertOption.style;
                firmwareUpdateInformation.options[i].title = alertOption.title;
            }

            return(firmwareUpdateInformation);
        }
        private void OnFirmwareCheckStarted(
            bool isRequired,
            Device device,
            FirmwareUpdateInformation updateInformation)
        {
            _messageText.text  = string.Empty;
            _updateInformation = updateInformation;

            if (isRequired)
            {
                _headerText.text         = UPDATE_REQUIRED_HEADER_TEXT;
                _scrollText.text         = string.Format(UPDATE_REQUIRED_BODY_TEXT, _updateInformation.icon);
                _continueButtonText.text = UPDATE_REQUIRED_SECONDARY_BUTTON_TEXT;
            }
            else
            {
                _headerText.text         = UPDATE_AVAILABLE_HEADER_TEXT;
                _scrollText.text         = string.Format(UPDATE_AVAILABLE_BODY_TEXT, _updateInformation.icon);
                _continueButtonText.text = UPDATE_AVAILABLE_SECONDARY_BUTTON_TEXT;
            }

            switch (updateInformation.icon)
            {
            case BoseUpdateIcon.Connect:
                _appGroupIcon.sprite = _boseConnectIcon;
                break;

            case BoseUpdateIcon.Music:
                _appGroupIcon.sprite = _boseMusicIcon;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            Show();
        }
        private void OnFirmwareCheckStarted(
            bool isRequired,
            Device device,
            FirmwareUpdateInformation updateInformation)
        {
            _messageText.text  = string.Empty;
            _updateInformation = updateInformation;

            if (isRequired)
            {
                _headerText.text         = UpdateRequiredHeaderText;
                _scrollText.text         = string.Format(UpdateRequiredBodyText, _updateInformation.icon);
                _continueButtonText.text = UpdateRequiredSecondaryButtonText;
            }
            else
            {
                _headerText.text         = UpdateAvailableHeaderText;
                _scrollText.text         = string.Format(UpdateAvailableBodyText, _updateInformation.icon);
                _continueButtonText.text = UpdateAvailableSecondaryButtonText;
            }

            switch (updateInformation.icon)
            {
            case BoseUpdateIcon.Connect:
                _appGroupIcon.sprite = _boseConnectIcon;
                break;

            case BoseUpdateIcon.Music:
                _appGroupIcon.sprite = _boseMusicIcon;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            Show();
        }
Beispiel #8
0
        internal WearableDebugProvider()
        {
            _virtualDevice = new Device
            {
                name              = _name,
                firmwareVersion   = _firmwareVersion,
                rssi              = _rssi,
                availableSensors  = _availableSensors,
                availableGestures = _availableGestures,
                productId         = _productId,
                variantId         = _variantId,
                uid = _uid,
                transmissionPeriod = 0,
                maximumPayloadPerTransmissionPeriod = 0,
                // NB: an extra sensor needs to be added to account for RotationSource
                maximumActiveSensors = WearableConstants.SensorIds.Length + 1
            };

            _name                    = WearableConstants.DebugProviderDefaultDeviceName;
            _firmwareVersion         = WearableConstants.DefaultFirmwareVersion;
            _boseArEnabled           = true;
            _firmwareUpdateAvailable = false;
            _acceptSecurePairing     = true;
            _rssi                    = WearableConstants.DebugProviderDefaultRSSI;
            _availableSensors        = WearableConstants.AllSensors;
            _availableGestures       = WearableConstants.AllGestures;
            _productId               = WearableConstants.DebugProviderDefaultProductId;
            _variantId               = WearableConstants.DebugProviderDefaultVariantId;
            _uid = WearableConstants.DebugProviderDefaultUID;
            _simulatedDelayTime = WearableConstants.DebugProviderDefaultDelayTime;

            _searchingForDevice = false;

            _verbose = true;

            _eulerSpinRate     = Vector3.zero;
            _axisAngleSpinRate = Vector3.up;

            _config = new WearableDeviceConfig();

            _pendingGestures = new Queue <GestureData>();

            _nextSensorUpdateTime = 0.0f;
            _rotation             = Quaternion.identity;

            _dynamicDeviceInfo = WearableConstants.EmptyDynamicDeviceInfo;

            _updateInformation = new FirmwareUpdateInformation
            {
                icon    = BoseUpdateIcon.Music,
                options = new[]
                {
                    new FirmwareUpdateAlertOption
                    {
                        style = AlertStyle.Affirmative
                    },
                    new FirmwareUpdateAlertOption
                    {
                        style = AlertStyle.Negative
                    }
                }
            };
        }