Skip to content

Commit

Permalink
Merge pull request #577 from zigbee-alliance/#547-Add-new-fields-into…
Browse files Browse the repository at this point in the history
…-Model-entity

#547 Add new fields into Model entity
  • Loading branch information
akarabashov committed Jun 5, 2024
2 parents 26cf245 + f9492ab commit 9cc424c
Show file tree
Hide file tree
Showing 32 changed files with 1,752 additions and 196 deletions.
75 changes: 75 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8793,6 +8793,21 @@ paths:
format: int64
managedAclExtensionRequestFlowUrl:
type: string
enhancedSetupFlowOptions:
type: integer
format: int32
enhancedSetupFlowTCUrl:
type: string
enhancedSetupFlowTCRevision:
type: integer
format: int32
enhancedSetupFlowTCDigest:
type: string
enhancedSetupFlowTCFileSize:
type: integer
format: int64
maintenanceUrl:
type: string
pagination:
type: object
properties:
Expand Down Expand Up @@ -9019,6 +9034,21 @@ paths:
format: int64
managedAclExtensionRequestFlowUrl:
type: string
enhancedSetupFlowOptions:
type: integer
format: int32
enhancedSetupFlowTCUrl:
type: string
enhancedSetupFlowTCRevision:
type: integer
format: int32
enhancedSetupFlowTCDigest:
type: string
enhancedSetupFlowTCFileSize:
type: integer
format: int64
maintenanceUrl:
type: string
default:
description: An unexpected error response.
schema:
Expand Down Expand Up @@ -22312,6 +22342,21 @@ definitions:
format: int64
managedAclExtensionRequestFlowUrl:
type: string
enhancedSetupFlowOptions:
type: integer
format: int32
enhancedSetupFlowTCUrl:
type: string
enhancedSetupFlowTCRevision:
type: integer
format: int32
enhancedSetupFlowTCDigest:
type: string
enhancedSetupFlowTCFileSize:
type: integer
format: int64
maintenanceUrl:
type: string
zigbeealliance.distributedcomplianceledger.model.ModelVersion:
type: object
properties:
Expand Down Expand Up @@ -22442,6 +22487,21 @@ definitions:
format: int64
managedAclExtensionRequestFlowUrl:
type: string
enhancedSetupFlowOptions:
type: integer
format: int32
enhancedSetupFlowTCUrl:
type: string
enhancedSetupFlowTCRevision:
type: integer
format: int32
enhancedSetupFlowTCDigest:
type: string
enhancedSetupFlowTCFileSize:
type: integer
format: int64
maintenanceUrl:
type: string
pagination:
type: object
properties:
Expand Down Expand Up @@ -22522,6 +22582,21 @@ definitions:
format: int64
managedAclExtensionRequestFlowUrl:
type: string
enhancedSetupFlowOptions:
type: integer
format: int32
enhancedSetupFlowTCUrl:
type: string
enhancedSetupFlowTCRevision:
type: integer
format: int32
enhancedSetupFlowTCDigest:
type: string
enhancedSetupFlowTCFileSize:
type: integer
format: int64
maintenanceUrl:
type: string
zigbeealliance.distributedcomplianceledger.model.QueryGetModelVersionResponse:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ Not all fields can be edited (see `EDIT_MODEL`).
- supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model.
- productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model.
- lsfURL: `optional(string)` - URL to the Localized String File of this product.
- schemaVersion: `optional(uint16)` - Schema version to support backward/forward compatability(default 0)
- enhancedSetupFlowOptions: `optional(uint16)` - enhancedSetupFlowOptions SHALL identify the configuration options for the Enhanced Setup Flow.
- enhancedSetupFlowTCUrl: `optional(string)` - enhancedSetupFlowTCUrl SHALL identify a link to the Enhanced Setup Flow Terms and Condition File for this product. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCRevision: `optional(uint16)` - enhancedSetupFlowTCRevision is an increasing positive integer indicating the latest available version of the Enhanced Setup Flow Terms and Conditions file. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCDigest: `optional(string)` - enhancedSetupFlowTCDigest SHALL contain the digest of the entire contents of the associated file downloaded from the EnhancedSetupFlowTCUrl field, encoded in base64 string representation and SHALL be used to ensure the contents of the downloaded file are authentic. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCFileSize: `optional(uint32)` - enhancedSetupFlowTCFileSize SHALL indicate the total size of the Enhanced Setup Flow Terms and Conditions file in bytes, and SHALL be used to ensure the downloaded file size is within the bounds of EnhancedSetupFlowTCFileSize. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- maintenanceUrl: `optional(string)` - maintenanceUrl SHALL identify a link to a vendor-specific URL which SHALL provide a manufacturer specific means to resolve any functionality limitations indicated by the TERMS_AND_CONDITIONS_CHANGED status code. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- schemaVersion: `optional(uint16)` - Schema version to support backward/forward compatability(default 1)
- In State:
- `model/Model/value/<vid>/<pid>`
- `model/VendorProducts/value/<vid>`
Expand Down Expand Up @@ -260,9 +266,15 @@ All non-edited fields remain the same.
- supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model.
- productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model.
- lsfURL: `optional(string)` - URL to the Localized String File of this product.
- schemaVersion: `optional(uint16)` - Schema version to support backward/forward compatability(default 0)
- lsfRevision: `optional(uint32)` - LsfRevision is a monotonically increasing positive integer indicating the latest available version of Localized String File.
- commissioningModeInitialStepsHint: `optional(uint32)` - commissioningModeInitialStepsHint SHALL identify a hint for the steps that can be used to put into commissioning mode a device that has not yet been commissioned. This field is a bitmap with values defined in the Pairing Hint Table. For example, a value of 1 (bit 0 is set) indicates that a device that has not yet been commissioned will enter Commissioning Mode upon a power cycle. Note that this value cannot be updated to 0.
- enhancedSetupFlowOptions: `optional(uint16)` - enhancedSetupFlowOptions SHALL identify the configuration options for the Enhanced Setup Flow.
- enhancedSetupFlowTCUrl: `optional(string)` - enhancedSetupFlowTCUrl SHALL identify a link to the Enhanced Setup Flow Terms and Condition File for this product. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCRevision: `optional(uint16)` - enhancedSetupFlowTCRevision is an increasing positive integer indicating the latest available version of the Enhanced Setup Flow Terms and Conditions file. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCDigest: `optional(string)` - enhancedSetupFlowTCDigest SHALL contain the digest of the entire contents of the associated file downloaded from the EnhancedSetupFlowTCUrl field, encoded in base64 string representation and SHALL be used to ensure the contents of the downloaded file are authentic. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- enhancedSetupFlowTCFileSize: `optional(uint32)` - enhancedSetupFlowTCFileSize SHALL indicate the total size of the Enhanced Setup Flow Terms and Conditions file in bytes, and SHALL be used to ensure the downloaded file size is within the bounds of EnhancedSetupFlowTCFileSize. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- maintenanceUrl: `optional(string)` - maintenanceUrl SHALL identify a link to a vendor-specific URL which SHALL provide a manufacturer specific means to resolve any functionality limitations indicated by the TERMS_AND_CONDITIONS_CHANGED status code. This field SHALL be present if and only if the EnhancedSetupFlowOptions field has bit 0 set.
- schemaVersion: `optional(uint16)` - Schema version to support backward/forward compatability(default 1)
- In State: `model/Model/value/<vid>/<pid>`
- Who can send:
- Vendor account associated with the same vid who has created the model
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/cli/auth-demo-hex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test_divider

