Class: UtilityClass

UtilityClass()

Class that extends DeviceApi to provide methods allowing the developer to simulate the wearable device. You should register your delegate functions as you would with the actual DeviceApi calss by utilizing the provided method calls and passing your function as the sole argument. I.e. UtilityClass.onAudioLevelChanged(() => console.log('foo')); Then you can simulate the device calling them via the provided simulation methods. I.e. UtilityClass.simulateOnAudioLevelChanged(level);

Constructor

new UtilityClass()

Source:

Members

audioLevel

Set the device audio level. This method is only available on the simulated API.
Source:

buttonInput

Set the last button input array. This method is only available on the simulated API.
Source:

lowPower

Set the device low power mode. This method is only available on the simulated API.
Source:

mode

Set the device mode. This method is only available on the simulated API.
Source:

touchpadInput

Set the last button input array. This method is only available on the simulated API.
Source:

wearerHeading

Set the last device wearer heading. This method is only available on the simulated API.
Source:

Methods

simulateOnAudioLevelChanged(level)

Call the onAudioLevelChanged function with the passed value.
Parameters:
Name Type Description
level number The audio level.
Source:

simulateOnButtonInput(buttonInput, buttonHeald)

Call the onButtonInput function with the passed values.
Parameters:
Name Type Description
buttonInput array Strings representing the pressed buttons. The buttons that can be pressed are: L1, L2, L3, R1, R2, R3.
buttonHeald boolean Whether the button(s) in question were held, as opposed to simply pressed.
Source:

simulateOnLowPowerChange(isLowPower)

Call the onLowPowerChange function with the passed value.
Parameters:
Name Type Description
isLowPower boolean True if the device is in low power mode.
Source:

simulateOnModeChanged(mode)

Call the onModeChanged function with the passed value.
Parameters:
Name Type Description
mode string True if the device is in low power mode.
Source:

simulateOnTouchpadInput(inputString, padNumber)

Call the onTouchpadInput function with the passed value. Supported araguments for the inputString include 'left swipe', 'right swipe' and 'back and forth swipe'. For example, you can simulate a left swipe touchpad input by doing UtilityClass.simulateOnTouchpadInput('left swipe');
Parameters:
Name Type Description
inputString string The string representing touchpad input.
padNumber number The pad number representing which pad on the glasses the action was made.
Source:

simulateOnWearerHeadingChanged(heading)

Call the onWearerHeadingChanged function with the passed value.
Parameters:
Name Type Description
heading number The new device heading.
Source: