🤩
JMRSDK Development
v4.27.10
v4.27.10
  • Tesseract Mixed Reality SDK Documentation
    • Changelog - 4.27.10
  • Device Information
    • Device Specification
    • Controller Specifications
      • Physical Controllers
      • Virtual Controller / Virtual Keyboard for JioGlass
  • Getting Started
    • Development Platform
    • Setting Up A Jio Mixed Reality Project in Unity
    • URP Support
      • Setting Up Your Project With URP
      • Reverting Back to Built-In Render Pipeline
  • JMRSDK
    • JMRSDK Content
    • JMRMixedReality Prefab
    • JMRRig
      • Local Rig
      • Setting Homepage (Quit functionality)
      • Recenter Application on Resume
  • Develop
    • Editor Emulator
    • JioGlass Controller Interactions
    • Cameras
    • Jio Mixed Reality UI Toolkits
    • Examples
  • Interaction
    • Gaze and Dwell
    • Interaction
      • JioGlass Lite Interaction
      • Jio Prism(Holoboard) Interaction
      • Jio Dive Interaction
      • Pointer Manager
        • Examples
    • Interfaces
      • ISelectHandler
      • ISelectClickHandler
      • IFocusable
      • ISwipeHandler
      • ITouchHandler
      • IBackHandler
      • IHomeHandler
      • IMenuHandler
      • IVoiceHandler
      • IFn1Handler
      • IFn2Handler
      • IManipulationHandler
    • Controller Input Actions
      • Touchpad - Touch
      • Touchpad - Swipe
      • Source Buttons
      • Manipulation
    • Actions
    • Device State
      • Device Connected
      • Device Disconnected
      • Battery percentage update
      • Scanning for Device
      • Battery Percentage
  • Voice
    • Voice
      • Speech Events
      • Speech Result
      • Speech Error
      • Speech Session End
      • Speech Cancel
    • Listening
  • Tracking
    • Tracking
      • Coordinate System
    • Tracking Framework
      • TrackerManager Actions
        • Get Head Position
        • Get Head Rotation
        • Get Head Transform
      • TrackerManager Methods
        • Get Head Position
        • Get Head Rotation
        • Get Head Transform
    • Recenter
  • Building and Testing
    • Building to Target Device
      • Merging AndroidManifest
      • Performance Optimization
    • Companion App For Jio Mixed Reality (JMR) Devices
      • Running the application on Prism (Holoboard)
    • IPD Calibration
  • Publish
    • Signing App for App Store
    • Publishing to JioGlass Developer Console
    • Developer Console Analytics
  • Capturing and Recording
    • Capture Videos and Screenshots
      • Capturing Screenshot/Videos using scrcpy
      • Capturing Screenshot/Videos using Vysor
  • Troubleshooting
    • FAQs - Develop
    • FAQs - Building to device
      • Gradle
      • Old aaptOptions error fix
    • FAQs - Running and Publishing
    • Laser Point Not Visible
Powered by GitBook
On this page
  1. Interaction
  2. Device State

Battery percentage update

public void OnBatteryUpdate(JMRInteractionManager.InteractionDeviceType deviceType, int index, int percentage)

Parameters
Description

InteractionDeviceType

Type of device connected

index

Index of connected device

percentage

Percentage of Battery

To get notified when the battery percentage is updated need to implement the callback method exposed through InteractionManager:

OnBatteryUpdate(JMRInteractionManager.InteractionDeviceType deviceType, int index, int percentage)

Action will be called only when it’s subscribed to a method. Action must be subscribed to a method with a matching signature.

using JMRSDK.InputModule;
using UnityEngine;

public class JMRInteractionExample : MonoBehaviour
{  
    private void OnEnable()
    {
        JMRInteractionManager.OnBatteryUpdate += OnBatteryUpdate;
    } 
    private void OnDisable()
    {
        JMRInteractionManager.OnBatteryUpdate -= OnBatteryUpdate;
    }
    private void OnBatteryUpdate(JMRInteractionManager.InteractionDeviceType devType, int index, int percentage)
    {
        //do something when battery updated
        JMRInteractionManager.InteractionDeviceType deviceType= devType;
        int deviceIndex=index;
        int batteryPercentage=percentage;
    }
}
PreviousDevice DisconnectedNextScanning for Device

Last updated 2 years ago