productName="Device #1"
echo "$user adds Model with VID: $vid_in_hex_format PID: $pid"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --from=$user_address --yes)
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --enhancedSetupFlowOptions=1 --from=$user_address --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "\"code\": 0"

Expand All @@ -86,14 +86,14 @@ test_divider
vid_plus_one_in_hex_format=0xA14
vidPlusOne=$((vid_in_hex_format+1))
echo "$user adds Model with a VID: $vid_plus_one_in_hex_format PID: $pid_in_hex_format, This fails with Permission denied as the VID is not associated with this vendor account."
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_plus_one_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --from=$user_address --yes 2>&1) || true
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_plus_one_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --enhancedSetupFlowOptions=1 --from=$user_address --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "transaction should be signed by a vendor account containing the vendorID $vidPlusOne"

test_divider

echo "$user updates Model with VID: $vid_in_hex_format PID: $pid_in_hex_format"
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --partNumber=12 --from=$user_address --yes)
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --productName="$productName" --productLabel="Device Description" --partNumber=12 --enhancedSetupFlowOptions=2 --from=$user_address --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "\"code\": 0"

Expand Down
8 changes: 4 additions & 4 deletions integration_tests/cli/auth-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ vid=$RANDOM
pid=$RANDOM
productName="Device #2"
echo "$user adds Model with VID: $vid PID: $pid"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --from=$user_address --yes 2>&1) || true
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --enhancedSetupFlowOptions=1 --from=$user_address --yes 2>&1) || true
check_response_and_report "$result" "key not found" raw


Expand Down Expand Up @@ -1335,21 +1335,21 @@ test_divider

productName="Device #1"
echo "$user adds Model with VID: $vid PID: $pid"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --from=$user_address --yes)
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --enhancedSetupFlowOptions=1 --from=$user_address --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "\"code\": 0"

test_divider

