Skip to content

Commit

Permalink
Merge branch 'master' into Tweaks-to-EVSE-Test-plans-based-on-review(…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesharrow authored Feb 6, 2024
2 parents 52bdb70 + 1259831 commit e707d8b
Show file tree
Hide file tree
Showing 228 changed files with 9,465 additions and 196,777 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/operational-state-oven-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \
Expand Down
6 changes: 6 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ if ((CONFIG_BT_ENABLED) AND (CONFIG_ENABLE_CHIPOBLE))
endif()
endif()

if (CONFIG_ENABLE_PERSIST_SUBSCRIPTIONS)
chip_gn_arg_append("chip_persist_subscriptions" "true")
else()
chip_gn_arg_append("chip_persist_subscriptions" "false")
endif()

if (CONFIG_ENABLE_ESP32_BLE_CONTROLLER)
chip_gn_arg_append("chip_enable_ble_controller" "true")
endif()
Expand Down
7 changes: 7 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ menu "CHIP Core"
help
Some device types don't require the read client. Enabling this option may save some flash/ram.

config ENABLE_PERSIST_SUBSCRIPTIONS
bool "Enable persist subscriptions"
default y
help
Enable persist subscriptions to make the device resume the subscriptions from the persist
subscriptions information after reboot.

config BUILD_CHIP_TESTS
bool "Build CHIP tests"
default n
Expand Down
1 change: 1 addition & 0 deletions docs/clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Generally regenerate using one of:
| 152 | 0x98 | DeviceEnergyManagement |
| 153 | 0x99 | EnergyEvse |
| 155 | 0x9B | EnergyPreference |
| 156 | 0x9C | PowerTopology |
| 157 | 0x9D | EnergyEvseMode |
| 159 | 0x9F | DeviceEnergyManagementMode |
| 257 | 0x101 | DoorLock |
Expand Down
27 changes: 27 additions & 0 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,33 @@ Complete the following steps:
1. Reboot your Raspberry Pi after installing `pi-bluetooth`.
#### Enable experimental Bluetooth support in BlueZ
The Matter application on Linux uses BlueZ to communicate with the Bluetooth
controller. The BlueZ version that comes with Ubuntu 22.04 does not support all
the features required by the Matter application by default. To enable these
features, you need to enable experimental Bluetooth support in BlueZ.
1. Edit the `bluetooth.service` unit by running the following command:
```sh
sudo systemctl edit bluetooth.service
```
1. Add the following content to the override file:
```ini
[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd -E
```
1. Restart the Bluetooth service by running the following command:
```sh
sudo systemctl restart bluetooth.service
```
#### Configuring wpa_supplicant for storing permanent changes
By default, wpa_supplicant is not allowed to update (overwrite) configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -815,10 +819,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** Commands to trigger a Node to allow a new Administrator to commission it. */
Expand Down Expand Up @@ -2390,8 +2406,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -768,10 +772,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
Expand Down Expand Up @@ -2103,8 +2119,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -1753,10 +1757,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
Expand Down Expand Up @@ -7380,12 +7396,14 @@ endpoint 0 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
handle command TimeSnapshotResponse;
handle command PayloadTestRequest;
handle command PayloadTestResponse;
}

server cluster SoftwareDiagnostics {
Expand Down
16 changes: 16 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2863,6 +2863,22 @@
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "PayloadTestRequest",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "PayloadTestResponse",
"code": 4,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -1633,10 +1637,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
Expand Down Expand Up @@ -6071,12 +6087,14 @@ endpoint 0 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
handle command TimeSnapshotResponse;
handle command PayloadTestRequest;
handle command PayloadTestResponse;
}

server cluster SoftwareDiagnostics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2464,6 +2464,22 @@
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "PayloadTestRequest",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "PayloadTestResponse",
"code": 4,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class AddressCommissioningFragment : Fragment() {
val address = binding.addressEditText.text.toString()
val discriminator = binding.discriminatorEditText.text.toString()
val pincode = binding.pincodeEditText.text.toString()
val port = binding.portEditText.text.toString()

if (address.isEmpty() || discriminator.isEmpty() || pincode.isEmpty()) {
Log.e(TAG, "Address, discriminator, or pincode was empty: $address $discriminator $pincode")
Expand All @@ -62,7 +63,8 @@ class AddressCommissioningFragment : Fragment() {
CHIPDeviceInfo(
discriminator = discriminator.toInt(),
setupPinCode = pincode.toLong(),
ipAddress = address
ipAddress = address,
port = port.toInt()
)
)
}
Expand Down Expand Up @@ -169,7 +171,7 @@ class AddressCommissioningFragment : Fragment() {
val deviceController = ChipClient.getDeviceController(requireContext())
for (i in 0..10) {
val device = deviceController.getDiscoveredDevice(i) ?: break
ipAddressList.add("${device.ipAddress}, ${device.discriminator}")
ipAddressList.add("${device.ipAddress}, ${device.discriminator}, ${device.port}")
}
requireActivity().runOnUiThread {
binding.discoverListSpinner.adapter =
Expand All @@ -179,9 +181,11 @@ class AddressCommissioningFragment : Fragment() {
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
val address = ipAddressList[position].split(",")[0].trim()
val discriminator = ipAddressList[position].split(",")[1].trim()
val port = ipAddressList[position].split(",")[2].trim()

binding.addressEditText.setText(address)
binding.discriminatorEditText.setText(discriminator)
binding.portEditText.setText(port)
}

override fun onNothingSelected(parent: AdapterView<*>) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class DeviceProvisioningFragment : Fragment() {

private fun pairDeviceWithAddress() {
// IANA CHIP port
val port = 5540
val id = DeviceIdUtil.getNextAvailableId(requireContext())

DeviceIdUtil.setNextAvailableId(requireContext(), id + 1)
Expand All @@ -171,7 +170,7 @@ class DeviceProvisioningFragment : Fragment() {
deviceController.pairDeviceWithAddress(
id,
deviceInfo.ipAddress,
port,
deviceInfo.port,
deviceInfo.discriminator,
deviceInfo.setupPinCode,
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data class CHIPDeviceInfo(
val discoveryCapabilities: MutableSet<DiscoveryCapability> = mutableSetOf(),
val isShortDiscriminator: Boolean = false,
val ipAddress: String? = null,
val port: Int = 5540
) : Parcelable {

companion object {
Expand Down
Loading

0 comments on commit e707d8b

Please sign in to comment.