Class: Context

Context()

Default librealsense context class,

Constructor

new Context()

There are only one acceptable form of syntax to create a Context for users:

 new Context();
other forms are reserved for internal use only.
Source:

Members

events

Get the events object of EventEmitter
Source:

Methods

destroy()

Cleanup underlying C++ context, and release all resources that were created by this context. The JavaScript Context object(s) will not be garbage-collected without call(s) to this function
Source:

getSensorParent(sensor) → {Device|undefined}

Get the device from one of its sensors
Parameters:
Name Type Description
sensor Sensor
Source:
Returns:
Type
Device | undefined

loadDevice(file) → {PlaybackDevice|undefined}

Create a PlaybackDevice to playback recored data file.
Parameters:
Name Type Description
file String the file path
Source:
Returns:
Type
PlaybackDevice | undefined

queryDevices() → {DeviceList|undefined}

Create a static snapshot of all connected devices at the time of the call
Source:
Returns:
connected devices at the time of the call
Type
DeviceList | undefined

querySensors() → {Array.<Sensor>|undefined}

Generate an array of all available sensors from all RealSense devices
Source:
Returns:
Type
Array.<Sensor> | undefined

setDevicesChangedCallback(callback)

Register a callback function to receive device-changed notification
Parameters:
Name Type Description
callback devicesChangedCallback devices changed callback
Source:

unloadDevice(file)

Removes a PlaybackDevice from the context, if exists
Parameters:
Name Type Description
file String The file name that was loaded to create the playback device
Source:

Events

device-changed

When one or more devices are plugged or unplugged into the system
Parameters:
Name Type Description
removed DeviceList The devices removed from the system
added DeviceList The devices added to the system
Source: