Bncs Infodrivers
|
<< Click to Display Table of Contents >> Navigation: Web UI & API > Extending UI & API > Javascript API Client > Making API Calls > Bncs Infodrivers |
getInfoDriversDeviceIds():
Retrieves all infodriver device IDs.
Returns: an array of device IDs
Example:
let deviceIds = await apiClient.getInfoDriversDeviceIds();
deviceIds.forEach((data)=>{
console.log("Slot index: " +data);
});
getDeviceInfoDriverSlots(deviceId):
Gets slots for a specific device.
Parameters:
•deviceId (string): The device ID
Returns: device infodriver slots information: Array of key-value pairs, slot-index and it’s slot value.
Example:
let slots = await apiClient.getDeviceInfoDriverSlots('858');
slots.data.forEach((data)=>{
console.log("Slot index: " +data.key + " Slot value: " + data.value);
});
}
putInfoDriverValue(deviceId, slotIndex, value):
Updates a slot value for a specific device.
Parameters:
•deviceId (number): The device ID as unsigned integer
•slotIndex (number): The slot index as unsigned integer
•value (string): The new value for the slot
Returns: The updated value
Example:
await apiClient.putInfoDriverValue(123, 0, 'new_value');
getDeviceRedundancyState(deviceId):
Gets the redundancy state for a specific device.
Parameters:
•deviceId (number): The device ID as unsigned integer
Returns: Device’s redundancy state with the following schema
{
/**
* Device unique identifier
* @type {number}
*/
deviceId;
/**
* Indicates if the device is managed
* @type {boolean}
*/
managed;
/**
* Current device state (maps to BncsInfodriverStates enum)
* @type {number}
*/
state;
}
//BncsInfodriverStates enum
{
/// <summary>
/// Infodriver state has not been set by CSI.
/// </summary>
undefined,
/// <summary>
/// Infodriver is in the TxRx state.
/// </summary>
txrx,
/// <summary>
/// Infodriver is in the RxOnly state.
/// </summary>
rxonly,
}
getDeviceRedundancyStates():
Gets redundancy states for all devices.
Returns: array of redundancy states for available devices following the same schema as above.
setDeviceRedundancyState(deviceId, redundancyState)
Sets the redundancy state for a specific device.
There is a defined schema for redundancy states defined:
const statusEnum = {
Tx: 0,
Rx: 1,
ForceTx: 2
};
Parameters:
•List item
•deviceId (number): The device ID as unsigned integer
•redundancyState (statusEnum): The redundancy state to set
Example:
await apiClient.setDeviceRedundancyState(123,statusEnum.TX );
setDeviceRedundancyStates(redundancyState):
Sets the redundancy state for all devices.
Parameters:
•redundancyState (statusEnum): The redundancy state to set for all devices