Package com.orbbec.obsensor

## Class Sensor

- java.lang.Object
- - com.orbbec.obsensor.LobClass
  - - com.orbbec.obsensor.Sensor

All Implemented Interfaces:
  `java.lang.AutoCloseable`

    public class Sensor
    extends LobClass

Expose orbbec sensor function

### Field Summary

### Fields inherited from class com.orbbec.obsensor.LobClass

`handle, owner`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` release sensor resources
`StreamProfileList` `getStreamProfileList()` Get the data stream configuration information supported by the sensor
`SensorType` `getType()` Get sensor type
`void` `start​(StreamProfile profile, FrameCallback callback)` Open the sensor data stream, it cannot be used with the pipeline at the same time.
`void` `stop()` turn off sensor data stream
`void` `switchProfile​(StreamProfile profile)` Dynamically switch resolutions

### Methods inherited from class com.orbbec.obsensor.LobClass

`getHandle, throwInitializeException`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getType

    public SensorType getType()

Get sensor type

Returns:
  Sensor Type

#### getStreamProfileList

    public StreamProfileList getStreamProfileList()

Get the data stream configuration information supported by the sensor

Returns:
  The list of data stream configuration information supported by the sensor

#### start

    public void start​(StreamProfile profile,
                      FrameCallback callback)

Open the sensor data stream, it cannot be used with the pipeline at the same time. If the configuration in the configuration file is used to open the stream, the profile will pass null (if there is no configuration file when the null is passed, the first configuration in the configuration file list will be used by default. )

Important: After the callback data frame is used up, Frame.close() must be called to release resources.

Parameters:
  `profile` - Data stream configuration
  `callback` - Data callback

#### stop

    public void stop()

turn off sensor data stream

#### switchProfile

    public void switchProfile​(StreamProfile profile)

Dynamically switch resolutions

Parameters:
  `profile` - resolution that needs to be switched

#### close

    public void close()

release sensor resources