Skip to content

Model Info User Interface

bradreevmx edited this page Jul 13, 2018 · 1 revision

The User interface is a read only interface, which allows ecosystem operators to determine the manufacturer ID of a Model, which components are contained in the model, and the ability to read a JSON description of the model.

It is expected that the ecosystem operator will first access a compliance contract to determine the ModelId, based on a unique identifier (data hashing method) supplied by the model as it attempts to join the network. All compliance contracts shall contain the ModelId. However, the DeviceInfo contract does not provide information regarding which compliance contracts reference the ModelId.

A model may have components, which are also stored in the DeviceInfo contract. However, a model is not required to have components, in which the ComponentCount returned in the Read function shall be 0.

API List

Read
ReadComponent


Read

Description

The Read function provides the manufacturer ID, JSON model data, and number of subcomponents.

Input Parameters

Type Name Description
address ModelId ModelId for the model. This value shall be obtained by the associated compliance contract

Return Values

Type Name Description
string Data JSON model data
address MfgId Manufacturer's ID
uint ComponentCount Number of components contained in the model

Example

ModelInfo.Read("0x867015b994c81df651bd4f4e66643d021545bf57"); "{\"Mfg\":\"MfgA\",\"Model\":\"ModelB\",\"HwVer\":\"Hw1\",\"FwVer\":\"Fw2\"}","0xbd4d579e0819c4ab3d1b6d59b8429218fc923507",1

ReadComponent

Description

The ReadComponent function allows the user to read each address of components contained in the model. The user must first call the Read function to determine the number of components contained int the model.

Input Parameters

Type Name Description
address ModelId ModelId for the model. This value shall be obtained by the associated compliance contract
uint ComponentIndex Index starting at 0

Return Values

Type Name Description
address Component ModelId of the component

Example

ModelInfo.ReadComponent("0x867015b994c81df651bd4f4e66643d021545bf57",0); 0xbd4d579e0819c4ab3d1b6d59b8429218fc923507

Clone this wiki locally