-
Notifications
You must be signed in to change notification settings - Fork 0
MetaData Manufacturer Interface
WriteAdmin
Delete
WriteAdmin
ReadAdminList
WriteMediator
ReadMediatorList
ReadMediatorAdminList
ReadMediationState
WriteMediatorAdmin
ExitMediationState
This function write a new Tag and Data to the ModelID.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| string | Tag | MetaData Tag |
| string | Data | Tag Value |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var Tag = 'InstallEnglish'
var Data = 'Press the learn button for three seconds, until the green LED starts to blink slowly.'
MetaData.Write(Tag, Data, {from:ContractOwner,gas:470000});
This function deletes the last MetaData Tag/Data for the modelID. If an intermediate tag needs to be modified, the manufacturer must delete all entries including the tag which needs to be modified. The manufacturer would then write the update, and all newer tags which followed from the updated record.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
MetaData.Delete(ModelId, {from:AdminA,gas:470000});
This function assigns an Admin to the device security record for the ModelID. There may be up to five administrators per ModelID record.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| uint | Index | Admin Index |
| address | NewAdmin | Administrator's ID to be written into the index |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
MetaData.WriteAdmin(ModelId, 1, AdminB, {from:AdminA,gas:470000});
This function returns the current list of Administrators.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| address | AdminList | List of administrators |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
MetaData.ReadAdminList(ModelId, {from:AdminA,gas:470000});
This function writes a mediator to the ModelID record. There may be up to 5 mediators per ModelID.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| uint | Index | Mediator Index |
| address | MediatorID | MediatorID to be written to the MediatorList |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
var Index = 0;
var MediatorId = "0x1bbe4a661fdcb10ccc698ff484549555513684dc"
MetaData.WriteMediator(ModelId, Index, MediatorId, {AdminId,gas:470000});
This function returns the entire Mediator List.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| address[] | MedaitorID | Mediator List |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
MetaData.ReadMediatorList(ModelId, {AdminId,gas:470000})
This function returns the entire list of Administrators which each Mediator has voted for.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| address[] | MedaitorID | Mediator List |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
MetaData.ReadMediatorAdminList(ModelId, {AdminId,gas:470000})
This function returns the current mediation state for the ModelID.
The mediation states are as follows:
| State | Value |
|---|---|
| MediationStateNormal | 0 |
| MediationStateInMediation | 1 |
| MediationStateReadyForNewAdmin | 2 |
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| utin | MediationState | Mediation State |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
MetaData.ReadMediationState(ModelId, {AdminId,gas:470000})
A mediator shall use this function to write a new administrator.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| uint | Index | Mediator's index |
| address | AdminID | New administrator's ID |
| Type | Name | Description |
|---|---|---|
| bool | Status | True when successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
var Index = 1
var NewAdmin = "0xbd4d579e0819c4ab3d1b6d59b8429218fc92111"
MetaData.WriteMediatorAdmin(ModelId, Index, NewAdmin, {AdminId,gas:470000})
Once a new admin has been added, based on the agreement of the mediators, the new admin will take ownership of the record and exit mediation.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| bool | Status | True when successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
MetaData.ExitMediationState(ModelId, {AdminId,gas:470000})