This is an old revision of the document!
APPENDIX J Thrift
Thrift enables automation of creation of schematics and updating schematics. Refer thrift documentation at https://wiki.analog.com/resources/tools-software/sigmastudiov2/usingsigmastudio/scripting?s[]=thrift for generic APIs which can be used with A2B as well as SigmaStudio+. The following section introduces APIs specific to A2B and this in addition to the one’s available at the website mentioned above.
Note :- Documentation for A2B thrift will be uploaded to wiki.analog.com in the future releases. Any further updates to A2B thrift documentation will be provided at this domain.
A UID is a unique identifier string used extensively in thrift to identify the desired entity. It has the format <name>_<zero-based-positive-integer>. For instance “EvalAD2433WB1BZ_0”. To know the UID of any entity, use the GetAllPlugins API (refer the link above) to get a full list of plugins loaded by SS+. Then filter this list for A2B plugins by referring to J.3A2B Shape full names. Now from this list, the string after the last ‘.’ without the _v<version> will be the <name> in the UID string. The integer part of UID must always be incremented for every shape added using a particular <name>.
For instance, one of the items you would get from GetAllPlugins API is “AnalogDevices.Plugins.Platforms.EvalAD2433WA1BZ_v2.0.0.0”. From this the UID <name> will be EvalAD2433WA1BZ. For the first EvalAD2433WA1BZ shape added to the system, it’s UID will be EvalAD2433WA1BZ_0. For the second shape it will be EvalAD2433WA1BZ_1 and so on.
Shape operations
Add Shape
After referring to https://wiki.analog.com/resources/tools-software/sigmastudiov2/usingsigmastudio/scripting/addshape, for A2B the following additional information is applicable.
parentUID
To add a shape to system tab this should be “Diagram_0”
To add a shape inside an A2B platform, this should be the platform uid. For instance, use “EvalAD2428WD1BZ_<zero based positive integer>” to add a shape inside the EvalAD2428WD1BZ platform.
-
newPosition – this object has two members X and Y which represent horizontal and vertical coordinates respectively on the canvas.
Remove shape
Add Connection
Remove connection
A2B Operations
Information about the various user-defined types are available at C:\Analog Devices\ADI_A2B-SSPlus_Software-Rel1.1.0\Schematics\Thrift\a2b.Thrift. This file can be opened with a notepad
Generic Devices
The following describes A2B APIs for update generic device parameters
UpdateProperties(string genericDeviceUID, “PeripheralFile”, “string”, string programmingXMLFilePath) – use this to update the peripheral programming xml
genericDeviceUID – UID of the generic device for which the parameter has to be set.
programmingXMLFilePath – Absolute path to the peripheral programming XML file.
UpdateBooleanProperty(string genericDeviceUID, “ProgramDuringDisc”, bool value) – use this to enable or disable programming of this peripheral device during network discovery.
genericDeviceUID – UID of the generic device for which the parameter has to be set.
value – true to enable programming during discovery and false to disable programming during discovery.
Stream
The following describes A2B APIs for stream operations
AddStream(string channel_uid,
ADI_A2B_STREAM streamObject) – use this to add a stream to the stream configuration list
Channel_uid – UID of the A2B channel currently in use.
streamObject – populate this object to the members available within.
UpdateNumericProperty(string channel_uid, “RemoveStream”, int streamid) – use this to delete a stream from the stream configuration list at the zero-based-positive-integer-index streamid
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateNumericProperty(string channel_uid, “MoveUp”, int streamid) – use this to move the stream at streamid up by one.
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateNumericProperty(string channel_uid, “MoveDown”, int streamid) – use this to move the stream at streamid down by one
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateStream(string channel_uid, “EditStream”, int streamid) – use this to edit stream objects that are updated to the stream list at position streamid
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateStream(string channel_uid, “StreamDestChanged”, int streamid) – use this to the destID member of stream object in stream list at position streamid
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateStream(string channel_uid, “StreamSourceChanged”, int streamid) – use this to the StreamSourceNodeID member of stream object in stream list at position streamid
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateBooleanProperty(string channel_uid, “AutoCalculateChk”, bool value) – use this to enable or disable the auto calculation of slot configuration for the current stream list
Channel_uid – UID of the A2B channel currently in use.
Value – true to enable auto calculation and false to disable auto calculation
UpdateNumericProperty(string channel_uid, “AutoCalculate”, int streamid) – use this to perform auto calculation of slot configuration for the A2B network based on the stream list.
Channel_uid – UID of the A2B channel currently in use.
streamid – zero based positive integer index of the stream object in the stream list
UpdateBooleanProperty(string channel_uid, “Download”, true) – use this send the current slot configuration register values to the A2B network
Channel_uid – UID of the A2B channel currently in use.
GetStreamInfo (string channel_uid) – use this fetch the current stream information object list
Channel_uid – UID of the A2B channel currently in use.
Bandwidth
The following sections describes APIs for bandwidth operations.
BwParams GetBWParams(string channel_uid)– use this to fetch the bandwidth configuration parameters object.
Channel_uid – UID of the A2B channel currently in use.
BwParams – An object that has all the bandwidth configuration parameters.
UpdateBWCalcNwParams(string channel_uid, BwParams bwParamsObject) – use this set the bandwidth configuration parameters object .
Channel_uid – UID of the A2B channel currently in use.
bwParamsObject – An object that has all the bandwidth configuration parameters.
UpdateBooleanProperty(string channel_uid, “ BwCalcRun ”, true) – use this to calculate bandwidth for the current network
Channel_uid – UID of the A2B channel currently in use.
BwCalc ReadBWRes(string channel_uid) – use this to fetch the calculated bandwidth results.
Channel_uid – UID of the A2B channel currently in use.
BwCalc – An object that has the results of bandwidth calculatio
Register Read / Write
The following section describes register read and write operationsThe following section describes register read and write operations
SetRegValue(string TrxID, RegAddrValPair regAddrValPair) – use this to write the register at the address with a value, both of which are specified by regAddrValPair object, in the transceiver with UID TrxID
TrxID – UID of the transceiver of interest
regAddrValPair – An object which has a member for register address and another member for value.
List <RegAddrValPair> ReadRegValue(string TrxID, List<int> registerAddressList) – use this to read the values from all the registers whose addresses are given in registerAddressList.
TrxID – UID of the transceiver of interest
regAddrValPair – An object which has a member for register address and another member for value.
registerAddressList – A list of register addresses from which the values need to be read.
A2B Shape full names