Skip to content

ZigBee Admin Interface

bradreevmx edited this page Jul 20, 2018 · 4 revisions

The ZigBeeDeviceCompliance contract includes one list of Administrators, Testers, and Mediators for the entire contract. The following describes the Administer and Tester management functions, along with the submission of Test results by a tester, and then the validation of the test record by the administrator.

API List

WriteAdmin
ReadAdminList

WriteTester
ReadTesterList

ModelListCount
ReadModelList
WriteValid
Write
Delete


Administrator List Management

WriteAdmin

This function inserts an AdminID into the Admin list. The submitter must already be on the admin list. The current list length is 5. To remove an AdminId, the value stored at the index should be set to NULL.

Input Parameters

Type Name Description
uint Index Index of the Admin List. (Starts at 0)
address AdminId New AdminId to be written.

Return Values

Type Name Description
bool Status True if the operation was successful

Example

var NewAdminId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
ZigBee.Write(1, NewAdminId, {Admin1,gas:470000});

ReadAdminList

This function returns the complete admin list. The function is publicly accessible.

Input Parameters

Type Name Description
NULL NULL NULL

Return Values

Type Name Description
address[5] ReturnList AdminList Array

Example

ZigBee.ReadAdminList();

Tester List Management

WriteTester

This function writes an Tester ID to the Tester list. Only users in the Admin List are allowed to modify the Tester list. In order to remove a tester, the TesterId at the TesterIndex should be set to NULL.

Currently, the maximum number of testers is 5.

Input Parameters

Type Name Description
uint index Tester List Index (Starts at 0)
address TesterId New Tester ID to be written to the Tester List

Return Values

Type Name Description
bool Status True if the operation was successful

Example

var TesterId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
var Index = 0
var AdminId = "0x1bbe4a661fdcb10ccc698ff484549555513684dc"
ZigBee.WriteTester(Index, TesterId, {AdminId,gas:470000})

ReadTesterList

This function returns the entire TesterList.

Currently, the maximum number of administrators per ModelId is 5.

Input Parameters

Type Name Description
NULL NULL

Return Values

Type Name Description
address[] TesterId TesterId Array

Example

ZigBee.ReadTesterList()

Compliance Record Management

ModelListCount

This function returns the total number of Models in the compliance contract. This function may be used to for exporting data to a new contract.

Input Parameters

Type Name Description
NULL NULL

Return Values

Type Name Description
uint Count Total number of compliance records

Example

ZigBee.ModelListCount()

ReadModelList

This function returns the ComplainceAddress for a model in the compliance contract.This function may be used to for exporting data to a new contract.

Input Parameters

Type Name Description
uint Index Index into the ModelList

Return Values

Type Name Description
address ComplianceId ComplianceID stored at the ModelList Index

Example

var Index = 0
ZigBee.ReadModelList(Index)

WriteValid

This function is used to write the valid flag for a compliance record. Only a user in the Admin list may call this function. A valid record may be invalidated by call this function with the valid parameter set to false,

Input Parameters

Type Name Description
address ComplainceId ComplianceId = hash(MfgName, MdlName, HwVer, FwVer, "ZigBee")
bool ValidFlag true/false

Return Values

Type Name Description
bool Status True if the operation was successful

Example

ZigBee.WriteValid(ComplianceId, true)

Write

This function is used to write a compliance record, or modify a compliance record. The normal sequence of events would be for the tester to call this function, while the Admin only needs to call the WriteValid API. If the admin calls this function, the valid flag will automatically be set to true.

Input Parameters

Type Name Description
address ComplainceId ComplianceId = hash(MfgName, MdlName, HwVer, FwVer, "ZigBee")
address ModelId Manufacturer Model ID, which is located in the DeviceInfo contract
string ExpirationDate Expiration date for the record. NULL if not applicable. Also, the record will not automatically clear the valid bit if the date has expired.
string ComplianceData JSON compliance data

Return Values

Type Name Description
bool Status True if the operation was successful

Example

ZigBee.Write(ComplianceId, ModelId, ExpirationDate, ComplianceData)

Delete

This function is used to delete a compliance record. Only the admin may call this function.

Input Parameters

Type Name Description
address ComplainceId ComplianceId = hash(MfgName, MdlName, HwVer, FwVer, "ZigBee")

Return Values

Type Name Description
bool Status True if the operation was successful

Example

ZigBee.Delete(ComplianceId)

*** TBD *** Need to add FamilyTree admin functions

Clone this wiki locally