vidPlusOne=$((vid+1))
echo "$user adds Model with a VID: $vidPlusOne PID: $pid, This fails with Permission denied as the VID is not associated with this vendor account."
result=$(echo "test1234" | dcld tx model add-model --vid=$vidPlusOne --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --from=$user_address --yes 2>&1) || true
result=$(echo "test1234" | dcld tx model add-model --vid=$vidPlusOne --pid=$pid --productName="$productName" --productLabel="Device Description" --commissioningCustomFlow=0 --deviceTypeID=12 --partNumber=12 --enhancedSetupFlowOptions=1 --from=$user_address --yes 2>&1) || true
result=$(get_txn_result "$result")
check_response_and_report "$result" "transaction should be signed by a vendor account containing the vendorID $vidPlusOne"

test_divider
echo "$user updates Model with VID: $vid PID: $pid"
result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --partNumber=12 --from=$user_address --yes)
result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --productName="$productName" --productLabel="Device Description" --partNumber=12 --enhancedSetupFlowOptions=2 --from=$user_address --yes)
result=$(get_txn_result "$result")
check_response_and_report "$result" "\"code\": 0"

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/cli/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ create_model_and_version() {
local _softwareVersion="$3"
local _softwareVersionString="$4"
local _user_address="$5"
result=$(echo "$passphrase" | dcld tx model add-model --vid=$_vid --pid=$_pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from=$_user_address --yes)
result=$(echo "$passphrase" | dcld tx model add-model --vid=$_vid --pid=$_pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --enhancedSetupFlowOptions=1 --from=$_user_address --yes)
result=$(get_txn_result "$result")
check_response "$result" "\"code\": 0"
result=$(echo "$passphrase" | dcld tx model add-model-version --cdVersionNumber=1 --maxApplicableSoftwareVersion=10 --minApplicableSoftwareVersion=1 --vid=$_vid --pid=$_pid --softwareVersion=$_softwareVersion --softwareVersionString=$_softwareVersionString --from=$_user_address --yes)
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/cli/compliance-demo-hex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ matter_certification_type="matter"
cd_certificate_id="some ID"

echo "Add Model with VID: $vid_in_hex_format PID: $pid_in_hex_format"
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes)
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --enhancedSetupFlowOptions=1 --from $vendor_account --yes)
result=$(get_txn_result "$result")
echo $result
check_response "$result" "\"code\": 0"
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/cli/compliance-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ check_response "$result" "No model version"
test_divider

echo "Add Model with VID: $vid PID: $pid"
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes)
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --enhancedSetupFlowOptions=1 --from $vendor_account --yes)
result=$(get_txn_result "$result")
echo $result
check_response "$result" "\"code\": 0"
Expand Down Expand Up @@ -551,7 +551,7 @@ svs=$RANDOM

# ADD MODEL
echo "Add Model with VID: $vid PID: $pid"
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --commissioningCustomFlow=0 --from $vendor_account --yes)
result=$(echo "$passphrase" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel=TestingProductLabel --partNumber=1 --enhancedSetupFlowOptions=1 --commissioningCustomFlow=0 --from $vendor_account --yes)
result=$(get_txn_result "$result")
echo $result
check_response "$result" "\"code\": 0"
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/cli/model-demo-hex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test_divider

productLabel="Device #1"
echo "Add Model with VID: $vid_in_hex_format PID: $pid_in_hex_format"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes)
result=$(echo "test1234" | dcld tx model add-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --enhancedSetupFlowOptions=1 --from=$vendor_account --yes)
result=$(get_txn_result "$result")
check_response "$result" "\"code\": 0"
echo "$result"
Expand Down Expand Up @@ -90,7 +90,7 @@ test_divider

echo "Update Model with VID: ${vid_in_hex_format} PID: ${pid_in_hex_format} with new description"
description="New Device Description"
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --from $vendor_account --yes --productLabel "$description")
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --enhancedSetupFlowOptions=2 --from $vendor_account --yes --productLabel "$description")
result=$(get_txn_result "$result")
check_response "$result" "\"code\": 0"
echo "$result"
Expand All @@ -108,7 +108,7 @@ test_divider

echo "Update Model with VID: ${vid_in_hex_format} PID: ${pid_in_hex_format} modifying supportURL"
supportURL="https://newsupporturl.test"
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --from $vendor_account --yes --supportURL "$supportURL")
result=$(echo "test1234" | dcld tx model update-model --vid=$vid_in_hex_format --pid=$pid_in_hex_format --enhancedSetupFlowOptions=2 --from $vendor_account --yes --supportURL "$supportURL")
result=$(get_txn_result "$result")
check_response "$result" "\"code\": 0"
echo "$result"
Expand Down
Loading

0 comments on commit 9cc424c

Please sign in to comment.