-
Notifications
You must be signed in to change notification settings - Fork 0
FeatureManager
本文档介绍了 envoy 暴露出来的 FeatureManager 的基类中已经注册和监听好的事件,以及每个事件的意义. 为了方便书写,具体的接口都采用英语撰写。
这里暴露出来的所有接口都是异步的,所以在 JS 语法中使用 await 来调用。调用时依次填充该文档提及的参数即可。
如:
const key = "test-key";
const deviceId = "test-id";
const items = await featureManager.getItemFromMeshStorage(key, deviceId);上面示例中即通过相关接口获取到某台设备中 mesh storage 的内容
Explaining common parameters to avoid duplicated docs
- deviceId: Id of device we are requesting against for locations. Usually this comes from the
onStartcallback and is theiotDeviceIdreturned fromdata. For more detail, please check theStartsection in this doc
Gets current location of a specific device
Params
- deviceId: explained in Common Parameter Explanation section
Return a location object like this:
{
coordinate: {
lat: number,
lng: number,
},
altitude: number,
}Gets homepoint location of a specific device
Params
- deviceId: explained in Common Parameter Explanation section
Return a location object like this:
{
coordinate: {
lat: number,
lng: number,
},
altitude: number,
}Gets altitude range for executing a hotpoint. Each device, when trying to perform a hotpoint operation, has limited altitude based on its current location, and this needs to be queried by featureManager.
Params
- deviceId: explained in Common Parameter Explanation section
Return an interval object like this
{
min: number,
max: number,
}Gets the max angular velocity for performing a hotpoint operation with certain radius
Params
- radius: radius of the hotpoint
- deviceId: explained in Common Parameter Explanation section
Returns
Returns a number representing the max angular velocity
Gets radius range for executing a hotpoint operation on a device
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A range interval in following format
{
min: number,
max: number,
}Returns exposure mode range on a specific aircraft
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A range interval in following format
{
min: number,
max: number,
}Sets exposure mode on a specific aircraft. The exposure mode set should be in the result returned by getExposureModeRange
Params
- value: expected value to be set for exposure mode
- deviceId: explained in Common Parameter Explanation section
Returns
true if succeeded
Gets shutter speed on a given device
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A number representing the current shutter speed on a device. Null if deviceId is invalid
Sets shutter speed on a given device
Params
- value: expected value to be set for shutter speed on a given device
- deviceId: explained in Common Parameter Explanation section
Returns
true if succeeded
Gets range of shutterspeed supported on a given device
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A range object in following format
{
min: number,
max: number,
}Gets if Adjustable Aperture is supported on a given device
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A boolean value, true if supported
Sets aperture value on a given device
Params
- value: expected value to be set for aperture on a given device
- deviceId: explained in Common Parameter Explanation section
Returns
true if succeeded
Gets range of aperture supported on a given device
Params
- deviceId: explained in Common Parameter Explanation section
Returns
A range object in following format
{
min: number,
max: number,
}Inits camera on a given device by setting its exposureMode to auto
Params
- deviceId: explained in Common Parameter Explanation section
Returns
N/A
Execute a feature on a given device
Params
- featureData: feature data object outlining the feature to be executed, one could referred to the JS API doc for various supported feature data format
- uuid: uuid of device; usually this comes from the
onStartcallback and is theuuidreturned fromdata. For more detail, please check theStartsection in this doc - toDeviceId: id of device to perform the feature; usually this comes from the
onStartcallback and is theiotDeviceIdreturned fromdata. For more detail, please check theStartsection in this doc
Returns
N/A
Deletes an item from mesh storage
Params
- key: key of the item to be delted
- deviceId: explained in Common Parameter Explanation section
Returns
N/A
Gets an item from mesh storage
Params
- key: key of the item to be retrieved
- deviceId: explained in Common Parameter Explanation section
Returns
The retrieved item
Sets an item in mesh storage
Params
- key: key of the item to be set
- item: actual item to be set
- deviceId: explained in Common Parameter Explanation section
Returns
N/A