-
Notifications
You must be signed in to change notification settings - Fork 0
ZigBee Admin Interface
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.
ModelListCount
ReadModelList
WriteValid
Write
Delete
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.
| Type | Name | Description |
|---|---|---|
| uint | Index | Index of the Admin List. (Starts at 0) |
| address | AdminId | New AdminId to be written. |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var NewAdminId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
ZigBee.Write(1, NewAdminId, {Admin1,gas:470000});
This function returns the complete admin list. The function is publicly accessible.
| Type | Name | Description |
|---|---|---|
| NULL | NULL | NULL |
| Type | Name | Description |
|---|---|---|
| address[5] | ReturnList | AdminList Array |
ZigBee.ReadAdminList();
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.
| Type | Name | Description |
|---|---|---|
| uint | index | Tester List Index (Starts at 0) |
| address | TesterId | New Tester ID to be written to the Tester List |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
var TesterId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507"
var Index = 0
var AdminId = "0x1bbe4a661fdcb10ccc698ff484549555513684dc"
ZigBee.WriteTester(Index, TesterId, {AdminId,gas:470000})
This function returns the entire TesterList.
Currently, the maximum number of administrators per ModelId is 5.
| Type | Name | Description |
|---|---|---|
| NULL | NULL |
| Type | Name | Description |
|---|---|---|
| address[] | TesterId | TesterId Array |
ZigBee.ReadTesterList()
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.
| Type | Name | Description |
|---|---|---|
| NULL | NULL |
| Type | Name | Description |
|---|---|---|
| uint | Count | Total number of compliance records |
ZigBee.ModelListCount()
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.
| Type | Name | Description |
|---|---|---|
| uint | Index | Index into the ModelList |
| Type | Name | Description |
|---|---|---|
| address | ComplianceId | ComplianceID stored at the ModelList Index |
var Index = 0
ZigBee.ReadModelList(Index)
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,
| Type | Name | Description |
|---|---|---|
| address | ComplainceId | ComplianceId = hash(MfgName, MdlName, HwVer, FwVer, "ZigBee") |
| bool | ValidFlag | true/false |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
ZigBee.WriteValid(ComplianceId, true)
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.
| 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 |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
ZigBee.Write(ComplianceId, ModelId, ExpirationDate, ComplianceData)
This function is used to delete a compliance record. Only the admin may call this function.
| Type | Name | Description |
|---|---|---|
| address | ComplainceId | ComplianceId = hash(MfgName, MdlName, HwVer, FwVer, "ZigBee") |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if the operation was successful |
ZigBee.Delete(ComplianceId)
*** TBD *** Need to add FamilyTree admin functions