-
Notifications
You must be signed in to change notification settings - Fork 0
Device Security Manufacturer Interface
WriteAdmin
Delete
WriteAdmin
ReadAdminList
WriteMediator
ReadMediatorList
ReadMediatorAdminList
ReadMediationState
WriteMediatorAdmin
ExitMediationState
This function write a new set of security, MUD, and firmware version information to a given ModelId. The ModelId is created through the WriteAdmin function. A ModelId must first be assigned an Admin prior to writing version information.
Often portions of the security record may not change between versions. However, all portions of the record must be written for each version to allow for easier reading of the record by the user.
Each write will append the new input to the end of the ModelID Security record.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| string | MUD | JSON manufacture usage data per IETF MUD. |
| string | Security | JSON security assertion |
| string | VersionName | Version name, which shall match the version reported by the device |
| string | URI | Firmware update URI |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var JsonData = '{"Mfg":"MfgA","Model":"ModelB","HwVer":"Hw1","FwVer":"Fw2"}'
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
DeviceSecurity.Write(ModelId, JsonData, {from:ContractOwner,gas:470000});
This function deletes the last security entry for the modelID. If an intermediate version needs to be modified, the manufacturer must delete all entries including the version which needs to be modified. The manufacturer would then write the update, and all newer versions 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"
DeviceSecurity.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";
DeviceSecurity.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";
DeviceSecurity.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"
DeviceSecurty.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"
DeviceSecurity.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"
DeviceSecurity.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"
DeviceSecurity.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"
DeviceSecurity.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"
DeviceSecurity.ExitMediationState(ModelId, {AdminId,gas:470000})