\u001b[0m: \u001b[1;36m1\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials.Attributes.ClusterRevision'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m}\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1m}\u001b[0m\n",
- "\u001b[1m}\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "await devCtrl.ReadAttribute(1, [(Clusters.OperationalCredentials)])"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 27,
- "id": "6802862a",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "{\n",
- "│ 0: {\n",
- "│ │ <class 'chip.clusters.Objects.Descriptor'>: Descriptor(\n",
- "│ │ │ deviceList=[\n",
- "│ │ │ │ DeviceType(\n",
- "│ │ │ │ │ type=22,\n",
- "│ │ │ │ │ revision=1\n",
- "│ │ │ │ )\n",
- "│ │ │ ],\n",
- "│ │ │ serverList=[\n",
- "│ │ │ │ 3,\n",
- "│ │ │ │ 4,\n",
- "│ │ │ │ 29,\n",
- "│ │ │ │ 30,\n",
- "│ │ │ │ 31,\n",
- "│ │ │ │ 40,\n",
- "│ │ │ │ 41,\n",
- "│ │ │ │ 42,\n",
- "│ │ │ │ 46,\n",
- "│ │ │ │ 48,\n",
- "│ │ │ │ 49,\n",
- "│ │ │ │ 50,\n",
- "│ │ │ │ 51,\n",
- "│ │ │ │ 52,\n",
- "│ │ │ │ 53,\n",
- "│ │ │ │ 54,\n",
- "│ │ │ │ 55,\n",
- "│ │ │ │ 60,\n",
- "│ │ │ │ 62,\n",
- "│ │ │ │ 63,\n",
- "│ │ │ │ 64,\n",
- "│ │ │ │ 65,\n",
- "│ │ │ │ 1029\n",
- "│ │ │ ],\n",
- "│ │ │ clientList=[],\n",
- "│ │ │ partsList=[\n",
- "│ │ │ │ 1,\n",
- "│ │ │ │ 2\n",
- "│ │ │ ],\n",
- "│ │ │ attributeList=None,\n",
- "│ │ │ featureMap=None,\n",
- "│ │ │ clusterRevision=1\n",
- "│ │ )\n",
- "│ },\n",
- "│ 1: {\n",
- "│ │ <class 'chip.clusters.Objects.Descriptor'>: Descriptor(\n",
- "│ │ │ deviceList=[\n",
- "│ │ │ │ DeviceType(\n",
- "│ │ │ │ │ type=22,\n",
- "│ │ │ │ │ revision=1\n",
- "│ │ │ │ )\n",
- "│ │ │ ],\n",
- "│ │ │ serverList=[\n",
- "│ │ │ │ 3,\n",
- "│ │ │ │ 4,\n",
- "│ │ │ │ 5,\n",
- "│ │ │ │ 6,\n",
- "│ │ │ │ 7,\n",
- "│ │ │ │ 8,\n",
- "│ │ │ │ 15,\n",
- "│ │ │ │ 29,\n",
- "│ │ │ │ 30,\n",
- "│ │ │ │ 37,\n",
- "│ │ │ │ 47,\n",
- "│ │ │ │ 57,\n",
- "│ │ │ │ 59,\n",
- "│ │ │ │ 64,\n",
- "│ │ │ │ 65,\n",
- "│ │ │ │ 69,\n",
- "│ │ │ │ 80,\n",
- "│ │ │ │ 257,\n",
- "│ │ │ │ 258,\n",
- "│ │ │ │ 259,\n",
- "│ │ │ │ 512,\n",
- "│ │ │ │ 513,\n",
- "│ │ │ │ 516,\n",
- "│ │ │ │ 768,\n",
- "│ │ │ │ 1024,\n",
- "│ │ │ │ 1026,\n",
- "│ │ │ │ 1027,\n",
- "│ │ │ │ 1028,\n",
- "│ │ │ │ 1029,\n",
- "│ │ │ │ 1030,\n",
- "│ │ │ │ 1280,\n",
- "│ │ │ │ 1283,\n",
- "│ │ │ │ 1284,\n",
- "│ │ │ │ 1285,\n",
- "│ │ │ │ 1286,\n",
- "│ │ │ │ 1287,\n",
- "│ │ │ │ 1288,\n",
- "│ │ │ │ 1289,\n",
- "│ │ │ │ 1290,\n",
- "│ │ │ │ 1291,\n",
- "│ │ │ │ 1292,\n",
- "│ │ │ │ 1293,\n",
- "│ │ │ │ 1294,\n",
- "│ │ │ │ 1295,\n",
- "│ │ │ │ 2820\n",
- "│ │ │ ],\n",
- "│ │ │ clientList=[],\n",
- "│ │ │ partsList=[],\n",
- "│ │ │ attributeList=None,\n",
- "│ │ │ featureMap=None,\n",
- "│ │ │ clusterRevision=1\n",
- "│ │ )\n",
- "│ },\n",
- "│ 2: {\n",
- "│ │ <class 'chip.clusters.Objects.Descriptor'>: Descriptor(\n",
- "│ │ │ deviceList=[\n",
- "│ │ │ │ DeviceType(\n",
- "│ │ │ │ │ type=22,\n",
- "│ │ │ │ │ revision=1\n",
- "│ │ │ │ )\n",
- "│ │ │ ],\n",
- "│ │ │ serverList=[\n",
- "│ │ │ │ 4,\n",
- "│ │ │ │ 6,\n",
- "│ │ │ │ 29,\n",
- "│ │ │ │ 1030\n",
- "│ │ │ ],\n",
- "│ │ │ clientList=[],\n",
- "│ │ │ partsList=[],\n",
- "│ │ │ attributeList=None,\n",
- "│ │ │ featureMap=None,\n",
- "│ │ │ clusterRevision=1\n",
- "│ │ )\n",
- "│ }\n",
- "}\n",
- "
\n"
- ],
- "text/plain": [
- "\n",
- "\u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.Descriptor'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;35mDescriptor\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mdeviceList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mDeviceType\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m22\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mrevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mserverList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m3\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m4\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m29\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m30\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m31\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m40\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m41\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m42\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m46\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m48\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m49\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m50\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m51\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m52\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m53\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m54\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m55\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m60\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m62\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m63\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m64\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m65\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1029\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclientList\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mpartsList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m2\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mattributeList\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mfeatureMap\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclusterRevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1m}\u001b[0m,\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m1\u001b[0m: \u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.Descriptor'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;35mDescriptor\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mdeviceList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mDeviceType\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m22\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mrevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mserverList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m3\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m4\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m5\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m6\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m7\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m8\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m15\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m29\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m30\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m37\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m47\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m57\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m59\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m64\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m65\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m69\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m80\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m257\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m258\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m259\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m512\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m513\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m516\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m768\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1024\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1026\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1027\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1028\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1029\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1030\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1280\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1283\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1284\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1285\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1286\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1287\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1288\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1289\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1290\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1291\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1292\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1293\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1294\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1295\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m2820\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclientList\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mpartsList\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mattributeList\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mfeatureMap\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclusterRevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1m}\u001b[0m,\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m2\u001b[0m: \u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.Descriptor'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;35mDescriptor\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mdeviceList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mDeviceType\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m22\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mrevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mserverList\u001b[0m=\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m4\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m6\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m29\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;36m1030\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclientList\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mpartsList\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mattributeList\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mfeatureMap\u001b[0m=\u001b[3;35mNone\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[33mclusterRevision\u001b[0m=\u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m)\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1m}\u001b[0m\n",
- "\u001b[1m}\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "await devCtrl.ReadAttribute(1, [(Clusters.Descriptor)], True)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "dbade62b",
- "metadata": {},
- "source": [
- "Note that the `FabricsList` contains just a single item with a `fabriIndex` of 1, and a `fabricId` of 1."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "7326ae6a",
- "metadata": {
- "tags": []
- },
- "source": [
- "### Create Controller on Fabric B"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 23,
- "id": "a975776b",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "[\n",
- "│ 1,\n",
- "│ 2,\n",
- "│ 3,\n",
- "│ 4\n",
- "]\n",
- "
\n"
- ],
- "text/plain": [
- "\n",
- "\u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m1\u001b[0m,\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m2\u001b[0m,\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m3\u001b[0m,\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m4\u001b[0m\n",
- "\u001b[1m]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "a = [1, 2, 3, 4]\n",
- "a"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "72b857b3",
- "metadata": {},
- "source": [
- "### Open Commissioning Window\n",
- "\n",
- "The target right now doesn't accept commissioning requests. So let's go ahead and open the commissioning window to permit the second controller on Fabric B to commission the target. This request has to originate from the 1st controller."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "id": "f4fca3f4",
- "metadata": {},
- "outputs": [],
- "source": [
- "await devCtrl.SendCommand(1, 0, Clusters.AdministratorCommissioning.Commands.OpenBasicCommissioningWindow(100))"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "b7b2215e",
- "metadata": {},
- "source": [
- "### Commission Target on Fabric B"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "id": "41255a44",
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "2021-12-30 21:35:59 johnsj-macbookpro1.roam.corp.google.com chip.CTL[58883] ERROR Unable to find country code, defaulting to WW\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Established CASE with Device\n"
- ]
- },
- {
- "data": {
- "text/html": [
- "True\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[3;92mTrue\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Node address has been updated\n",
- "Commissioning complete\n"
- ]
- }
- ],
- "source": [
- "devCtrl2.CommissionIP(b'127.0.0.1', 20202021, 1)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "b17289ff",
- "metadata": {},
- "source": [
- "### Read out the Fabric List to validate"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "id": "903cb0fd",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "{\n",
- "│ 0: {\n",
- "│ │ <class 'chip.clusters.Objects.OperationalCredentials'>: {\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.FabricsList'>: [\n",
- "│ │ │ │ FabricDescriptor(\n",
- "│ │ │ │ │ fabricIndex=1,\n",
- "│ │ │ │ │ rootPublicKey=b'\\x04b\\xeeV\\x80\\x01\\xee\\xab1\\x0f|\\x01\\xc1\\xaf5\\x14\\xf0\\x18\\x8f\\xa2\\xa3\\xa8\\x8b \\x0c\\x8c\\xd5\\xb0\\xf6]BN\\rS=\\xa4U\\xeb\\xf5\\x82\\xbbdKU\\xc8\\xe9\\x16\\xeao}\\xcc\\xce<\\xbf^\\xd5\\xa5\\x06,L\\x93\\x1dX\\xc5\\xfc',\n",
- "│ │ │ │ │ vendorId=26464,\n",
- "│ │ │ │ │ fabricId=1,\n",
- "│ │ │ │ │ nodeId=1,\n",
- "│ │ │ │ │ label=''\n",
- "│ │ │ │ ),\n",
- "│ │ │ │ FabricDescriptor(\n",
- "│ │ │ │ │ fabricIndex=2,\n",
- "│ │ │ │ │ rootPublicKey=b'\\x04G+A\\xc6\\x15\\xb0\\xa6\\x1e\\xb2_J\\x8e\\xb1b\\xc6\\x16\\xcd\\xa8\\xe63\\x98\\xb8\\x7fr\\x9a\\xfe\\x01#\\xe0\\x8fw4\\xc1[\\x17\\xd1\\x81.\\xa0\\r\\x90\\xef|\\xf2\\xe3\\xe3\\xf6\\x82\\x91@U\\x90N\\xbd\\xdb\\xb2 h\\r\\x10w\\xf69\\x93',\n",
- "│ │ │ │ │ vendorId=26464,\n",
- "│ │ │ │ │ fabricId=2,\n",
- "│ │ │ │ │ nodeId=1,\n",
- "│ │ │ │ │ label=''\n",
- "│ │ │ │ )\n",
- "│ │ │ ],\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.SupportedFabrics'>: 16,\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.CommissionedFabrics'>: 2,\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.TrustedRootCertificates'>: [\n",
- "│ │ │ │ b'\\x150\\x01\\x01\\x00$\\x02\\x017\\x03$\\x14\\x00$\\x15\\x01\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x14\\x00$\\x15\\x01\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04b\\xeeV\\x80\\x01\\xee\\xab1\\x0f|\\x01\\xc1\\xaf5\\x14\\xf0\\x18\\x8f\\xa2\\xa3\\xa8\\x8b \\x0c\\x8c\\xd5\\xb0\\xf6]BN\\rS=\\xa4U\\xeb\\xf5\\x82\\xbbdKU\\xc8\\xe9\\x16\\xeao}\\xcc\\xce<\\xbf^\\xd5\\xa5\\x06,L\\x93\\x1dX\\xc5\\xfc7\\n5\\x01)\\x01\\x18$\\x02`0\\x04\\x14q9\\x96)~h\\xbc\\x04:\\xc5\\x12\\xeb\\xa8\\x16y\\xd4\\xb2C\\xba\\xf50\\x05\\x14q9\\x96)~h\\xbc\\x04:\\xc5\\x12\\xeb\\xa8\\x16y\\xd4\\xb2C\\xba\\xf5\\x180\\x0b@\\x13K\\x909\\xd6\\xf2\\xbb\\x1c\\\\R/E\\xe7\\x00y\\xbf^d8\\x05\\x89\\x8c\\xbeK\\x14O\\xac\\x8c\\xd44\\x93\\n\\xb1\\xe6k\\xa7\\x9c\\xdc\\xc5\\xffR,\\xcc\\xb5\\xc4\\x84\\x01\\x92\\x9d.\\x9b\\xda\\x0f\\x1d\\xa2\\xccEz-\\x13\\x05\\x12\\x1d\\xcb\\x18',\n",
- "│ │ │ │ b'\\x150\\x01\\x01\\x00$\\x02\\x017\\x03$\\x14\\x00$\\x15\\x02\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x14\\x00$\\x15\\x02\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04G+A\\xc6\\x15\\xb0\\xa6\\x1e\\xb2_J\\x8e\\xb1b\\xc6\\x16\\xcd\\xa8\\xe63\\x98\\xb8\\x7fr\\x9a\\xfe\\x01#\\xe0\\x8fw4\\xc1[\\x17\\xd1\\x81.\\xa0\\r\\x90\\xef|\\xf2\\xe3\\xe3\\xf6\\x82\\x91@U\\x90N\\xbd\\xdb\\xb2 h\\r\\x10w\\xf69\\x937\\n5\\x01)\\x01\\x18$\\x02`0\\x04\\x14\\xc6\\xb8;\\xbf\"u\\xb8f\"\\x99\\x10\\xc5o\\xdf\\xc4(\\x1b\\xbd\\xeeh0\\x05\\x14\\xc6\\xb8;\\xbf\"u\\xb8f\"\\x99\\x10\\xc5o\\xdf\\xc4(\\x1b\\xbd\\xeeh\\x180\\x0b@\\tQ;Y\\xb6\\x82I[\\x85k\\xfdot\\xb6\\x98\\x04\\x1d\\xf9SJ\\xf74\\xfa\\xbc\\xa1OWM\\xef\\xec\\xcf|\\xad[\\x17\\xd5/\\xa9\\xbb\\xb4\\xbc\\xb1\\xafa\\x06\\xdb\\xcd]E\\xdf\\x84\\xcf\\xb6\\x10\\xd9\\xc7\\xf5l\\xef\\x96K6\\xbd\\xa5\\x18'\n",
- "│ │ │ ],\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.CurrentFabricIndex'>: 2,\n",
- "│ │ │ <class 'chip.clusters.Objects.OperationalCredentials.Attributes.ClusterRevision'>: 1\n",
- "│ │ }\n",
- "│ }\n",
- "}\n",
- "
\n"
- ],
- "text/plain": [
- "\n",
- "\u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m{\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials.Attributes.FabricsList'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mFabricDescriptor\u001b[0m\u001b[1m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mfabricIndex\u001b[0m=\u001b[1;36m1\u001b[0m,\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mrootPublicKey\u001b[0m=\u001b[32mb\u001b[0m\u001b[32m'\\x04b\\xeeV\\x80\\x01\\xee\\xab1\\x0f|\\x01\\xc1\\xaf5\\x14\\xf0\\x18\\x8f\\xa2\\xa3\\xa8\\x8b \\x0c\\x8c\\xd5\\xb0\\xf6\u001b[0m\u001b[32m]\u001b[0m\u001b[32mBN\\\u001b[0m\u001b[32mrS\u001b[0m\u001b[32m=\\xa4U\\xeb\\xf5\\x82\\xbbdKU\\xc8\\xe9\\x16\\xeao\u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\xcc\\xce\u001b[0m\u001b[32m<\u001b[0m\u001b[32m\\xbf^\\xd5\\xa5\\x06,L\\x93\\x1dX\\xc5\\xfc'\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mvendorId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m26464\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mfabricId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mnodeId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mlabel\u001b[0m\u001b[39m=\u001b[0m\u001b[32m''\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mFabricDescriptor\u001b[0m\u001b[1;39m(\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mfabricIndex\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mrootPublicKey\u001b[0m\u001b[39m=\u001b[0m\u001b[32mb\u001b[0m\u001b[32m'\\x04G+A\\xc6\\x15\\xb0\\xa6\\x1e\\xb2_J\\x8e\\xb1b\\xc6\\x16\\xcd\\xa8\\xe63\\x98\\xb8\\x7fr\\x9a\\xfe\\x01#\\xe0\\x8fw4\\xc1\u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\x17\\xd1\\x81.\\xa0\\r\\x90\\xef|\\xf2\\xe3\\xe3\\xf6\\x82\\x91@U\\x90N\\xbd\\xdb\\xb2 h\\r\\x10w\\xf69\\x93'\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mvendorId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m26464\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mfabricId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mnodeId\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mlabel\u001b[0m\u001b[39m=\u001b[0m\u001b[32m''\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;39m)\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[39m\u001b[0m: \u001b[1;36m16\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials.Attributes.CommissionedFabrics'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m2\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials.Attributes.TrustedRootCertificates'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m[\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[32mb'\\x150\\x01\\x01\\x00$\\x02\\x017\\x03$\\x14\\x00$\\x15\\x01\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x14\\x00$\\x15\\x01\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04b\\xeeV\\x80\\x01\\xee\\xab1\\x0f|\\x01\\xc1\\xaf5\\x14\\xf0\\x18\\x8f\\xa2\\xa3\\xa8\\x8b \\x0c\\x8c\\xd5\\xb0\\xf6\u001b[0m\u001b[32m]\u001b[0m\u001b[32mBN\\\u001b[0m\u001b[32mrS\u001b[0m\u001b[32m=\\xa4U\\xeb\\xf5\\x82\\xbbdKU\\xc8\\xe9\\x16\\xeao\u001b[0m\u001b[32m}\u001b[0m\u001b[32m\\xcc\\xce\u001b[0m\u001b[32m<\u001b[0m\u001b[32m\\xbf^\\xd5\\xa5\\x06,L\\x93\\x1dX\\xc5\\xfc7\\n5\\x01\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\x01\\x18$\\x02`0\\x04\\x14q9\\x96\u001b[0m\u001b[32m)\u001b[0m\u001b[32m~h\\xbc\\x04:\\xc5\\x12\\xeb\\xa8\\x16y\\xd4\\xb2C\\xba\\xf50\\x05\\x14q9\\x96\u001b[0m\u001b[32m)\u001b[0m\u001b[32m~h\\xbc\\x04:\\xc5\\x12\\xeb\\xa8\\x16y\\xd4\\xb2C\\xba\\xf5\\x180\\x0b@\\x13K\\x909\\xd6\\xf2\\xbb\\x1c\\\\R/E\\xe7\\x00y\\xbf^d8\\x05\\x89\\x8c\\xbeK\\x14O\\xac\\x8c\\xd44\\x93\\n\\xb1\\xe6k\\xa7\\x9c\\xdc\\xc5\\xffR,\\xcc\\xb5\\xc4\\x84\\x01\\x92\\x9d.\\x9b\\xda\\x0f\\x1d\\xa2\\xccEz-\\x13\\x05\\x12\\x1d\\xcb\\x18'\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ │ \u001b[0m\u001b[32mb'\\x150\\x01\\x01\\x00$\\x02\\x017\\x03$\\x14\\x00$\\x15\\x02\\x18&\\x04\\x80\"\\x81\\'&\\x05\\x80%M:7\\x06$\\x14\\x00$\\x15\\x02\\x18$\\x07\\x01$\\x08\\x010\\tA\\x04G+A\\xc6\\x15\\xb0\\xa6\\x1e\\xb2_J\\x8e\\xb1b\\xc6\\x16\\xcd\\xa8\\xe63\\x98\\xb8\\x7fr\\x9a\\xfe\\x01#\\xe0\\x8fw4\\xc1\u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\x17\\xd1\\x81.\\xa0\\r\\x90\\xef|\\xf2\\xe3\\xe3\\xf6\\x82\\x91@U\\x90N\\xbd\\xdb\\xb2 h\\r\\x10w\\xf69\\x937\\n5\\x01\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\x01\\x18$\\x02`0\\x04\\x14\\xc6\\xb8;\\xbf\"u\\xb8f\"\\x99\\x10\\xc5o\\xdf\\xc4\u001b[0m\u001b[32m(\u001b[0m\u001b[32m\\x1b\\xbd\\xeeh0\\x05\\x14\\xc6\\xb8;\\xbf\"u\\xb8f\"\\x99\\x10\\xc5o\\xdf\\xc4\u001b[0m\u001b[32m(\u001b[0m\u001b[32m\\x1b\\xbd\\xeeh\\x180\\x0b@\\tQ;Y\\xb6\\x82I\u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\x85k\\xfdot\\xb6\\x98\\x04\\x1d\\xf9SJ\\xf74\\xfa\\xbc\\xa1OWM\\xef\\xec\\xcf|\\xad\u001b[0m\u001b[32m[\u001b[0m\u001b[32m\\x17\\xd5/\\xa9\\xbb\\xb4\\xbc\\xb1\\xafa\\x06\\xdb\\xcd\u001b[0m\u001b[32m]\u001b[0m\u001b[32mE\\xdf\\x84\\xcf\\xb6\\x10\\xd9\\xc7\\xf5l\\xef\\x96K6\\xbd\\xa5\\x18'\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1;39m]\u001b[0m\u001b[39m,\u001b[0m\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[39m\u001b[0m: \u001b[1;36m2\u001b[0m,\n",
- "\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials.Attributes.ClusterRevision'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m1\u001b[0m\n",
- "\u001b[2;32m│ │ \u001b[0m\u001b[1m}\u001b[0m\n",
- "\u001b[2;32m│ \u001b[0m\u001b[1m}\u001b[0m\n",
- "\u001b[1m}\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "await devCtrl2.ReadAttribute(1, [(Clusters.OperationalCredentials)])"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "ebf71c37",
- "metadata": {},
- "source": [
- "Note that the FabricsList contains two items now!"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "matter-env-2",
- "language": "python",
- "name": "matter-env-2"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.8.2+chromium.10"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/README.md b/README.md
index 462457a3307e2e..f99153876e7b43 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@
![Examples - Linux Standalone](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20Linux%20Standalone/badge.svg)
![Examples - ESP32](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20ESP32/badge.svg)
![Examples - K32W with SE051](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20K32W%20with%20SE051/badge.svg)
+![Examples - i.MX Linux](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20i.MX%20Linux/badge.svg)
![Android](https://github.com/project-chip/connectedhomeip/workflows/Android/badge.svg)
diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig
index 63535664264835..be7a942a113339 100644
--- a/config/esp32/components/chip/Kconfig
+++ b/config/esp32/components/chip/Kconfig
@@ -47,6 +47,16 @@ menu "CHIP Core"
A Binding object is used to configure how the local device communicates with
a remote entity, be it a cloud service, a mobile application, or another device.
+ config MAX_FABRICS
+ int "Max Fabrics"
+ range 5 255
+ default 5
+ help
+ The maxinum number of fabrics the device can participate in.
+
+ Each fabric can provision the device with its unique operational credentials and
+ manage its own access control lists.
+
config MAX_PEER_NODES
int "Max Peer Nodes"
range 0 65535
diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig
index 09f6343bbfeceb..ee537f146114a4 100644
--- a/config/nrfconnect/chip-module/Kconfig
+++ b/config/nrfconnect/chip-module/Kconfig
@@ -47,4 +47,5 @@ config CHIP_OTA_REQUESTOR_BUFFER_SIZE
# See config/zephyr/Kconfig for full definition
config CHIP_OTA_IMAGE_BUILD
bool
+ default y if CHIP_OTA_REQUESTOR
depends on SIGN_IMAGES
diff --git a/docs/guides/troubleshooting_avahi.md b/docs/guides/troubleshooting_avahi.md
new file mode 100644
index 00000000000000..c86b3ec1071cc6
--- /dev/null
+++ b/docs/guides/troubleshooting_avahi.md
@@ -0,0 +1,36 @@
+# Troubleshooting Avahi
+
+## Resetting the cache
+
+Avahi keeps a cache of old results. To reset the cache, kill the daemon. It will
+auto-restart.
+
+`sudo avahi-daemon --kill`
+
+## Stopping the daemon
+
+If you really want to stop the daemon, killing it is not sufficient because it
+will just restart. To stop it completely:
+
+```
+sudo systemctl mask avahi-daemon.socket
+sudo systemctl disable avahi-daemon
+sudo systemctl stop avahi-daemon
+```
+
+## Problem: Failed to create avahi group: Not permitted
+
+Avahi is not set up to publish records by default. This has to be explicitly
+allowed in the config file. In /etc/avahi/avahi-daemon.conf, add the following
+lines:
+
+```
+[publish]
+disable-user-service-publishing=no
+```
+
+Then restart the daemon
+
+```
+sudo systemctl restart avahi
+```
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 6bc0884da2e69e..cdfba66a341c61 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -235,15 +235,24 @@ server cluster BinaryInputBasic = 15 {
}
server cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
server cluster BooleanState = 69 {
@@ -380,9 +389,9 @@ server cluster Channel = 1284 {
struct ChannelInfo {
INT16U majorNumber = 0;
INT16U minorNumber = 1;
- CHAR_STRING<32> name = 2;
- CHAR_STRING<32> callSign = 3;
- CHAR_STRING<32> affiliateCallSign = 4;
+ optional CHAR_STRING<32> name = 2;
+ optional CHAR_STRING<32> callSign = 3;
+ optional CHAR_STRING<32> affiliateCallSign = 4;
}
readonly attribute ChannelInfo channelList[] = 0;
@@ -719,7 +728,7 @@ server cluster ContentLauncher = 1290 {
struct Parameter {
ParameterEnum type = 0;
CHAR_STRING value = 1;
- AdditionalInfo externalIDList[] = 2;
+ optional AdditionalInfo externalIDList[] = 2;
}
struct AdditionalInfo {
@@ -729,17 +738,17 @@ server cluster ContentLauncher = 1290 {
struct BrandingInformation {
CHAR_STRING providerName = 0;
- StyleInformation background = 1;
- StyleInformation logo = 2;
- StyleInformation progressBar = 3;
- StyleInformation splash = 4;
- StyleInformation waterMark = 5;
+ optional StyleInformation background = 1;
+ optional StyleInformation logo = 2;
+ optional StyleInformation progressBar = 3;
+ optional StyleInformation splash = 4;
+ optional StyleInformation waterMark = 5;
}
struct StyleInformation {
- CHAR_STRING imageUrl = 0;
- CHAR_STRING color = 1;
- Dimension size = 2;
+ optional CHAR_STRING imageUrl = 0;
+ optional CHAR_STRING color = 1;
+ optional Dimension size = 2;
}
struct Dimension {
@@ -1985,11 +1994,11 @@ server cluster MediaPlayback = 1286 {
}
readonly attribute PlaybackStateEnum playbackState = 0;
- readonly attribute epoch_us startTime = 1;
- readonly attribute int64u duration = 2;
+ readonly attribute nullable epoch_us startTime = 1;
+ readonly attribute nullable int64u duration = 2;
readonly attribute single playbackSpeed = 4;
- readonly attribute int64u seekRangeEnd = 5;
- readonly attribute int64u seekRangeStart = 6;
+ readonly attribute nullable int64u seekRangeEnd = 5;
+ readonly attribute nullable int64u seekRangeStart = 6;
readonly global attribute int16u clusterRevision = 65533;
}
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index 1e5e0e28d6477c..b7d934aab2759d 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -877,7 +877,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -905,21 +922,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
@@ -8704,7 +8706,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -8732,21 +8751,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
@@ -21099,4 +21103,4 @@
"deviceIdentifier": 256
}
]
-}
+}
\ No newline at end of file
diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
index 3b2e3a3391463f..af3b4763054ef0 100644
--- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
@@ -37,7 +37,7 @@ class BridgedActionsAttrAccess : public AttributeAccessInterface
// Register for the Bridged Actions cluster on all endpoints.
BridgedActionsAttrAccess() : AttributeAccessInterface(Optional::Missing(), BridgedActions::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
static constexpr uint16_t ClusterRevision = 1;
@@ -75,8 +75,7 @@ CHIP_ERROR BridgedActionsAttrAccess::ReadClusterRevision(EndpointId endpoint, At
BridgedActionsAttrAccess gAttrAccess;
-CHIP_ERROR BridgedActionsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR BridgedActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == BridgedActions::Id);
diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp
index a50444821800a6..86c6fd10d8d3b2 100644
--- a/examples/all-clusters-app/esp32/main/main.cpp
+++ b/examples/all-clusters-app/esp32/main/main.cpp
@@ -540,6 +540,12 @@ void SetupPretendDevices()
AddCluster("Humidity Sensor");
AddAttribute("MeasuredValue", "30");
app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(1, static_cast(30 * 100));
+
+ AddDevice("Light Sensor");
+ AddEndpoint("External");
+ AddCluster("Illuminance Measurement");
+ AddAttribute("MeasuredValue", "1000");
+ app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::Set(1, static_cast(1000));
}
WiFiWidget pairingWindowLED;
diff --git a/examples/all-clusters-app/p6/src/main.cpp b/examples/all-clusters-app/p6/src/main.cpp
index a943c132dc3620..a8f415ffa3744d 100644
--- a/examples/all-clusters-app/p6/src/main.cpp
+++ b/examples/all-clusters-app/p6/src/main.cpp
@@ -41,12 +41,16 @@
#ifdef HEAP_MONITORING
#include "MemMonitoring.h"
#endif
+#define MAIN_TASK_STACK_SIZE (4096)
+#define MAIN_TASK_PRIORITY 2
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
volatile int apperror_cnt;
+static void main_task(void * pvParameters);
+
// ================================================================================
// App Error
//=================================================================================
@@ -71,24 +75,17 @@ extern "C" void vApplicationIdleHook(void)
// FreeRTOS Idle callback
}
-// ================================================================================
-// Main Code
-// ================================================================================
-int main(void)
+extern "C" void vApplicationDaemonTaskStartupHook()
{
- init_p6Platform();
-
-#ifdef HEAP_MONITORING
- MemMonitoring::startHeapMonitoring();
-#endif
-
- P6_LOG("==================================================\r\n");
- P6_LOG("chip-p6-all-clusters-example starting\r\n");
- P6_LOG("==================================================\r\n");
-
// Init Chip memory management before the stack
chip::Platform::MemoryInit();
+ /* Create the Main task. */
+ xTaskCreate(main_task, "Main task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, NULL);
+}
+
+static void main_task(void * pvParameters)
+{
CHIP_ERROR ret = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init();
if (ret != CHIP_NO_ERROR)
{
@@ -123,6 +120,26 @@ int main(void)
P6_LOG("GetAppTask().Init() failed");
appError(ret);
}
+
+ /* Delete task */
+ vTaskDelete(NULL);
+}
+
+// ================================================================================
+// Main Code
+// ================================================================================
+int main(void)
+{
+ init_p6Platform();
+
+#ifdef HEAP_MONITORING
+ MemMonitoring::startHeapMonitoring();
+#endif
+
+ P6_LOG("==================================================\r\n");
+ P6_LOG("chip-p6-all-clusters-example starting\r\n");
+ P6_LOG("==================================================\r\n");
+
/* Start the FreeRTOS scheduler */
vTaskStartScheduler();
@@ -132,5 +149,4 @@ int main(void)
// Should never get here.
P6_LOG("vTaskStartScheduler() failed");
- appError(ret);
}
diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt
index f0fdad26397bee..0dee0976538a1a 100644
--- a/examples/bridge-app/esp32/main/CMakeLists.txt
+++ b/examples/bridge-app/esp32/main/CMakeLists.txt
@@ -43,6 +43,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp
index d12a81b2c10ed8..f6dbb77c9dd217 100644
--- a/examples/bridge-app/esp32/main/main.cpp
+++ b/examples/bridge-app/esp32/main/main.cpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -30,6 +31,7 @@
#include
#include
#include
+#include
#include
@@ -43,6 +45,11 @@ using namespace ::chip::Platform;
static DeviceCallbacks AppCallback;
+namespace {
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+} // namespace
+
static const int kNodeLabelSize = 32;
// Current ZCL implementation of Struct uses a max-size array of 254 bytes
static const int kDescriptorAttributeArraySize = 254;
@@ -368,6 +375,8 @@ static void InitServer(intptr_t context)
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ sWiFiNetworkCommissioningInstance.Init();
+
// Set starting endpoint id where dynamic endpoints will be assigned, which
// will be the next consecutive endpoint id after the last fixed endpoint.
gFirstDynamicEndpointId = static_cast(
diff --git a/examples/chip-tool/commands/clusters/ComplexArgument.h b/examples/chip-tool/commands/clusters/ComplexArgument.h
index fd06b458f69ce5..07b5b871784c85 100644
--- a/examples/chip-tool/commands/clusters/ComplexArgument.h
+++ b/examples/chip-tool/commands/clusters/ComplexArgument.h
@@ -205,14 +205,14 @@ class ComplexArgumentParser
return CHIP_NO_ERROR;
}
- static CHIP_ERROR EnsureMemberExist(const char * label, bool hasMember)
+ static CHIP_ERROR EnsureMemberExist(const char * label, const char * memberName, bool hasMember)
{
if (hasMember)
{
return CHIP_NO_ERROR;
}
- ChipLogError(chipTool, "%s is required.", label);
+ ChipLogError(chipTool, "%s is required. Should be provided as {\"%s\": value}", label, memberName);
return CHIP_ERROR_INVALID_ARGUMENT;
}
diff --git a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
index c9fc765aa48122..dbc62bf3024ca9 100644
--- a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
+++ b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt
@@ -9,7 +9,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, {{zapTypeToEncodable
{{#zcl_struct_items}}
{{#unless isOptional}}
- ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("{{parent.name}}.{{asLowerCamelCase label}}", value.isMember("{{asLowerCamelCase label}}")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("{{parent.name}}.{{asLowerCamelCase label}}", "{{asLowerCamelCase label}}", value.isMember("{{asLowerCamelCase label}}")));
{{/unless}}
{{/zcl_struct_items}}
diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter
index f586034eae2f6c..aaf72e6e311630 100644
--- a/examples/light-switch-app/light-switch-common/light-switch-app.matter
+++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter
@@ -143,6 +143,23 @@ server cluster Basic = 40 {
server cluster Binding = 30 {
readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
client cluster ColorControl = 768 {
diff --git a/examples/lighting-app/ameba/main/chipinterface.cpp b/examples/lighting-app/ameba/main/chipinterface.cpp
index 32b3e82cf0c6d8..2665040b47c0e2 100644
--- a/examples/lighting-app/ameba/main/chipinterface.cpp
+++ b/examples/lighting-app/ameba/main/chipinterface.cpp
@@ -30,9 +30,12 @@
#include
#include
+#include
#include
#include
#include
+#include
+#include
#include
#include
@@ -51,6 +54,16 @@ using namespace ::chip::DeviceManager;
using namespace ::chip::DeviceLayer;
using namespace ::chip::System;
+namespace {
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::AmebaWiFiDriver::GetInstance()));
+} // namespace
+
+void NetWorkCommissioningInstInit()
+{
+ sWiFiNetworkCommissioningInstance.Init();
+}
+
#ifdef CONFIG_PLATFORM_8721D
#define STATUS_LED_GPIO_NUM PB_5
#elif defined(CONFIG_PLATFORM_8710C)
@@ -147,31 +160,34 @@ static Identify gIdentify1 = {
extern "C" void ChipTest(void)
{
- printf("In ChipTest()\r\n");
+ ChipLogProgress(DeviceLayer, "Lighting App Demo!");
CHIP_ERROR err = CHIP_NO_ERROR;
- printf("initPrefr\n");
initPref();
CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
- err = deviceMgr.Init(&EchoCallbacks);
+ err = deviceMgr.Init(&EchoCallbacks);
if (err != CHIP_NO_ERROR)
{
- printf("DeviceManagerInit() - ERROR!\r\n");
+ ChipLogError(DeviceLayer, "DeviceManagerInit() - ERROR!\r\n");
}
else
{
- printf("DeviceManagerInit() - OK\r\n");
+ ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}
chip::Server::GetInstance().Init();
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ NetWorkCommissioningInstInit();
- // QR code will be used with CHIP Tool
- PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE));
+ if (RTW_SUCCESS != wifi_is_connected_to_ap())
+ {
+ // QR code will be used with CHIP Tool
+ PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE));
+ }
statusLED1.Init(STATUS_LED_GPIO_NUM);
diff --git a/examples/lighting-app/esp32/main/CMakeLists.txt b/examples/lighting-app/esp32/main/CMakeLists.txt
index edbb28466a368c..f928ea2d243aed 100644
--- a/examples/lighting-app/esp32/main/CMakeLists.txt
+++ b/examples/lighting-app/esp32/main/CMakeLists.txt
@@ -47,6 +47,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
diff --git a/examples/lighting-app/esp32/main/main.cpp b/examples/lighting-app/esp32/main/main.cpp
index c3114e04c2b363..f08024dd7b22ba 100644
--- a/examples/lighting-app/esp32/main/main.cpp
+++ b/examples/lighting-app/esp32/main/main.cpp
@@ -26,12 +26,14 @@
#include "freertos/task.h"
#include "nvs_flash.h"
#include "shell_extension/launch.h"
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
#include
@@ -53,6 +55,11 @@ static const char * TAG = "light-app";
static DeviceCallbacks EchoCallbacks;
+namespace {
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+} // namespace
+
static void InitOTARequestor(void)
{
#if CONFIG_ENABLE_OTA_REQUESTOR
@@ -73,6 +80,8 @@ static void InitServer(intptr_t context)
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+
+ sWiFiNetworkCommissioningInstance.Init();
}
extern "C" void app_main()
diff --git a/examples/lighting-app/nrfconnect/prj.conf b/examples/lighting-app/nrfconnect/prj.conf
index bc0052bbb7bc28..e88e52d6b50fca 100644
--- a/examples/lighting-app/nrfconnect/prj.conf
+++ b/examples/lighting-app/nrfconnect/prj.conf
@@ -37,6 +37,8 @@ CONFIG_MPU_STACK_GUARD=y
# CHIP configuration
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
+# 20044 == 0x4E4C - "[N]ordic [L]ight"
+CONFIG_CHIP_DEVICE_PRODUCT_ID=20044
# Enable CHIP pairing automatically on application start.
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
diff --git a/examples/lighting-app/p6/src/main.cpp b/examples/lighting-app/p6/src/main.cpp
index 7d493daff2a25e..a38d25811c2e1e 100644
--- a/examples/lighting-app/p6/src/main.cpp
+++ b/examples/lighting-app/p6/src/main.cpp
@@ -40,12 +40,16 @@
#ifdef HEAP_MONITORING
#include "MemMonitoring.h"
#endif
+#define MAIN_TASK_STACK_SIZE (4096)
+#define MAIN_TASK_PRIORITY 2
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
volatile int apperror_cnt;
+static void main_task(void * pvParameters);
+
// ================================================================================
// App Error
//=================================================================================
@@ -70,24 +74,17 @@ extern "C" void vApplicationIdleHook(void)
// FreeRTOS Idle callback
}
-// ================================================================================
-// Main Code
-// ================================================================================
-int main(void)
+extern "C" void vApplicationDaemonTaskStartupHook()
{
- init_p6Platform();
-
-#ifdef HEAP_MONITORING
- MemMonitoring::startHeapMonitoring();
-#endif
-
- P6_LOG("==================================================\r\n");
- P6_LOG("chip-p6-lighting-example starting\r\n");
- P6_LOG("==================================================\r\n");
-
// Init Chip memory management before the stack
chip::Platform::MemoryInit();
+ /* Create the Main task. */
+ xTaskCreate(main_task, "Main task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, NULL);
+}
+
+static void main_task(void * pvParameters)
+{
CHIP_ERROR ret = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init();
if (ret != CHIP_NO_ERROR)
{
@@ -115,6 +112,26 @@ int main(void)
P6_LOG("GetAppTask().Init() failed");
appError(ret);
}
+
+ /* Delete task */
+ vTaskDelete(NULL);
+}
+
+// ================================================================================
+// Main Code
+// ================================================================================
+int main(void)
+{
+ init_p6Platform();
+
+#ifdef HEAP_MONITORING
+ MemMonitoring::startHeapMonitoring();
+#endif
+
+ P6_LOG("==================================================\r\n");
+ P6_LOG("chip-p6-lighting-example starting\r\n");
+ P6_LOG("==================================================\r\n");
+
/* Start the FreeRTOS scheduler */
vTaskStartScheduler();
@@ -124,5 +141,4 @@ int main(void)
// Should never get here.
P6_LOG("vTaskStartScheduler() failed");
- appError(ret);
}
diff --git a/examples/lock-app/esp32/main/main.cpp b/examples/lock-app/esp32/main/main.cpp
index 812fd46b952b8a..1a9cfb6424ef78 100644
--- a/examples/lock-app/esp32/main/main.cpp
+++ b/examples/lock-app/esp32/main/main.cpp
@@ -28,7 +28,9 @@
#include "freertos/task.h"
#include "nvs_flash.h"
#include "shell_extension/launch.h"
+#include
#include
+#include
#include
#include
@@ -54,6 +56,11 @@ static const char * TAG = "lock-app";
static DeviceCallbacks EchoCallbacks;
+namespace {
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+} // namespace
+
static void InitServer(intptr_t context)
{
chip::Server::GetInstance().Init();
@@ -61,6 +68,8 @@ static void InitServer(intptr_t context)
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ sWiFiNetworkCommissioningInstance.Init();
+
ESP_LOGI(TAG, "------------------------Starting App Task---------------------------");
CHIP_ERROR error = GetAppTask().StartAppTask();
if (error != CHIP_NO_ERROR)
diff --git a/examples/lock-app/p6/src/main.cpp b/examples/lock-app/p6/src/main.cpp
index aceba9a2183528..9c213eeb8137fa 100644
--- a/examples/lock-app/p6/src/main.cpp
+++ b/examples/lock-app/p6/src/main.cpp
@@ -37,11 +37,16 @@
#include "init_p6Platform.h"
#include
+#define MAIN_TASK_STACK_SIZE (4096)
+#define MAIN_TASK_PRIORITY 2
+
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
volatile int apperror_cnt;
+static void main_task(void * pvParameters);
+
// ================================================================================
// App Error
//=================================================================================
@@ -66,20 +71,17 @@ extern "C" void vApplicationIdleHook(void)
// FreeRTOS Idle callback
}
-// ================================================================================
-// Main Code
-// ================================================================================
-int main(void)
+extern "C" void vApplicationDaemonTaskStartupHook()
{
- init_p6Platform();
-
- P6_LOG("==================================================\r\n");
- P6_LOG("chip-p6-lock-example starting\r\n");
- P6_LOG("==================================================\r\n");
-
// Init Chip memory management before the stack
chip::Platform::MemoryInit();
+ /* Create the Main task. */
+ xTaskCreate(main_task, "Main task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, NULL);
+}
+
+static void main_task(void * pvParameters)
+{
CHIP_ERROR ret = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init();
if (ret != CHIP_NO_ERROR)
{
@@ -107,6 +109,22 @@ int main(void)
P6_LOG("GetAppTask().Init() failed");
appError(ret);
}
+
+ /* Delete task */
+ vTaskDelete(NULL);
+}
+
+// ================================================================================
+// Main Code
+// ================================================================================
+int main(void)
+{
+ init_p6Platform();
+
+ P6_LOG("==================================================\r\n");
+ P6_LOG("chip-p6-lock-example starting\r\n");
+ P6_LOG("==================================================\r\n");
+
/* Start the FreeRTOS scheduler */
vTaskStartScheduler();
@@ -116,5 +134,4 @@ int main(void)
// Should never get here.
P6_LOG("vTaskStartScheduler() failed");
- appError(ret);
}
diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt
index 11e93389296a10..4b7fdf20a263cf 100644
--- a/examples/ota-provider-app/esp32/main/CMakeLists.txt
+++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt
@@ -47,6 +47,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common"
diff --git a/examples/ota-provider-app/esp32/main/main.cpp b/examples/ota-provider-app/esp32/main/main.cpp
index 7c5ea0aa337e93..6d836cfa0b709d 100644
--- a/examples/ota-provider-app/esp32/main/main.cpp
+++ b/examples/ota-provider-app/esp32/main/main.cpp
@@ -21,11 +21,13 @@
#include "esp_spi_flash.h"
#include "esp_spiffs.h"
#include "nvs_flash.h"
+#include
#include
#include
#include
#include
#include
+#include
#include
#include
@@ -61,6 +63,20 @@ static OTAProviderExample otaProvider;
chip::Callback::Callback onBlockQueryCallback(OnBlockQuery, nullptr);
chip::Callback::Callback onTransferCompleteCallback(OnTransferComplete, nullptr);
chip::Callback::Callback onTransferFailedCallback(OnTransferFailed, nullptr);
+
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+
+static void InitServer(intptr_t context)
+{
+ chip::Server::GetInstance().Init();
+
+ // Initialize device attestation config
+ SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+
+ sWiFiNetworkCommissioningInstance.Init();
+}
+
} // namespace
CHIP_ERROR OnBlockQuery(void * context, chip::System::PacketBufferHandle & blockBuf, size_t & size, bool & isEof, uint32_t offset)
@@ -136,10 +152,7 @@ extern "C" void app_main()
return;
}
- chip::Server::GetInstance().Init();
-
- // Initialize device attestation config
- SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast(nullptr));
BdxOtaSender * bdxOtaSender = otaProvider.GetBdxOtaSender();
VerifyOrReturn(bdxOtaSender != nullptr, ESP_LOGE(TAG, "bdxOtaSender is nullptr"));
diff --git a/examples/ota-requestor-app/ameba/main/chipinterface.cpp b/examples/ota-requestor-app/ameba/main/chipinterface.cpp
index bdff13a45b0ee1..d028fbcf3fdcb4 100644
--- a/examples/ota-requestor-app/ameba/main/chipinterface.cpp
+++ b/examples/ota-requestor-app/ameba/main/chipinterface.cpp
@@ -21,11 +21,14 @@
#include "DeviceCallbacks.h"
#include "chip_porting.h"
+#include
#include
#include
#include
+
#include
#include
+#include
#include
#include
@@ -62,6 +65,16 @@ using namespace ::chip::Credentials;
using namespace ::chip::DeviceManager;
using namespace ::chip::DeviceLayer;
+namespace {
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::AmebaWiFiDriver::GetInstance()));
+} // namespace
+
+void NetWorkCommissioningInstInit()
+{
+ sWiFiNetworkCommissioningInstance.Init();
+}
+
static DeviceCallbacks EchoCallbacks;
OTARequestor gRequestorCore;
@@ -130,6 +143,7 @@ extern "C" void ChipTest(void)
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ NetWorkCommissioningInstInit();
InitOTARequestor();
diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt
index d6fc50cc130e89..e634ab659eca5c 100644
--- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt
+++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt
@@ -47,6 +47,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
PRIV_REQUIRES chip QRCode bt console app_update)
diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp
index 06084e7994a004..06a791874bbb3f 100644
--- a/examples/ota-requestor-app/esp32/main/main.cpp
+++ b/examples/ota-requestor-app/esp32/main/main.cpp
@@ -28,9 +28,11 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "nvs_flash.h"
+#include
#include
#include
#include
+#include
#include
#include
@@ -55,6 +57,20 @@ OTARequestor gRequestorCore;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
OTAImageProcessorImpl gImageProcessor;
+
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+
+static void InitServer(intptr_t context)
+{
+ chip::Server::GetInstance().Init();
+
+ // Initialize device attestation config
+ SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+
+ sWiFiNetworkCommissioningInstance.Init();
+}
+
} // namespace
extern "C" void app_main()
@@ -89,10 +105,7 @@ extern "C" void app_main()
return;
}
- chip::Server::GetInstance().Init();
-
- // Initialize device attestation config
- SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+ chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast(nullptr));
SetRequestorInstance(&gRequestorCore);
gRequestorCore.Init(&(Server::GetInstance()), &gRequestorUser, &gDownloader);
diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt
index e1affc2fa6e11b..ba5b2c41c3c89e 100644
--- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt
+++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt
@@ -47,6 +47,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
PRIV_REQUIRES chip QRCode bt)
diff --git a/examples/temperature-measurement-app/esp32/main/main.cpp b/examples/temperature-measurement-app/esp32/main/main.cpp
index 146dcab7e527bd..c35d4f13b2941d 100644
--- a/examples/temperature-measurement-app/esp32/main/main.cpp
+++ b/examples/temperature-measurement-app/esp32/main/main.cpp
@@ -33,8 +33,10 @@
#include
#include
+#include
#include
#include
+#include
#include
@@ -47,6 +49,19 @@ const char * TAG = "temperature-measurement-app";
static DeviceCallbacks EchoCallbacks;
+namespace {
+
+app::Clusters::NetworkCommissioning::Instance
+ sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance()));
+
+static void InitServer(intptr_t context)
+{
+ chip::Server::GetInstance().Init();
+ sWiFiNetworkCommissioningInstance.Init();
+}
+
+} // namespace
+
extern "C" void app_main()
{
ESP_LOGI(TAG, "Temperature sensor!");
@@ -80,7 +95,7 @@ extern "C" void app_main()
return;
}
- chip::Server::GetInstance().Init();
+ chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast(nullptr));
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter
index c2220cca08caa8..5cd74fd6e15500 100644
--- a/examples/thermostat/thermostat-common/thermostat.matter
+++ b/examples/thermostat/thermostat-common/thermostat.matter
@@ -142,15 +142,24 @@ server cluster Basic = 40 {
}
server cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
server cluster Descriptor = 29 {
diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap
index bb65191df516ee..b44dca42e2df12 100644
--- a/examples/thermostat/thermostat-common/thermostat.zap
+++ b/examples/thermostat/thermostat-common/thermostat.zap
@@ -854,7 +854,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -882,21 +899,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
@@ -8156,7 +8158,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -8184,21 +8203,6 @@
"enabled": 0,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
index 9f04faa15c9ff1..5b8a0ad46d2109 100644
--- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
@@ -47,7 +47,7 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper(chip::CharSpan::fromCharString("data response"));
response.status = chip::app::Clusters::TargetNavigator::StatusEnum::kSuccess;
helper.Success(response);
}
diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp
index cda334cb0022a9..8322bfe5dd5252 100644
--- a/examples/tv-app/android/java/ChannelManager.cpp
+++ b/examples/tv-app/android/java/ChannelManager.cpp
@@ -84,7 +84,7 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
if (jcallSign != NULL)
{
JniUtfString callsign(env, jcallSign);
- channelInfo.callSign = callsign.charSpan();
+ channelInfo.callSign = Optional(callsign.charSpan());
}
jfieldID getNameField = env->GetFieldID(channelClass, "name", "Ljava/lang/String;");
@@ -92,7 +92,7 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
if (jname != NULL)
{
JniUtfString name(env, jname);
- channelInfo.name = name.charSpan();
+ channelInfo.name = Optional(name.charSpan());
}
jfieldID getJaffiliateCallSignField = env->GetFieldID(channelClass, "affiliateCallSign", "Ljava/lang/String;");
@@ -100,7 +100,7 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
if (jaffiliateCallSign != NULL)
{
JniUtfString affiliateCallSign(env, jaffiliateCallSign);
- channelInfo.affiliateCallSign = affiliateCallSign.charSpan();
+ channelInfo.affiliateCallSign = Optional(affiliateCallSign.charSpan());
}
jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I");
@@ -154,7 +154,7 @@ CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
if (jlineupName != NULL)
{
JniUtfString lineupName(env, jlineupName);
- lineupInfo.lineupName = lineupName.charSpan();
+ lineupInfo.lineupName = Optional(lineupName.charSpan());
}
jfieldID postalCodeFild = env->GetFieldID(channelLineupClazz, "postalCode", "Ljava/lang/String;");
@@ -162,7 +162,7 @@ CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
if (jpostalCode != NULL)
{
JniUtfString postalCode(env, jpostalCode);
- lineupInfo.postalCode = postalCode.charSpan();
+ lineupInfo.postalCode = Optional(postalCode.charSpan());
}
jfieldID lineupInfoTypeFild = env->GetFieldID(channelLineupClazz, "lineupInfoTypeEnum", "I");
@@ -200,7 +200,7 @@ CHIP_ERROR ChannelManager::HandleGetCurrentChannel(AttributeValueEncoder & aEnco
if (jcallSign != NULL)
{
JniUtfString callsign(env, jcallSign);
- channelInfo.callSign = callsign.charSpan();
+ channelInfo.callSign = Optional(callsign.charSpan());
}
jfieldID getNameField = env->GetFieldID(channelClass, "name", "Ljava/lang/String;");
@@ -208,7 +208,7 @@ CHIP_ERROR ChannelManager::HandleGetCurrentChannel(AttributeValueEncoder & aEnco
if (jname != NULL)
{
JniUtfString name(env, jname);
- channelInfo.name = name.charSpan();
+ channelInfo.name = Optional(name.charSpan());
}
jfieldID getJaffiliateCallSignField = env->GetFieldID(channelClass, "affiliateCallSign", "Ljava/lang/String;");
@@ -216,7 +216,7 @@ CHIP_ERROR ChannelManager::HandleGetCurrentChannel(AttributeValueEncoder & aEnco
if (jaffiliateCallSign != NULL)
{
JniUtfString affiliateCallSign(env, jaffiliateCallSign);
- channelInfo.affiliateCallSign = affiliateCallSign.charSpan();
+ channelInfo.affiliateCallSign = Optional(affiliateCallSign.charSpan());
}
jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I");
@@ -276,7 +276,7 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper(callsign.charSpan());
}
jfieldID getNameField = env->GetFieldID(channelClass, "name", "Ljava/lang/String;");
@@ -284,14 +284,14 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper(junitname.charSpan());
}
jfieldID getJaffiliateCallSignField = env->GetFieldID(channelClass, "affiliateCallSign", "Ljava/lang/String;");
jstring jaffiliateCallSign = static_cast(env->GetObjectField(channelObject, getJaffiliateCallSignField));
if (jaffiliateCallSign != NULL)
{
JniUtfString affiliateCallSign(env, jaffiliateCallSign);
- response.channelMatch.affiliateCallSign = affiliateCallSign.charSpan();
+ response.channelMatch.affiliateCallSign = Optional(affiliateCallSign.charSpan());
}
jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I");
diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp
index 8a79df7ea32ffb..3537e723195f47 100644
--- a/examples/tv-app/android/java/ContentLauncherManager.cpp
+++ b/examples/tv-app/android/java/ContentLauncherManager.cpp
@@ -85,7 +85,7 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper(status);
- response.data = dataStr.charSpan();
+ response.data = chip::Optional(dataStr.charSpan());
err = helper.Success(response);
}
@@ -140,7 +140,7 @@ void ContentLauncherManager::HandleLaunchUrl(CommandResponseHelper(status);
- response.data = dataStr.charSpan();
+ response.data = chip::Optional(dataStr.charSpan());
err = helper.Success(response);
}
diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp
index a4201452d0e578..75b24fb2a026ab 100644
--- a/examples/tv-app/android/java/MediaPlaybackManager.cpp
+++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp
@@ -28,6 +28,7 @@
using namespace chip;
using namespace chip::app;
+using namespace chip::app::DataModel;
using namespace chip::app::Clusters::MediaPlayback;
/** @brief Media PlayBack Cluster Init
@@ -258,7 +259,7 @@ CHIP_ERROR MediaPlaybackManager::HandleGetSampledPosition(AttributeValueEncoder
{
Structs::PlaybackPosition::Type response;
response.updatedAt = 0;
- response.position = 0;
+ response.position = Nullable(0);
jobject positionObj;
CHIP_ERROR err = CHIP_NO_ERROR;
@@ -283,7 +284,7 @@ CHIP_ERROR MediaPlaybackManager::HandleGetSampledPosition(AttributeValueEncoder
jclass inputClass = env->GetObjectClass(positionObj);
jfieldID positionId = env->GetFieldID(inputClass, "position", "J");
jfieldID updatedAtId = env->GetFieldID(inputClass, "updatedAt", "J");
- response.position = static_cast(env->GetIntField(positionObj, positionId));
+ response.position = Nullable(static_cast(env->GetIntField(positionObj, positionId)));
response.updatedAt = static_cast(env->GetIntField(positionObj, updatedAtId));
}
diff --git a/examples/tv-app/linux/include/channel/ChannelManager.cpp b/examples/tv-app/linux/include/channel/ChannelManager.cpp
index 6fc84cb2e71a58..66e5d4a972b8a1 100644
--- a/examples/tv-app/linux/include/channel/ChannelManager.cpp
+++ b/examples/tv-app/linux/include/channel/ChannelManager.cpp
@@ -30,9 +30,9 @@ CHIP_ERROR ChannelManager::HandleGetChannelList(AttributeValueEncoder & aEncoder
for (int i = 0; i < maximumVectorSize; ++i)
{
chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo;
- channelInfo.affiliateCallSign = chip::CharSpan::fromCharString("exampleASign");
- channelInfo.callSign = chip::CharSpan::fromCharString("exampleCSign");
- channelInfo.name = chip::CharSpan::fromCharString("exampleName");
+ channelInfo.affiliateCallSign = Optional(chip::CharSpan::fromCharString("exampleASign"));
+ channelInfo.callSign = Optional(chip::CharSpan::fromCharString("exampleCSign"));
+ channelInfo.name = Optional(chip::CharSpan::fromCharString("exampleName"));
channelInfo.majorNumber = static_cast(1 + i);
channelInfo.minorNumber = static_cast(2 + i);
@@ -47,8 +47,8 @@ CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
{
chip::app::Clusters::Channel::Structs::LineupInfo::Type lineup;
lineup.operatorName = chip::CharSpan::fromCharString("operatorName");
- lineup.lineupName = chip::CharSpan::fromCharString("lineupName");
- lineup.postalCode = chip::CharSpan::fromCharString("postalCode");
+ lineup.lineupName = Optional(chip::CharSpan::fromCharString("lineupName"));
+ lineup.postalCode = Optional(chip::CharSpan::fromCharString("postalCode"));
lineup.lineupInfoType = chip::app::Clusters::Channel::LineupInfoTypeEnum::kMso;
return aEncoder.Encode(lineup);
@@ -57,9 +57,9 @@ CHIP_ERROR ChannelManager::HandleGetLineup(AttributeValueEncoder & aEncoder)
CHIP_ERROR ChannelManager::HandleGetCurrentChannel(AttributeValueEncoder & aEncoder)
{
chip::app::Clusters::Channel::Structs::ChannelInfo::Type currentChannel;
- currentChannel.affiliateCallSign = chip::CharSpan::fromCharString("exampleASign");
- currentChannel.callSign = chip::CharSpan::fromCharString("exampleCSign");
- currentChannel.name = chip::CharSpan::fromCharString("exampleName");
+ currentChannel.affiliateCallSign = Optional(chip::CharSpan::fromCharString("exampleASign"));
+ currentChannel.callSign = Optional(chip::CharSpan::fromCharString("exampleCSign"));
+ currentChannel.name = Optional(chip::CharSpan::fromCharString("exampleName"));
currentChannel.majorNumber = 1;
currentChannel.minorNumber = 0;
@@ -71,9 +71,9 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper(chip::CharSpan::fromCharString("name"));
+ response.channelMatch.callSign = Optional(chip::CharSpan::fromCharString("callSign"));
+ response.channelMatch.affiliateCallSign = Optional(chip::CharSpan::fromCharString("affiliateCallSign"));
response.errorType = chip::app::Clusters::Channel::ErrorTypeEnum::kMultipleMatches;
helper.Success(response);
diff --git a/examples/tv-app/linux/include/cluster-init.cpp b/examples/tv-app/linux/include/cluster-init.cpp
index 601388e1b8b2b3..bbb889d264404d 100644
--- a/examples/tv-app/linux/include/cluster-init.cpp
+++ b/examples/tv-app/linux/include/cluster-init.cpp
@@ -42,8 +42,7 @@ class TvAttrAccess : public app::AttributeAccessInterface
public:
TvAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), AttrTypeInfo::GetClusterId()) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override
{
if (aPath.mAttributeId == AttrTypeInfo::GetAttributeId())
{
diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp
index 4194a6c9d24f37..82b3b76b6fc7df 100644
--- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp
+++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp
@@ -37,7 +37,7 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper(CharSpan::fromCharString("exampleData"));
response.status = ContentLauncher::StatusEnum::kSuccess;
helper.Success(response);
}
@@ -52,7 +52,7 @@ void ContentLauncherManager::HandleLaunchUrl(CommandResponseHelper(CharSpan::fromCharString("exampleData"));
response.status = ContentLauncher::StatusEnum::kSuccess;
helper.Success(response);
}
diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp
index 23a89c4aaebdfe..edea209376fa0b 100644
--- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp
+++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp
@@ -18,6 +18,7 @@
#include "MediaPlaybackManager.h"
using namespace std;
+using namespace chip::app::DataModel;
using namespace chip::app::Clusters::MediaPlayback;
PlaybackStateEnum MediaPlaybackManager::HandleGetCurrentState()
@@ -39,7 +40,7 @@ CHIP_ERROR MediaPlaybackManager::HandleGetSampledPosition(AttributeValueEncoder
{
Structs::PlaybackPosition::Type sampledPosition;
sampledPosition.updatedAt = 0;
- sampledPosition.position = 0;
+ sampledPosition.position = Nullable(0);
return aEncoder.Encode(sampledPosition);
}
diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp
index 99dd5a40239933..a3236c7228ddfe 100644
--- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp
@@ -55,14 +55,14 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper mTargets.size())
{
- response.data = CharSpan::fromCharString("error");
+ response.data = chip::Optional(CharSpan::fromCharString("error"));
response.status = StatusEnum::kTargetNotFound;
helper.Success(response);
return;
}
mCurrentTarget = static_cast(target);
- response.data = CharSpan::fromCharString("data response");
+ response.data = chip::Optional(CharSpan::fromCharString("data response"));
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp
index 32e0c9505f0c5f..873eb3649de35b 100644
--- a/examples/tv-app/linux/main.cpp
+++ b/examples/tv-app/linux/main.cpp
@@ -135,7 +135,7 @@ class MyPostCommissioningListener : public PostCommissioningListener
}
/* Callback when command results in success */
- static void OnSuccessResponse(void * context)
+ static void OnSuccessResponse(void * context, const chip::app::DataModel::NullObjectType &)
{
ChipLogProgress(Controller, "OnSuccessResponse - Binding Add Successfully");
CommissionerDiscoveryController * cdc = GetCommissionerDiscoveryController();
diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter
index 1d30f9b2e613fc..a7a071df4d6097 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -167,7 +167,7 @@ server cluster ApplicationLauncher = 1292 {
struct ApplicationEP {
Application application = 0;
- CHAR_STRING endpoint = 1;
+ optional ENDPOINT_NO endpoint = 1;
}
struct Application {
@@ -176,7 +176,7 @@ server cluster ApplicationLauncher = 1292 {
}
readonly attribute INT16U applicationLauncherList[] = 0;
- attribute ApplicationEP applicationLauncherApp = 1;
+ attribute nullable ApplicationEP applicationLauncherApp = 1;
readonly global attribute int16u clusterRevision = 65533;
request struct HideAppRequestRequest {
@@ -185,7 +185,7 @@ server cluster ApplicationLauncher = 1292 {
request struct LaunchAppRequestRequest {
Application application = 0;
- OCTET_STRING data = 1;
+ optional OCTET_STRING data = 1;
}
request struct StopAppRequestRequest {
@@ -277,27 +277,45 @@ server cluster Basic = 40 {
}
client cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
server cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
server cluster Channel = 1284 {
@@ -313,21 +331,21 @@ server cluster Channel = 1284 {
struct ChannelInfo {
INT16U majorNumber = 0;
INT16U minorNumber = 1;
- CHAR_STRING<32> name = 2;
- CHAR_STRING<32> callSign = 3;
- CHAR_STRING<32> affiliateCallSign = 4;
+ optional CHAR_STRING<32> name = 2;
+ optional CHAR_STRING<32> callSign = 3;
+ optional CHAR_STRING<32> affiliateCallSign = 4;
}
struct LineupInfo {
CHAR_STRING operatorName = 0;
- CHAR_STRING lineupName = 1;
- CHAR_STRING postalCode = 2;
+ optional CHAR_STRING lineupName = 1;
+ optional CHAR_STRING postalCode = 2;
LineupInfoTypeEnum lineupInfoType = 3;
}
readonly attribute ChannelInfo channelList[] = 0;
- attribute LineupInfo channelLineup = 1;
- attribute ChannelInfo currentChannel = 2;
+ readonly attribute nullable LineupInfo channelLineup = 1;
+ readonly attribute nullable ChannelInfo currentChannel = 2;
readonly global attribute int16u clusterRevision = 65533;
request struct ChangeChannelByNumberRequestRequest {
@@ -398,7 +416,7 @@ server cluster ContentLauncher = 1290 {
struct Parameter {
ParameterEnum type = 0;
CHAR_STRING value = 1;
- AdditionalInfo externalIDList[] = 2;
+ optional AdditionalInfo externalIDList[] = 2;
}
struct AdditionalInfo {
@@ -408,17 +426,17 @@ server cluster ContentLauncher = 1290 {
struct BrandingInformation {
CHAR_STRING providerName = 0;
- StyleInformation background = 1;
- StyleInformation logo = 2;
- StyleInformation progressBar = 3;
- StyleInformation splash = 4;
- StyleInformation waterMark = 5;
+ optional StyleInformation background = 1;
+ optional StyleInformation logo = 2;
+ optional StyleInformation progressBar = 3;
+ optional StyleInformation splash = 4;
+ optional StyleInformation waterMark = 5;
}
struct StyleInformation {
- CHAR_STRING imageUrl = 0;
- CHAR_STRING color = 1;
- Dimension size = 2;
+ optional CHAR_STRING imageUrl = 0;
+ optional CHAR_STRING color = 1;
+ optional Dimension size = 2;
}
struct Dimension {
@@ -432,20 +450,20 @@ server cluster ContentLauncher = 1290 {
readonly global attribute int16u clusterRevision = 65533;
request struct LaunchContentRequestRequest {
- BOOLEAN autoPlay = 0;
- CHAR_STRING data = 1;
- ContentSearch search[] = 2;
+ ContentSearch search[] = 0;
+ BOOLEAN autoPlay = 1;
+ optional CHAR_STRING data = 2;
}
request struct LaunchURLRequestRequest {
CHAR_STRING contentURL = 0;
- CHAR_STRING displayString = 1;
- BrandingInformation brandingInformation = 2;
+ optional CHAR_STRING displayString = 1;
+ optional BrandingInformation brandingInformation = 2;
}
response struct LaunchResponse {
StatusEnum status = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
command LaunchContentRequest(LaunchContentRequestRequest): LaunchResponse = 0;
@@ -1031,16 +1049,16 @@ server cluster MediaPlayback = 1286 {
struct PlaybackPosition {
INT64U updatedAt = 0;
- INT64U position = 1;
+ nullable INT64U position = 1;
}
readonly attribute PlaybackStateEnum playbackState = 0;
- readonly attribute epoch_us startTime = 1;
- readonly attribute int64u duration = 2;
- attribute PlaybackPosition position = 3;
+ readonly attribute nullable epoch_us startTime = 1;
+ readonly attribute nullable int64u duration = 2;
+ readonly attribute PlaybackPosition position = 3;
readonly attribute single playbackSpeed = 4;
- readonly attribute int64u seekRangeEnd = 5;
- readonly attribute int64u seekRangeStart = 6;
+ readonly attribute nullable int64u seekRangeEnd = 5;
+ readonly attribute nullable int64u seekRangeStart = 6;
readonly global attribute int16u clusterRevision = 65533;
request struct SeekRequestRequest {
@@ -1668,12 +1686,12 @@ server cluster TargetNavigator = 1285 {
request struct NavigateTargetRequestRequest {
INT8U target = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
response struct NavigateTargetResponse {
StatusEnum status = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
command NavigateTargetRequest(NavigateTargetRequestRequest): NavigateTargetResponse = 0;
diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap
index 952d19cfbf179c..7e4d0b22fddab2 100644
--- a/examples/tv-app/tv-common/tv-app.zap
+++ b/examples/tv-app/tv-common/tv-app.zap
@@ -854,7 +854,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 1,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -882,21 +899,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp
index 86dfb92aed7907..6f5cdad6a33302 100644
--- a/examples/tv-casting-app/linux/main.cpp
+++ b/examples/tv-casting-app/linux/main.cpp
@@ -253,8 +253,9 @@ void DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * event, intptr_t ar
}
LaunchURLRequest::Type request;
request.contentURL = chip::CharSpan::fromCharString(kContentUrl);
- request.displayString = chip::CharSpan::fromCharString(kContentDisplayStr);
- request.brandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type();
+ request.displayString = Optional(chip::CharSpan::fromCharString(kContentDisplayStr));
+ request.brandingInformation = Optional(
+ chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type());
cluster.InvokeCommand(request, nullptr, OnContentLauncherSuccessResponse, OnContentLauncherFailureResponse);
}
}
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
index 67b113ef35b096..d244ec49ccf8ab 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
@@ -168,7 +168,7 @@ client cluster ApplicationLauncher = 1292 {
request struct LaunchAppRequestRequest {
Application application = 0;
- OCTET_STRING data = 1;
+ optional OCTET_STRING data = 1;
}
request struct StopAppRequestRequest {
@@ -276,15 +276,24 @@ server cluster BinaryInputBasic = 15 {
}
server cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
server cluster BridgedDeviceBasic = 57 {
@@ -332,21 +341,21 @@ client cluster Channel = 1284 {
struct ChannelInfo {
INT16U majorNumber = 0;
INT16U minorNumber = 1;
- CHAR_STRING<32> name = 2;
- CHAR_STRING<32> callSign = 3;
- CHAR_STRING<32> affiliateCallSign = 4;
+ optional CHAR_STRING<32> name = 2;
+ optional CHAR_STRING<32> callSign = 3;
+ optional CHAR_STRING<32> affiliateCallSign = 4;
}
struct LineupInfo {
CHAR_STRING operatorName = 0;
- CHAR_STRING lineupName = 1;
- CHAR_STRING postalCode = 2;
+ optional CHAR_STRING lineupName = 1;
+ optional CHAR_STRING postalCode = 2;
LineupInfoTypeEnum lineupInfoType = 3;
}
readonly attribute ChannelInfo channelList[] = 0;
- attribute LineupInfo channelLineup = 1;
- attribute ChannelInfo currentChannel = 2;
+ readonly attribute nullable LineupInfo channelLineup = 1;
+ readonly attribute nullable ChannelInfo currentChannel = 2;
readonly global attribute int16u clusterRevision = 65533;
request struct ChangeChannelByNumberRequestRequest {
@@ -649,7 +658,7 @@ client cluster ContentLauncher = 1290 {
struct Parameter {
ParameterEnum type = 0;
CHAR_STRING value = 1;
- AdditionalInfo externalIDList[] = 2;
+ optional AdditionalInfo externalIDList[] = 2;
}
struct AdditionalInfo {
@@ -659,17 +668,17 @@ client cluster ContentLauncher = 1290 {
struct BrandingInformation {
CHAR_STRING providerName = 0;
- StyleInformation background = 1;
- StyleInformation logo = 2;
- StyleInformation progressBar = 3;
- StyleInformation splash = 4;
- StyleInformation waterMark = 5;
+ optional StyleInformation background = 1;
+ optional StyleInformation logo = 2;
+ optional StyleInformation progressBar = 3;
+ optional StyleInformation splash = 4;
+ optional StyleInformation waterMark = 5;
}
struct StyleInformation {
- CHAR_STRING imageUrl = 0;
- CHAR_STRING color = 1;
- Dimension size = 2;
+ optional CHAR_STRING imageUrl = 0;
+ optional CHAR_STRING color = 1;
+ optional Dimension size = 2;
}
struct Dimension {
@@ -683,15 +692,15 @@ client cluster ContentLauncher = 1290 {
readonly global attribute int16u clusterRevision = 65533;
request struct LaunchContentRequestRequest {
- BOOLEAN autoPlay = 0;
- CHAR_STRING data = 1;
- ContentSearch search[] = 2;
+ ContentSearch search[] = 0;
+ BOOLEAN autoPlay = 1;
+ optional CHAR_STRING data = 2;
}
request struct LaunchURLRequestRequest {
CHAR_STRING contentURL = 0;
- CHAR_STRING displayString = 1;
- BrandingInformation brandingInformation = 2;
+ optional CHAR_STRING displayString = 1;
+ optional BrandingInformation brandingInformation = 2;
}
command LaunchContentRequest(LaunchContentRequestRequest): LaunchResponse = 0;
@@ -2414,7 +2423,7 @@ client cluster TargetNavigator = 1285 {
request struct NavigateTargetRequestRequest {
INT8U target = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
command NavigateTargetRequest(NavigateTargetRequestRequest): NavigateTargetResponse = 0;
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
index ef73836b7ab3e4..9c736399597490 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
@@ -854,7 +854,41 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": []
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
},
{
"name": "Binding",
@@ -865,21 +899,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
@@ -7971,7 +7990,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 0,
- "commands": [],
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -7999,21 +8035,6 @@
"enabled": 1,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ClusterRevision",
"code": 65533,
diff --git a/scripts/examples/imxlinux_example.sh b/scripts/examples/imxlinux_example.sh
new file mode 100755
index 00000000000000..a2c8eae43304eb
--- /dev/null
+++ b/scripts/examples/imxlinux_example.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+#
+# Copyright (c) 2022 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+set -x
+if [ "$#" != 2 ]; then
+ exit -1
+fi
+
+source "$(dirname "$0")/../../scripts/activate.sh"
+
+if [ "$IMX_SDK_ROOT" = "" ]; then
+ if [ "$CROSS_COMPILE" != "aarch64-poky-linux-" ]; then
+ echo "i.MX SDK root not aarch64"
+ exit -1
+ fi
+else
+ source "$IMX_SDK_ROOT"/environment-setup-cortexa53-crypto-poky-linux
+fi
+env
+
+PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s \"'
+PKG_CONFIG_SYSROOT_DIR=$PKG_CONFIG_SYSROOT_DIR \
+ PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" \
+ gn gen --check --fail-on-unused-args --root="$1" "$2" --args="target_os=\"linux\" target_cpu=\"arm64\" arm_arch=\"armv8-a\"
+import(\"//build_overrides/build.gni\")
+target_cflags=[ \"--sysroot=$SDKTARGETSYSROOT\", \"$PLATFORM_CFLAGS\" ]
+target_ldflags = [ \"--sysroot=$SDKTARGETSYSROOT\" ]
+custom_toolchain=\"\${build_root}/toolchain/custom\"
+target_cc=\"$OECORE_NATIVE_SYSROOT/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc\"
+target_cxx=\"$OECORE_NATIVE_SYSROOT/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++\"
+target_ar=\"$OECORE_NATIVE_SYSROOT/usr/bin/aarch64-poky-linux/aarch64-poky-linux-ar\""
+
+ninja -C "$2"
diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h
index 7d46efcc825276..d12ea80e25bce0 100644
--- a/src/app/AttributeAccessInterface.h
+++ b/src/app/AttributeAccessInterface.h
@@ -382,8 +382,7 @@ class AttributeAccessInterface
* involve reading from the attribute store or external attribute
* callbacks.
*/
- virtual CHIP_ERROR Read(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder) = 0;
+ virtual CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) = 0;
/**
* Callback for writing attributes.
@@ -403,11 +402,7 @@ class AttributeAccessInterface
* involve writing to the attribute store or external attribute
* callbacks.
*/
- virtual CHIP_ERROR Write(FabricIndex aAccessingFabricIndex, const ConcreteDataAttributePath & aPath,
- AttributeValueDecoder & aDecoder)
- {
- return CHIP_NO_ERROR;
- }
+ virtual CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) { return CHIP_NO_ERROR; }
/**
* Mechanism for keeping track of a chain of AttributeAccessInterfaces.
diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp
index a208b612556a6c..80920627cacf71 100644
--- a/src/app/AttributePathExpandIterator.cpp
+++ b/src/app/AttributePathExpandIterator.cpp
@@ -46,6 +46,7 @@ extern Optional emberAfGetNthClusterId(chip::EndpointId endpoint, uin
extern Optional emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
uint16_t attributeIndex);
extern uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask);
+extern bool emberAfEndpointIndexIsEnabled(uint16_t index);
namespace chip {
namespace app {
@@ -138,6 +139,12 @@ bool AttributePathExpandIterator::Next()
for (; mEndpointIndex < mEndEndpointIndex; (mEndpointIndex++, mClusterIndex = UINT8_MAX, mAttributeIndex = UINT16_MAX))
{
+ if (!emberAfEndpointIndexIsEnabled(mEndpointIndex))
+ {
+ // Not an enabled endpoint; skip it.
+ continue;
+ }
+
EndpointId endpointId = emberAfEndpointFromIndex(mEndpointIndex);
if (mClusterIndex == UINT8_MAX)
diff --git a/src/app/ConcreteAttributePath.h b/src/app/ConcreteAttributePath.h
index 0fb764e057fae9..97e29bc190766d 100644
--- a/src/app/ConcreteAttributePath.h
+++ b/src/app/ConcreteAttributePath.h
@@ -18,6 +18,7 @@
#pragma once
+#include
#include
#include
@@ -30,28 +31,34 @@ namespace app {
* The expanded flag can be set to indicate that a concrete path was expanded from a wildcard
* or group path.
*/
-struct ConcreteAttributePath
+struct ConcreteAttributePath : public ConcreteClusterPath
{
- ConcreteAttributePath() {}
+ ConcreteAttributePath()
+ {
+ // Note: mExpanded is in the superclass, so we can't use a field
+ // initializer.
+ mExpanded = false;
+ }
ConcreteAttributePath(EndpointId aEndpointId, ClusterId aClusterId, AttributeId aAttributeId) :
- mEndpointId(aEndpointId), mClusterId(aClusterId), mAttributeId(aAttributeId)
- {}
+ ConcreteClusterPath(aEndpointId, aClusterId), mAttributeId(aAttributeId)
+ {
+ // Note: mExpanded is in the supercclass, so we can't use a field
+ // initializer.
+ mExpanded = false;
+ }
- bool operator==(const ConcreteAttributePath & other) const
+ bool operator==(const ConcreteAttributePath & aOther) const
{
- return (mEndpointId == other.mEndpointId) && (mClusterId == other.mClusterId) && (mAttributeId == other.mAttributeId);
+ return ConcreteClusterPath::operator==(aOther) && (mAttributeId == aOther.mAttributeId);
}
bool operator<(const ConcreteAttributePath & path) const
{
return (mEndpointId < path.mEndpointId) || ((mEndpointId == path.mEndpointId) && (mClusterId < path.mClusterId)) ||
- ((mClusterId == path.mClusterId) && (mAttributeId < path.mAttributeId));
+ ((mEndpointId == path.mEndpointId) && (mClusterId == path.mClusterId) && (mAttributeId < path.mAttributeId));
}
- EndpointId mEndpointId = 0;
- bool mExpanded = false; // NOTE: in between larger members
- ClusterId mClusterId = 0;
AttributeId mAttributeId = 0;
};
diff --git a/src/app/ConcreteClusterPath.h b/src/app/ConcreteClusterPath.h
new file mode 100644
index 00000000000000..ec880e8df404b2
--- /dev/null
+++ b/src/app/ConcreteClusterPath.h
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2021 Project CHIP Authors
+ * All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include
+
+namespace chip {
+namespace app {
+
+/**
+ * A representation of a concrete cluster path. This identifies a specific
+ * cluster instance.
+ */
+struct ConcreteClusterPath
+{
+ ConcreteClusterPath(EndpointId aEndpointId, ClusterId aClusterId) : mEndpointId(aEndpointId), mClusterId(aClusterId) {}
+
+ ConcreteClusterPath() {}
+
+ ConcreteClusterPath(const ConcreteClusterPath & aOther) = default;
+ ConcreteClusterPath & operator=(const ConcreteClusterPath & aOther) = default;
+
+ bool operator==(const ConcreteClusterPath & aOther) const
+ {
+ return mEndpointId == aOther.mEndpointId && mClusterId == aOther.mClusterId;
+ }
+
+ bool operator!=(const ConcreteClusterPath & aOther) const { return !(*this == aOther); }
+
+ EndpointId mEndpointId = 0;
+ // Note: not all subclasses of ConcreteClusterPath need mExpanded, but due
+ // to alignment requirements it's "free" in the sense of not needing more
+ // memory to put it here. But we don't initialize it, because that
+ // increases codesize for the non-consumers.
+ bool mExpanded; // NOTE: in between larger members
+ ClusterId mClusterId = 0;
+};
+
+} // namespace app
+} // namespace chip
diff --git a/src/app/ConcreteCommandPath.h b/src/app/ConcreteCommandPath.h
index 7287e1289ddbb0..5020aa0ba6d2c0 100644
--- a/src/app/ConcreteCommandPath.h
+++ b/src/app/ConcreteCommandPath.h
@@ -18,8 +18,8 @@
#pragma once
+#include
#include
-#include
namespace chip {
namespace app {
@@ -27,20 +27,20 @@ namespace app {
/**
* A representation of a concrete invoke path.
*/
-struct ConcreteCommandPath
+struct ConcreteCommandPath : public ConcreteClusterPath
{
ConcreteCommandPath(EndpointId aEndpointId, ClusterId aClusterId, CommandId aCommandId) :
- mEndpointId(aEndpointId), mClusterId(aClusterId), mCommandId(aCommandId)
+ ConcreteClusterPath(aEndpointId, aClusterId), mCommandId(aCommandId)
{}
- bool operator==(const ConcreteCommandPath & other) const
+ bool operator==(const ConcreteCommandPath & aOther) const
{
- return mEndpointId == other.mEndpointId && mClusterId == other.mClusterId && mCommandId == other.mCommandId;
+ return ConcreteClusterPath::operator==(aOther) && (mCommandId == aOther.mCommandId);
}
- EndpointId mEndpointId = 0;
- ClusterId mClusterId = 0;
- CommandId mCommandId = 0;
+ bool operator!=(const ConcreteCommandPath & aOther) const { return !(*this == aOther); }
+
+ CommandId mCommandId = 0;
};
} // namespace app
} // namespace chip
diff --git a/src/app/ConcreteEventPath.h b/src/app/ConcreteEventPath.h
index 8dd9ce6aaa419d..92dc1859f6256b 100644
--- a/src/app/ConcreteEventPath.h
+++ b/src/app/ConcreteEventPath.h
@@ -18,6 +18,7 @@
#pragma once
+#include
#include
namespace chip {
@@ -26,25 +27,25 @@ namespace app {
/**
* A representation of a concrete event path.
*/
-struct ConcreteEventPath
+struct ConcreteEventPath : public ConcreteClusterPath
{
ConcreteEventPath(EndpointId aEndpointId, ClusterId aClusterId, EventId aEventId) :
- mEndpointId(aEndpointId), mClusterId(aClusterId), mEventId(aEventId)
+ ConcreteClusterPath(aEndpointId, aClusterId), mEventId(aEventId)
{}
ConcreteEventPath() {}
- ConcreteEventPath(const ConcreteEventPath & other) = default;
- ConcreteEventPath & operator=(const ConcreteEventPath & other) = default;
+ ConcreteEventPath(const ConcreteEventPath & aOther) = default;
+ ConcreteEventPath & operator=(const ConcreteEventPath & aOther) = default;
- bool operator==(const ConcreteEventPath & other) const
+ bool operator==(const ConcreteEventPath & aOther) const
{
- return mEndpointId == other.mEndpointId && mClusterId == other.mClusterId && mEventId == other.mEventId;
+ return ConcreteClusterPath::operator==(aOther) && (mEventId == aOther.mEventId);
}
- EndpointId mEndpointId = 0;
- ClusterId mClusterId = 0;
- EventId mEventId = 0;
+ bool operator!=(const ConcreteEventPath & aOther) const { return !(*this == aOther); }
+
+ EventId mEventId = 0;
};
} // namespace app
} // namespace chip
diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp
index fa8925abd09731..3fadd8273562dd 100644
--- a/src/app/app-platform/ContentAppPlatform.cpp
+++ b/src/app/app-platform/ContentAppPlatform.cpp
@@ -390,17 +390,20 @@ uint32_t ContentAppPlatform::GetPincodeFromContentApp(uint16_t vendorId, uint16_
CHIP_ERROR ContentAppPlatform::CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId,
chip::NodeId bindingNodeId, chip::GroupId bindingGroupId,
chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId,
- Controller::WriteResponseSuccessCallback successCb,
- Controller::WriteResponseFailureCallback failureCb)
+ CommandResponseSuccessCallback successCb,
+ CommandResponseFailureCallback failureCb)
{
chip::Controller::BindingCluster cluster;
cluster.Associate(device, deviceEndpointId);
- Binding::Structs::BindingEntry::Type entries[1] = { { bindingNodeId, bindingGroupId, bindingEndpointId, bindingClusterId } };
- Binding::Attributes::BindingList::TypeInfo::Type bindingList(entries);
- cluster.WriteAttribute(bindingList, nullptr, Binding::Id, Binding::Attributes::BindingList::Id, successCb, failureCb,
- NullOptional);
- ChipLogDetail(Controller, "CreateBindingWithCallback: Sent Bind write request, waiting for response");
+ Binding::Commands::Bind::Type request;
+ request.nodeId = bindingNodeId;
+ request.groupId = bindingGroupId;
+ request.endpointId = bindingEndpointId;
+ request.clusterId = bindingClusterId;
+ ReturnErrorOnFailure(cluster.InvokeCommand(request, this, successCb, failureCb));
+
+ ChipLogDetail(Controller, "CreateBindingWithCallback: Sent Bind command request, waiting for response");
return CHIP_NO_ERROR;
}
diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h
index bb135243fccdc2..81a364c022df37 100644
--- a/src/app/app-platform/ContentAppPlatform.h
+++ b/src/app/app-platform/ContentAppPlatform.h
@@ -127,16 +127,16 @@ class DLL_EXPORT ContentAppPlatform
* @param[in] bindingGroupId The GroupId for the binding that will be created.
* @param[in] bindingEndpointId The EndpointId for the binding that will be created.
* @param[in] bindingClusterId The ClusterId for the binding that will be created.
- * @param[in] successCb The function to be called on success of adding the binding.
- * @param[in] failureCb The function to be called on failure of adding the binding.
+ * @param[in] onSuccessCallback The function to be called on success of adding the binding.
+ * @param[in] onFailureCallback The function to be called on failure of adding the binding.
*
* @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error
*/
CHIP_ERROR CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId,
chip::NodeId bindingNodeId, chip::GroupId bindingGroupId,
chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId,
- Controller::WriteResponseSuccessCallback successCb,
- Controller::WriteResponseFailureCallback failureCb);
+ CommandResponseSuccessCallback successCb,
+ CommandResponseFailureCallback failureCb);
protected:
// requires vendorApp to be in the catalog of the platform
diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp
index 49fdff9d234c5d..857b183f39827e 100644
--- a/src/app/clusters/access-control-server/access-control-server.cpp
+++ b/src/app/clusters/access-control-server/access-control-server.cpp
@@ -291,8 +291,8 @@ class AccessControlAttribute : public chip::app::AttributeAccessInterface
public:
AccessControlAttribute() : AttributeAccessInterface(Optional(0), AccessControlCluster::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
static constexpr uint16_t ClusterRevision = 1;
@@ -383,8 +383,7 @@ CHIP_ERROR LogAccessControlEvent(const AccessControl::Entry & entry, const Acces
return err;
}
-CHIP_ERROR AccessControlAttribute::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR AccessControlAttribute::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
{
@@ -422,8 +421,7 @@ CHIP_ERROR AccessControlAttribute::ReadExtension(AttributeValueEncoder & aEncode
return aEncoder.EncodeEmptyList();
}
-CHIP_ERROR AccessControlAttribute::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath,
- AttributeValueDecoder & aDecoder)
+CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
switch (aPath.mAttributeId)
{
diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
index ebc1218a551396..16732722b3539f 100644
--- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
+++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
@@ -47,7 +47,7 @@ class AdministratorCommissioningAttrAccess : public AttributeAccessInterface
AttributeAccessInterface(Optional::Missing(), Clusters::AdministratorCommissioning::Id)
{}
- CHIP_ERROR Read(FabricIndex fabric, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
// Vendor ID and Fabric Index of the admin that has opened the commissioning window
uint16_t mVendorId;
@@ -56,8 +56,7 @@ class AdministratorCommissioningAttrAccess : public AttributeAccessInterface
AdministratorCommissioningAttrAccess gAdminCommissioningAttrAccess;
-CHIP_ERROR AdministratorCommissioningAttrAccess::Read(FabricIndex fabric, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR AdministratorCommissioningAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == Clusters::AdministratorCommissioning::Id);
diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp
index cc3303c818a309..3d3f89dc6b824b 100644
--- a/src/app/clusters/application-basic-server/application-basic-server.cpp
+++ b/src/app/clusters/application-basic-server/application-basic-server.cpp
@@ -129,8 +129,7 @@ class ApplicationBasicAttrAccess : public app::AttributeAccessInterface
public:
ApplicationBasicAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ApplicationBasic::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadVendorNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -145,8 +144,7 @@ class ApplicationBasicAttrAccess : public app::AttributeAccessInterface
ApplicationBasicAttrAccess gApplicationBasicAttrAccess;
-CHIP_ERROR ApplicationBasicAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR ApplicationBasicAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
index df15629d841b54..86d9299f69946f 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp
+++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
@@ -114,10 +114,9 @@ CHIP_ERROR Delegate::HandleGetCurrentApp(app::AttributeValueEncoder & aEncoder)
{
ApplicationEPType currentApp;
CatalogVendorApp * vendorApp = app->GetApplicationBasicDelegate()->GetCatalogVendorApp();
- std::string endpointStr = std::to_string(app->GetEndpointId());
currentApp.application.catalogVendorId = vendorApp->catalogVendorId;
currentApp.application.applicationId = CharSpan(vendorApp->applicationId, strlen(vendorApp->applicationId));
- currentApp.endpoint = CharSpan(endpointStr.c_str(), endpointStr.length());
+ currentApp.endpoint = Optional(app->GetEndpointId());
return aEncoder.Encode(currentApp);
}
}
@@ -128,7 +127,7 @@ CHIP_ERROR Delegate::HandleGetCurrentApp(app::AttributeValueEncoder & aEncoder)
ApplicationEPType currentApp;
currentApp.application.catalogVendorId = 123;
currentApp.application.applicationId = CharSpan("applicationId", strlen("applicationId"));
- currentApp.endpoint = CharSpan("endpointId", strlen("endpointId"));
+ currentApp.endpoint = Optional::Missing();
return aEncoder.Encode(currentApp);
}
@@ -147,8 +146,7 @@ class ApplicationLauncherAttrAccess : public app::AttributeAccessInterface
public:
ApplicationLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ApplicationLauncher::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadCatalogListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -157,8 +155,7 @@ class ApplicationLauncherAttrAccess : public app::AttributeAccessInterface
ApplicationLauncherAttrAccess gApplicationLauncherAttrAccess;
-CHIP_ERROR ApplicationLauncherAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR ApplicationLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
@@ -215,12 +212,13 @@ bool emberAfApplicationLauncherClusterLaunchAppRequestCallback(app::CommandHandl
app::CommandResponseHelper responder(command, commandPath);
std::string appId(application.applicationId.data(), application.applicationId.size());
- if (appId.length() == 0)
+
+ if (appId.length() == 0 && data.HasValue())
{
// chip-tool can't send structs from command line so treat data value as appid if appid is blank
// TODO: fix this once chip-tool support sending structs from command line
ChipLogError(Zcl, "ApplicationLauncher blank content id, taking data as appid");
- appId = std::string((char *) data.data(), data.size());
+ appId = std::string((char *) data.Value().data(), data.Value().size());
}
CatalogVendorApp vendorApp(application.catalogVendorId, appId.c_str());
@@ -252,7 +250,8 @@ bool emberAfApplicationLauncherClusterLaunchAppRequestCallback(app::CommandHandl
ContentAppPlatform::GetInstance().SetCurrentApp(app);
ChipLogError(Zcl, "ApplicationLauncher handling launch on ContentApp");
- app->GetApplicationLauncherDelegate()->HandleLaunchApp(responder, data, application);
+ app->GetApplicationLauncherDelegate()->HandleLaunchApp(responder, data.HasValue() ? data.Value() : ByteSpan(),
+ application);
return true;
}
#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
@@ -277,7 +276,7 @@ bool emberAfApplicationLauncherClusterLaunchAppRequestCallback(app::CommandHandl
#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
ChipLogError(Zcl, "ApplicationLauncher handling launch");
- delegate->HandleLaunchApp(responder, data, application);
+ delegate->HandleLaunchApp(responder, data.HasValue() ? data.Value() : ByteSpan(), application);
}
exit:
diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp
index 3bbc1226338ca5..38ba765ad725ff 100644
--- a/src/app/clusters/audio-output-server/audio-output-server.cpp
+++ b/src/app/clusters/audio-output-server/audio-output-server.cpp
@@ -93,8 +93,7 @@ class AudioOutputAttrAccess : public app::AttributeAccessInterface
AudioOutputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::AudioOutput::Id)
{}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadOutputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -103,8 +102,7 @@ class AudioOutputAttrAccess : public app::AttributeAccessInterface
AudioOutputAttrAccess gAudioOutputAttrAccess;
-CHIP_ERROR AudioOutputAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR AudioOutputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp
index 9d6d6d66f53313..b74a6885c7339d 100644
--- a/src/app/clusters/basic/basic.cpp
+++ b/src/app/clusters/basic/basic.cpp
@@ -49,8 +49,8 @@ class BasicAttrAccess : public AttributeAccessInterface
// Register for the Basic cluster on all endpoints.
BasicAttrAccess() : AttributeAccessInterface(Optional::Missing(), Basic::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
private:
CHIP_ERROR ReadDataModelRevision(AttributeValueEncoder & aEncoder);
@@ -66,7 +66,7 @@ CHIP_ERROR EncodeStringOnSuccess(CHIP_ERROR status, AttributeValueEncoder & enco
return encoder.Encode(chip::CharSpan(buf, strnlen(buf, maxBufSize)));
}
-CHIP_ERROR BasicAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR BasicAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != Basic::Id)
{
@@ -297,8 +297,7 @@ CHIP_ERROR BasicAttrAccess::ReadLocation(AttributeValueEncoder & aEncoder)
return aEncoder.Encode(chip::CharSpan(location, codeLen));
}
-CHIP_ERROR BasicAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath,
- AttributeValueDecoder & aDecoder)
+CHIP_ERROR BasicAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
VerifyOrDie(aPath.mClusterId == Basic::Id);
diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp
index 7ce106da08cb55..a2817ca1576245 100644
--- a/src/app/clusters/bindings/BindingManager.cpp
+++ b/src/app/clusters/bindings/BindingManager.cpp
@@ -179,7 +179,7 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste
VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND);
PeerId peer = fabricInfo->GetPeerIdForNode(entry.nodeId);
OperationalDeviceProxy * peerDevice = mAppServer->GetCASESessionManager()->FindExistingSession(peer);
- if (peerDevice != nullptr && peerDevice->IsConnected() && mBoundDeviceChangedHandler)
+ if (peerDevice != nullptr && mBoundDeviceChangedHandler)
{
// We already have an active connection
mBoundDeviceChangedHandler(&entry, peerDevice, context);
@@ -187,10 +187,7 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste
else
{
mPendingNotificationMap.AddPendingNotification(i, context);
- if (!peerDevice->IsConnecting())
- {
- ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId));
- }
+ ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId));
}
}
else if (entry.type == EMBER_MULTICAST_BINDING)
diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp
index f238daa9325646..cfe7ea5f81e773 100644
--- a/src/app/clusters/bindings/bindings.cpp
+++ b/src/app/clusters/bindings/bindings.cpp
@@ -20,48 +20,27 @@
* @brief Implementation for the Binding Server Cluster
***************************************************************************/
+#include
+
#include
-#include
-#include
#include
-#include
+#include
#include
-#include
#include
#include
using namespace chip;
-using namespace chip::app;
-using namespace chip::app::Clusters;
using namespace chip::app::Clusters::Binding;
-using namespace chip::app::Clusters::Binding::Attributes;
// TODO: add binding table to the persistent storage
-namespace {
-class BindingTableAccess : public AttributeAccessInterface
-{
-public:
- // Register for the User Label cluster on all endpoints.
- BindingTableAccess() : AttributeAccessInterface(Optional::Missing(), Binding::Id) {}
-
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) override;
-
-private:
- CHIP_ERROR ReadBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueEncoder & encoder);
- CHIP_ERROR WriteBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueDecoder & decoder);
-};
-
-BindingTableAccess gAttrAccess;
-
-EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex)
+static EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * bindingIndex)
{
EmberBindingTableEntry currentEntry;
for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++)
{
emberGetBinding(i, ¤tEntry);
- if (currentEntry.type == EMBER_UNUSED_BINDING)
+ if (currentEntry.type != EMBER_UNUSED_BINDING && currentEntry == newEntry)
{
*bindingIndex = i;
return EMBER_SUCCESS;
@@ -71,60 +50,31 @@ EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex)
return EMBER_NOT_FOUND;
}
-bool BindingEntryMatches(FabricIndex fabricIndex, EndpointId endpoint, const EmberBindingTableEntry & entry,
- const Structs::BindingEntry::Type & value)
-{
- if (entry.local != endpoint || entry.fabricIndex != fabricIndex || entry.clusterId != value.clusterId)
- {
- return false;
- }
- return (entry.type == EMBER_UNICAST_BINDING && entry.nodeId == value.nodeId && entry.remote == value.endpointId) ||
- (entry.type == EMBER_MULTICAST_BINDING && entry.groupId == value.groupId);
-}
-
-bool IsInBindingList(FabricIndex fabricIndex, EndpointId endpoint, const EmberBindingTableEntry & entry,
- const BindingList::TypeInfo::DecodableType & bindingList)
-{
- if (entry.type == EMBER_UNUSED_BINDING)
- {
- return false;
- }
- auto iter = bindingList.begin();
- while (iter.Next())
- {
- if (BindingEntryMatches(fabricIndex, endpoint, entry, iter.GetValue()))
- {
- return true;
- }
- }
- return false;
-}
-
-bool IsInBindingTable(FabricIndex fabricIndex, EndpointId endpoint,
- const Binding::Structs::BindingEntry::DecodableType & bindingEntry)
+static EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex)
{
+ EmberBindingTableEntry currentEntry;
for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++)
{
- EmberBindingTableEntry currentEntry;
emberGetBinding(i, ¤tEntry);
- if (currentEntry.type != EMBER_UNUSED_BINDING)
+ if (currentEntry.type == EMBER_UNUSED_BINDING)
{
- if (BindingEntryMatches(fabricIndex, endpoint, currentEntry, bindingEntry))
- {
- return true;
- }
+ *bindingIndex = i;
+ return EMBER_SUCCESS;
}
}
- return false;
+
+ return EMBER_NOT_FOUND;
}
-CHIP_ERROR AddBindingEntry(const Binding::Structs::BindingEntry::DecodableType & entry, FabricIndex fabricIndex,
- EndpointId localEndpoint, uint8_t * outBindingIndex)
+bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
+ const Commands::Bind::DecodableType & commandData)
{
- GroupId groupId = entry.groupId;
- NodeId nodeId = entry.nodeId;
- EndpointId remoteEndpoint = entry.endpointId;
- ClusterId clusterId = entry.clusterId;
+ NodeId nodeId = commandData.nodeId;
+ GroupId groupId = commandData.groupId;
+ ClusterId clusterId = commandData.clusterId;
+ EndpointId remoteEndpoint = commandData.endpointId;
+ EndpointId localEndpoint = commandPath.mEndpointId;
+ FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex();
EmberBindingTableEntry bindingEntry;
ChipLogDetail(Zcl, "RX: BindCallback");
@@ -132,7 +82,8 @@ CHIP_ERROR AddBindingEntry(const Binding::Structs::BindingEntry::DecodableType &
if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0) || (groupId != 0 && remoteEndpoint != 0))
{
ChipLogError(Zcl, "Binding: Invalid request");
- return CHIP_ERROR_INVALID_ARGUMENT;
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND);
+ return true;
}
if (groupId)
@@ -145,10 +96,16 @@ CHIP_ERROR AddBindingEntry(const Binding::Structs::BindingEntry::DecodableType &
}
uint8_t bindingIndex;
+ if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_NOT_FOUND)
+ {
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_DUPLICATE_EXISTS);
+ return true;
+ }
if (getUnusedBindingIndex(&bindingIndex) != EMBER_SUCCESS)
{
- return CHIP_ERROR_NO_MEMORY;
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INSUFFICIENT_SPACE);
+ return true;
}
emberSetBinding(bindingIndex, &bindingEntry);
@@ -163,127 +120,55 @@ CHIP_ERROR AddBindingEntry(const Binding::Structs::BindingEntry::DecodableType &
}
}
- return CHIP_NO_ERROR;
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
+ return true;
}
-} // namespace
-
-CHIP_ERROR BindingTableAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & path,
- AttributeValueEncoder & encoder)
+bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
+ const Commands::Unbind::DecodableType & commandData)
{
- switch (path.mAttributeId)
- {
- case BindingList::Id:
- return ReadBindingTable(fabricIndex, path.mEndpointId, encoder);
- default:
- break;
- }
- return CHIP_NO_ERROR;
-}
+ NodeId nodeId = commandData.nodeId;
+ GroupId groupId = commandData.groupId;
+ ClusterId clusterId = commandData.clusterId;
+ EndpointId remoteEndpoint = commandData.endpointId;
+ EndpointId localEndpoint = commandPath.mEndpointId;
+ FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex();
+ EmberBindingTableEntry bindingEntry;
-CHIP_ERROR BindingTableAccess::ReadBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueEncoder & encoder)
-{
- DeviceLayer::AttributeList bindingTable;
+ ChipLogDetail(Zcl, "RX: UnbindCallback");
- for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++)
+ if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0))
{
- EmberBindingTableEntry entry;
- emberGetBinding(i, &entry);
- if (entry.type == EMBER_UNICAST_BINDING && entry.fabricIndex == fabricIndex)
- {
- Structs::BindingEntry::Type value = {
- .nodeId = entry.nodeId,
- .groupId = 0,
- .endpointId = entry.remote,
- .clusterId = entry.clusterId,
- };
- bindingTable.add(value);
- }
- else if (entry.type == EMBER_MULTICAST_BINDING && entry.fabricIndex == fabricIndex)
- {
- Structs::BindingEntry::Type value = {
- .nodeId = 0,
- .groupId = entry.groupId,
- .endpointId = 0,
- .clusterId = entry.clusterId,
- };
- bindingTable.add(value);
- }
+ ChipLogError(Zcl, "Binding: Invalid request");
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND);
+ return true;
}
- return encoder.EncodeList([&bindingTable](const auto & subEncoder) {
- for (auto & value : bindingTable)
- {
- ReturnErrorOnFailure(subEncoder.Encode(value));
- }
- return CHIP_NO_ERROR;
- });
-}
-
-CHIP_ERROR BindingTableAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & path,
- AttributeValueDecoder & decoder)
-{
- switch (path.mAttributeId)
+ if (groupId)
{
- case BindingList::Id:
- return WriteBindingTable(fabricIndex, path.mEndpointId, decoder);
- default:
- break;
+ bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId);
}
- return CHIP_NO_ERROR;
-}
-
-CHIP_ERROR BindingTableAccess::WriteBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueDecoder & decoder)
-{
- BindingList::TypeInfo::DecodableType newBindingList;
-
- ReturnErrorOnFailure(decoder.Decode(newBindingList));
-
- // Add entries currently not in the binding table
- auto iter = newBindingList.begin();
- CHIP_ERROR err = CHIP_NO_ERROR;
- uint8_t addedBindingIndecies[EMBER_BINDING_TABLE_SIZE];
- uint8_t numAddedBindings = 0;
- while (iter.Next())
+ else
{
- if (!IsInBindingTable(fabricIndex, endpoint, iter.GetValue()))
- {
- err = AddBindingEntry(iter.GetValue(), fabricIndex, endpoint, &addedBindingIndecies[numAddedBindings]);
- if (err != CHIP_NO_ERROR)
- {
- break;
- }
- numAddedBindings++;
- }
+ bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId);
}
- // Revert the added entries upon error
- if (err != CHIP_NO_ERROR)
+
+ uint8_t bindingIndex;
+ if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_SUCCESS)
{
- for (uint8_t bindingIndex : addedBindingIndecies)
- {
- emberDeleteBinding(bindingIndex);
- }
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_NOT_FOUND);
+ return true;
}
- // Remove entries not in the new binding list
- for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++)
+ CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingRemoved(bindingIndex);
+ if (err != CHIP_NO_ERROR)
{
- EmberBindingTableEntry entry;
- emberGetBinding(i, &entry);
- if (entry.type != EMBER_UNUSED_BINDING && entry.fabricIndex == fabricIndex &&
- !IsInBindingList(fabricIndex, endpoint, entry, newBindingList))
- {
- if (entry.type == EMBER_UNICAST_BINDING && BindingManager::GetInstance().UnicastBindingRemoved(i) != CHIP_NO_ERROR)
- {
- ChipLogError(Zcl, "Binding: Failed to remove pending notification for unicast binding" ChipLogFormatX64 ": %s",
- ChipLogValueX64(entry.nodeId), err.AsString());
- }
- emberDeleteBinding(i);
- }
+ ChipLogError(Zcl, "Binding: Failed to remove pending notification for unicast binding" ChipLogFormatX64 ": %s",
+ ChipLogValueX64(nodeId), err.AsString());
}
- return err;
-}
-void MatterBindingPluginServerInitCallback()
-{
- registerAttributeAccessOverride(&gAttrAccess);
+ emberDeleteBinding(bindingIndex);
+ emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
+ return true;
}
+
+void MatterBindingPluginServerInitCallback() {}
diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp
index 9bd5bd079e1bc8..9ec8401090a082 100644
--- a/src/app/clusters/channel-server/channel-server.cpp
+++ b/src/app/clusters/channel-server/channel-server.cpp
@@ -125,8 +125,7 @@ class ChannelAttrAccess : public app::AttributeAccessInterface
public:
ChannelAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), Channel::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadChannelListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -136,8 +135,7 @@ class ChannelAttrAccess : public app::AttributeAccessInterface
ChannelAttrAccess gChannelAttrAccess;
-CHIP_ERROR ChannelAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp
index a69dff05d41a20..62efa5d61834c5 100644
--- a/src/app/clusters/content-launch-server/content-launch-server.cpp
+++ b/src/app/clusters/content-launch-server/content-launch-server.cpp
@@ -129,8 +129,7 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface
public:
ContentLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ContentLauncher::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -139,8 +138,7 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface
ContentLauncherAttrAccess gContentLauncherAttrAccess;
-CHIP_ERROR ContentLauncherAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
@@ -206,7 +204,7 @@ bool emberAfContentLauncherClusterLaunchContentRequestCallback(
Delegate * delegate = GetDelegate(endpoint);
VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);
{
- delegate->HandleLaunchContent(responder, parameterList, autoplay, data);
+ delegate->HandleLaunchContent(responder, parameterList, autoplay, data.HasValue() ? data.Value() : CharSpan());
}
exit:
@@ -242,7 +240,8 @@ bool emberAfContentLauncherClusterLaunchURLRequestCallback(
Delegate * delegate = GetDelegate(endpoint);
VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);
{
- delegate->HandleLaunchUrl(responder, contentUrl, displayString, brandingInformationList);
+ delegate->HandleLaunchUrl(responder, contentUrl, displayString.HasValue() ? displayString.Value() : CharSpan(),
+ brandingInformationList);
}
exit:
diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp
index 72315cc33602eb..fb4b425bdc6c50 100644
--- a/src/app/clusters/descriptor/descriptor.cpp
+++ b/src/app/clusters/descriptor/descriptor.cpp
@@ -42,7 +42,7 @@ class DescriptorAttrAccess : public AttributeAccessInterface
// Register for the Descriptor cluster on all endpoints.
DescriptorAttrAccess() : AttributeAccessInterface(Optional::Missing(), Descriptor::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
static constexpr uint16_t ClusterRevision = 1;
@@ -123,8 +123,7 @@ CHIP_ERROR DescriptorAttrAccess::ReadClusterRevision(EndpointId endpoint, Attrib
DescriptorAttrAccess gAttrAccess;
-CHIP_ERROR DescriptorAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == Descriptor::Id);
diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
index d0d453d012b6f9..d79a3129335050 100644
--- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
+++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
@@ -42,7 +42,7 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface
// Register for the EthernetNetworkDiagnostics cluster on all endpoints.
EthernetDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), EthernetNetworkDiagnostics::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
template
@@ -128,8 +128,7 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadCarrierDetect(AttributeValueEncoder
EthernetDiagosticsAttrAccess gAttrAccess;
-CHIP_ERROR EthernetDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR EthernetDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != EthernetNetworkDiagnostics::Id)
{
diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp
index 06f1181be90c85..497c92108f3f52 100644
--- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp
+++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp
@@ -44,7 +44,7 @@ class FixedLabelAttrAccess : public AttributeAccessInterface
// Register for the Fixed Label cluster on all endpoints.
FixedLabelAttrAccess() : AttributeAccessInterface(Optional::Missing(), FixedLabel::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder);
@@ -76,8 +76,7 @@ CHIP_ERROR FixedLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeVal
FixedLabelAttrAccess gAttrAccess;
-CHIP_ERROR FixedLabelAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == FixedLabel::Id);
diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
index 41690c4c9ed12f..e1e3d1c735f986 100644
--- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
+++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
@@ -58,7 +58,7 @@ class GeneralCommissioningAttrAccess : public AttributeAccessInterface
// Register for the GeneralCommissioning cluster on all endpoints.
GeneralCommissioningAttrAccess() : AttributeAccessInterface(Optional::Missing(), GeneralCommissioning::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadIfSupported(CHIP_ERROR (ConfigurationManager::*getter)(uint8_t &), AttributeValueEncoder & aEncoder);
@@ -67,8 +67,7 @@ class GeneralCommissioningAttrAccess : public AttributeAccessInterface
GeneralCommissioningAttrAccess gAttrAccess;
-CHIP_ERROR GeneralCommissioningAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR GeneralCommissioningAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != GeneralCommissioning::Id)
{
diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
index 57bb6dccb9082c..9283182c9d9dcf 100644
--- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
+++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp
@@ -51,7 +51,7 @@ class GeneralDiagosticsAttrAccess : public AttributeAccessInterface
// Register for the GeneralDiagnostics cluster on all endpoints.
GeneralDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), GeneralDiagnostics::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
template
@@ -135,8 +135,7 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::ReadNetworkInterfaces(AttributeValueEnco
GeneralDiagosticsAttrAccess gAttrAccess;
-CHIP_ERROR GeneralDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR GeneralDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != GeneralDiagnostics::Id)
{
diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
index 9977080004a2e3..f3d1406741e68e 100644
--- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
+++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
@@ -112,7 +112,7 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface
// Register for the GroupKeyManagement cluster on all endpoints.
GroupKeyManagementAttributeAccess() : AttributeAccessInterface(Optional(0), GroupKeyManagement::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override
{
VerifyOrDie(aPath.mClusterId == GroupKeyManagement::Id);
@@ -134,7 +134,7 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface
return CHIP_ERROR_READ_FAILED;
}
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override
{
if (GroupKeyManagement::Attributes::GroupKeyMap::Id == aPath.mAttributeId)
diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
index d294148566b59a..6892016ed07d18 100644
--- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
+++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp
@@ -46,7 +46,7 @@ class LocalizationConfigurationAttrAccess : public AttributeAccessInterface
LocalizationConfigurationAttrAccess() : AttributeAccessInterface(Optional::Missing(), LocalizationConfiguration::Id)
{}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadSupportedLocales(AttributeValueEncoder & aEncoder);
@@ -78,8 +78,7 @@ CHIP_ERROR LocalizationConfigurationAttrAccess::ReadSupportedLocales(AttributeVa
return err;
}
-CHIP_ERROR LocalizationConfigurationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR LocalizationConfigurationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == LocalizationConfiguration::Id);
diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp
index 11f89a526661cb..bc2ceb9dccb952 100644
--- a/src/app/clusters/media-input-server/media-input-server.cpp
+++ b/src/app/clusters/media-input-server/media-input-server.cpp
@@ -92,8 +92,7 @@ class MediaInputAttrAccess : public app::AttributeAccessInterface
public:
MediaInputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaInput::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadInputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -102,8 +101,7 @@ class MediaInputAttrAccess : public app::AttributeAccessInterface
MediaInputAttrAccess gMediaInputAttrAccess;
-CHIP_ERROR MediaInputAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR MediaInputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp
index e6b64460da46d4..9a22d9cf42d6c8 100644
--- a/src/app/clusters/media-playback-server/media-playback-server.cpp
+++ b/src/app/clusters/media-playback-server/media-playback-server.cpp
@@ -110,8 +110,7 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface
public:
MediaPlaybackAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), MediaPlayback::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadCurrentStateAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -125,8 +124,7 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface
MediaPlaybackAttrAccess gMediaPlaybackAttrAccess;
-CHIP_ERROR MediaPlaybackAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp
index 2f8bbb8b389305..67fd8e4718ede5 100644
--- a/src/app/clusters/mode-select-server/mode-select-server.cpp
+++ b/src/app/clusters/mode-select-server/mode-select-server.cpp
@@ -42,13 +42,12 @@ class ModeSelectAttrAccess : public AttributeAccessInterface
public:
ModeSelectAttrAccess() : AttributeAccessInterface(Optional::Missing(), ModeSelect::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
};
ModeSelectAttrAccess gModeSelectAttrAccess;
-CHIP_ERROR ModeSelectAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR ModeSelectAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == ModeSelect::Id);
diff --git a/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp b/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
index cddd2b7613def5..3904b7e0130e5a 100644
--- a/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
+++ b/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
@@ -53,7 +53,7 @@ class NetworkCommissioningAttributeAccess : public AttributeAccessInterface
public:
NetworkCommissioningAttributeAccess() : AttributeAccessInterface(Optional::Missing(), Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override
{
switch (aPath.mAttributeId)
{
diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp
index ceea07febfa6cf..2cdcaba762e6ff 100644
--- a/src/app/clusters/network-commissioning/network-commissioning.cpp
+++ b/src/app/clusters/network-commissioning/network-commissioning.cpp
@@ -149,7 +149,7 @@ void Instance::InvokeCommand(HandlerContext & ctxt)
}
}
-CHIP_ERROR Instance::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
{
@@ -212,7 +212,7 @@ CHIP_ERROR Instance::Read(FabricIndex fabricIndex, const ConcreteReadAttributePa
}
}
-CHIP_ERROR Instance::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
+CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
switch (aPath.mAttributeId)
{
diff --git a/src/app/clusters/network-commissioning/network-commissioning.h b/src/app/clusters/network-commissioning/network-commissioning.h
index cf80a665bc732e..10b95a12cbe475 100644
--- a/src/app/clusters/network-commissioning/network-commissioning.h
+++ b/src/app/clusters/network-commissioning/network-commissioning.h
@@ -50,8 +50,8 @@ class Instance : public CommandHandlerInterface,
void InvokeCommand(HandlerContext & ctx) override;
// AttributeAccessInterface
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
// WirelessDriver::ConnectCallback
void OnResult(DeviceLayer::NetworkCommissioning::Status commissioningError, CharSpan errorText,
diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
index d35ce39ad78f8a..6d4655bddf00ca 100644
--- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
+++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
@@ -89,7 +89,7 @@ class OperationalCredentialsAttrAccess : public AttributeAccessInterface
AttributeAccessInterface(Optional::Missing(), Clusters::OperationalCredentials::Id)
{}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadNOCs(EndpointId endpoint, AttributeValueEncoder & aEncoder);
@@ -193,8 +193,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadRootCertificates(EndpointId end
OperationalCredentialsAttrAccess gAttrAccess;
-CHIP_ERROR OperationalCredentialsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR OperationalCredentialsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == Clusters::OperationalCredentials::Id);
diff --git a/src/app/clusters/ota-requestor/BDXDownloader.cpp b/src/app/clusters/ota-requestor/BDXDownloader.cpp
index 31a77fdfef2c55..7f0be086aeed27 100644
--- a/src/app/clusters/ota-requestor/BDXDownloader.cpp
+++ b/src/app/clusters/ota-requestor/BDXDownloader.cpp
@@ -184,9 +184,7 @@ CHIP_ERROR BDXDownloader::HandleBdxEvent(const chip::bdx::TransferSession::Outpu
case TransferSession::OutputEventType::kBlockReceived: {
chip::ByteSpan blockData(outEvent.blockdata.Data, outEvent.blockdata.Length);
ReturnErrorOnFailure(mImageProcessor->ProcessBlock(blockData));
- Nullable percent;
- mImageProcessor->GetPercentComplete(percent);
- mStateDelegate->OnUpdateProgressChanged(percent);
+ mStateDelegate->OnUpdateProgressChanged(mImageProcessor->GetPercentComplete());
// TODO: this will cause problems if Finalize() is not guaranteed to do its work after ProcessBlock().
if (outEvent.blockdata.IsEof)
diff --git a/src/app/clusters/ota-requestor/OTARequestor.cpp b/src/app/clusters/ota-requestor/OTARequestor.cpp
index 4a7fd2d4a367a9..f389e3534e9644 100644
--- a/src/app/clusters/ota-requestor/OTARequestor.cpp
+++ b/src/app/clusters/ota-requestor/OTARequestor.cpp
@@ -511,8 +511,7 @@ void OTARequestor::RecordErrorUpdateState(UpdateFailureState failureState, CHIP_
// Log the DownloadError event
OTAImageProcessorInterface * imageProcessor = mBdxDownloader->GetImageProcessorDelegate();
VerifyOrReturn(imageProcessor != nullptr);
- Nullable progressPercent;
- imageProcessor->GetPercentComplete(progressPercent);
+ Nullable progressPercent = imageProcessor->GetPercentComplete();
Nullable platformCode;
OtaRequestorServerOnDownloadError(mTargetVersion, imageProcessor->GetBytesDownloaded(), progressPercent, platformCode);
diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
index 8e11584c61e066..b7916b643a6e04 100644
--- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp
+++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp
@@ -43,14 +43,13 @@ class OtaSoftwareUpdateRequestorAttrAccess : public AttributeAccessInterface
{}
// TODO: Implement Read/Write for OtaSoftwareUpdateRequestorAttrAccess
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
};
OtaSoftwareUpdateRequestorAttrAccess gAttrAccess;
-CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
{
@@ -63,8 +62,7 @@ CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(FabricIndex fabricIndex, c
return CHIP_NO_ERROR;
}
-CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath,
- AttributeValueDecoder & aDecoder)
+CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
switch (aPath.mAttributeId)
{
diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp
index 686a1a3f978380..6301b7fb98cc46 100644
--- a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp
+++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp
@@ -43,13 +43,12 @@ class PowerSourceConfigurationAttrAccess : public AttributeAccessInterface
PowerSourceConfigurationAttrAccess() : AttributeAccessInterface(Optional::Missing(), PowerSourceConfiguration::Id)
{}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
};
PowerSourceConfigurationAttrAccess gAttrAccess;
-CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
CHIP_ERROR err = CHIP_NO_ERROR;
diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp
index 9a3145064064fa..95b19fd5be564a 100644
--- a/src/app/clusters/power-source-server/power-source-server.cpp
+++ b/src/app/clusters/power-source-server/power-source-server.cpp
@@ -40,13 +40,12 @@ class PowerSourceAttrAccess : public AttributeAccessInterface
// Register on all endpoints.
PowerSourceAttrAccess() : AttributeAccessInterface(Optional::Missing(), PowerSource::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
};
PowerSourceAttrAccess gAttrAccess;
-CHIP_ERROR PowerSourceAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR PowerSourceAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
CHIP_ERROR err = CHIP_NO_ERROR;
diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
index 3f5f9d99a4c761..62f0f3a8b18704 100644
--- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
+++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
@@ -44,7 +44,7 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface
// Register for the SoftwareDiagnostics cluster on all endpoints.
SoftwareDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), SoftwareDiagnostics::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &), AttributeValueEncoder & aEncoder);
@@ -53,8 +53,7 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface
SoftwareDiagosticsAttrAccess gAttrAccess;
-CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != SoftwareDiagnostics::Id)
{
diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp
index c9c5f1fd344bf0..fef9de55a450b1 100644
--- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp
+++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp
@@ -110,8 +110,7 @@ class TargetNavigatorAttrAccess : public app::AttributeAccessInterface
public:
TargetNavigatorAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), TargetNavigator::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadTargetListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -120,8 +119,7 @@ class TargetNavigatorAttrAccess : public app::AttributeAccessInterface
TargetNavigatorAttrAccess gTargetNavigatorAttrAccess;
-CHIP_ERROR TargetNavigatorAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR TargetNavigatorAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
@@ -182,7 +180,7 @@ bool emberAfTargetNavigatorClusterNavigateTargetRequestCallback(app::CommandHand
VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);
{
- delegate->HandleNavigateTarget(responder, target, data);
+ delegate->HandleNavigateTarget(responder, target, data.HasValue() ? data.Value() : CharSpan());
}
exit:
diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
index 87d0817f9e4ca0..fce8e432558bc3 100644
--- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp
+++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
@@ -71,8 +71,8 @@ class TestAttrAccess : public AttributeAccessInterface
// Register for the Test Cluster cluster on all endpoints.
TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), TestCluster::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
private:
CHIP_ERROR ReadListInt8uAttribute(AttributeValueEncoder & aEncoder);
@@ -106,7 +106,7 @@ SimpleEnum gSimpleEnums[kAttributeListLength];
size_t gSimpleEnumCount = 0;
Structs::NullablesAndOptionalsStruct::Type gNullablesAndOptionalsStruct;
-CHIP_ERROR TestAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
+CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
{
@@ -148,7 +148,7 @@ CHIP_ERROR TestAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttri
return CHIP_NO_ERROR;
}
-CHIP_ERROR TestAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
+CHIP_ERROR TestAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
switch (aPath.mAttributeId)
{
diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
index 2c91ff512bd186..8e5ff031f72d16 100644
--- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
+++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
@@ -46,13 +46,12 @@ class ThreadDiagosticsAttrAccess : public AttributeAccessInterface
// Register for the ThreadNetworkDiagnostics cluster on all endpoints.
ThreadDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), ThreadNetworkDiagnostics::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
};
ThreadDiagosticsAttrAccess gAttrAccess;
-CHIP_ERROR ThreadDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR ThreadDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != ThreadNetworkDiagnostics::Id)
{
diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
index 974e33c5b992fa..8a68136829faa6 100644
--- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
+++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp
@@ -46,7 +46,7 @@ class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface
// Register for the Time Format Localization cluster on all endpoints.
TimeFormatLocalizationAttrAccess() : AttributeAccessInterface(Optional::Missing(), TimeFormatLocalization::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder);
@@ -78,8 +78,7 @@ CHIP_ERROR TimeFormatLocalizationAttrAccess::ReadSupportedCalendarTypes(Attribut
return err;
}
-CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == TimeFormatLocalization::Id);
diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp
index 307a0c4ddbe139..311eb8027c10b0 100644
--- a/src/app/clusters/user-label-server/user-label-server.cpp
+++ b/src/app/clusters/user-label-server/user-label-server.cpp
@@ -44,8 +44,8 @@ class UserLabelAttrAccess : public AttributeAccessInterface
// Register for the User Label cluster on all endpoints.
UserLabelAttrAccess() : AttributeAccessInterface(Optional::Missing(), UserLabel::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
- CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
private:
CHIP_ERROR ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder);
@@ -96,8 +96,7 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(EndpointId endpoint, AttributeVal
return DeviceLayer::PlatformMgr().SetUserLabelList(endpoint, labelList);
}
-CHIP_ERROR UserLabelAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR UserLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
VerifyOrDie(aPath.mClusterId == UserLabel::Id);
@@ -111,8 +110,7 @@ CHIP_ERROR UserLabelAttrAccess::Read(FabricIndex fabricIndex, const ConcreteRead
return CHIP_NO_ERROR;
}
-CHIP_ERROR UserLabelAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath,
- AttributeValueDecoder & aDecoder)
+CHIP_ERROR UserLabelAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
{
VerifyOrDie(aPath.mClusterId == UserLabel::Id);
diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp
index 45e8980a4ee469..658430cc873c1b 100644
--- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp
+++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp
@@ -93,8 +93,7 @@ class WakeOnLanAttrAccess : public app::AttributeAccessInterface
public:
WakeOnLanAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::WakeOnLan::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
private:
CHIP_ERROR ReadMacAddressAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
@@ -102,8 +101,7 @@ class WakeOnLanAttrAccess : public app::AttributeAccessInterface
WakeOnLanAttrAccess gWakeOnLanAttrAccess;
-CHIP_ERROR WakeOnLanAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath,
- app::AttributeValueEncoder & aEncoder)
+CHIP_ERROR WakeOnLanAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder)
{
EndpointId endpoint = aPath.mEndpointId;
Delegate * delegate = GetDelegate(endpoint);
diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
index 6a7704ed6a4953..6149efe26b8f72 100644
--- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
+++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
@@ -44,7 +44,7 @@ class WiFiDiagosticsAttrAccess : public AttributeAccessInterface
// Register for the WiFiNetworkDiagnostics cluster on all endpoints.
WiFiDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), WiFiNetworkDiagnostics::Id) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
private:
template
@@ -91,8 +91,7 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::ReadWiFiBssId(AttributeValueEncoder & aEnco
WiFiDiagosticsAttrAccess gAttrAccess;
-CHIP_ERROR WiFiDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR WiFiDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
if (aPath.mClusterId != WiFiNetworkDiagnostics::Id)
{
diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp
index 61fdb72285c2f3..a732e3513ab486 100644
--- a/src/app/util/attribute-storage.cpp
+++ b/src/app/util/attribute-storage.cpp
@@ -702,35 +702,17 @@ const EmberAfCluster * emberAfFindClusterInType(const EmberAfEndpointType * endp
return NULL;
}
-uint8_t emberAfClusterIndexInMatchingEndpoints(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask)
-{
- uint8_t ep;
- uint8_t index = 0xFF;
- for (ep = 0; ep < emberAfEndpointCount(); ep++)
- {
- const EmberAfEndpointType * endpointType = emAfEndpoints[ep].endpointType;
- if (emberAfFindClusterInType(endpointType, clusterId, mask) != NULL)
- {
- index++;
- if (emAfEndpoints[ep].endpoint == endpoint)
- {
- return index;
- }
- }
- }
- return 0xFF;
-}
-
uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask)
{
- uint8_t ep;
- uint8_t index = 0xFF;
- for (ep = 0; ep < emberAfEndpointCount(); ep++)
+ for (uint8_t ep = 0; ep < emberAfEndpointCount(); ep++)
{
- const EmberAfEndpointType * endpointType = emAfEndpoints[ep].endpointType;
- if (emberAfFindClusterInType(endpointType, clusterId, mask, &index) != NULL)
+ // Check the endpoint id first, because that way we avoid examining the
+ // endpoint type for endpoints that are not actually defined.
+ if (emAfEndpoints[ep].endpoint == endpoint)
{
- if (emAfEndpoints[ep].endpoint == endpoint)
+ const EmberAfEndpointType * endpointType = emAfEndpoints[ep].endpointType;
+ uint8_t index = 0xFF;
+ if (emberAfFindClusterInType(endpointType, clusterId, mask, &index) != NULL)
{
return index;
}
diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h
index 6a4e4d079a4ab1..1dcfbb5a9db4ea 100644
--- a/src/app/util/attribute-storage.h
+++ b/src/app/util/attribute-storage.h
@@ -145,20 +145,6 @@ const EmberAfEndpointType * emberAfFindEndpointType(chip::EndpointId endpointId)
const EmberAfCluster * emberAfFindClusterInType(const EmberAfEndpointType * endpointType, chip::ClusterId clusterId,
EmberAfClusterMask mask, uint8_t * index = nullptr);
-// For a given cluster and mask, retrieves the list of endpoints sorted by endpoint that contain the matching cluster and returns
-// the index within that list that matches the given endpoint.
-//
-// Mask is either CLUSTER_MASK_CLIENT or CLUSTER_MASK_SERVER
-// For example, if you have 3 endpoints, 10, 11, 12, and cluster X server is
-// located on 11 and 12, and cluster Y server is located only on 10 then
-// clusterIndex(X,11,CLUSTER_MASK_SERVER) returns 0,
-// clusterIndex(X,12,CLUSTER_MASK_SERVER) returns 1,
-// clusterIndex(X,10,CLUSTER_MASK_SERVER) returns 0xFF
-// clusterIndex(Y,10,CLUSTER_MASK_SERVER) returns 0
-// clusterIndex(Y,11,CLUSTER_MASK_SERVER) returns 0xFF
-// clusterIndex(Y,12,CLUSTER_MASK_SERVER) returns 0xFF
-uint8_t emberAfClusterIndexInMatchingEndpoints(chip::EndpointId endpoint, chip::ClusterId clusterId, EmberAfClusterMask mask);
-
//
// Given a cluster ID, endpoint ID and a cluster mask, finds a matching cluster within that endpoint
// with a matching mask. If one is found, the relative index of that cluster within the list of clusters on that
@@ -239,6 +225,8 @@ void emberAfClusterMessageSentCallback(const chip::MessageSendDestination & dest
// returns true if the mask matches a passed interval
bool emberAfCheckTick(EmberAfClusterMask mask, uint8_t passedMask);
+// Check whether there is an endpoint defined with the given endpoint id that is
+// enabled.
bool emberAfEndpointIsEnabled(chip::EndpointId endpoint);
// Note the difference in implementation from emberAfGetNthCluster().
diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp
index 6b720cc77265c6..f2b39780d5e003 100644
--- a/src/app/util/ember-compatibility-functions.cpp
+++ b/src/app/util/ember-compatibility-functions.cpp
@@ -340,11 +340,10 @@ class GlobalAttributeReader : public MandatoryGlobalAttributeReader
public:
GlobalAttributeReader(const EmberAfCluster * aCluster) : MandatoryGlobalAttributeReader(aCluster) {}
- CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
+ CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
};
-CHIP_ERROR GlobalAttributeReader::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath,
- AttributeValueEncoder & aEncoder)
+CHIP_ERROR GlobalAttributeReader::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
using namespace Clusters::Globals::Attributes;
// The id of the attributes below is not in the attribute metadata.
@@ -407,7 +406,7 @@ CHIP_ERROR ReadViaAccessInterface(FabricIndex aAccessingFabricIndex, bool aIsFab
DataVersion version = kUndefinedDataVersion;
ReturnErrorOnFailure(ReadClusterDataVersion(aPath.mEndpointId, aPath.mClusterId, version));
AttributeValueEncoder valueEncoder(aAttributeReports, aAccessingFabricIndex, aPath, version, aIsFabricFiltered, state);
- CHIP_ERROR err = aAccessInterface->Read(aAccessingFabricIndex, aPath, valueEncoder);
+ CHIP_ERROR err = aAccessInterface->Read(aPath, valueEncoder);
if (err != CHIP_NO_ERROR)
{
@@ -952,7 +951,7 @@ CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor,
if (auto * attrOverride = findAttributeAccessOverride(aClusterInfo.mEndpointId, aClusterInfo.mClusterId))
{
AttributeValueDecoder valueDecoder(aReader, aSubjectDescriptor);
- ReturnErrorOnFailure(attrOverride->Write(aSubjectDescriptor.fabricIndex, aPath, valueDecoder));
+ ReturnErrorOnFailure(attrOverride->Write(aPath, valueDecoder));
if (valueDecoder.TriedDecode())
{
diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp
index cd51c4f027ab26..9cb0fa6a172cce 100644
--- a/src/app/util/mock/attribute-storage.cpp
+++ b/src/app/util/mock/attribute-storage.cpp
@@ -212,6 +212,11 @@ uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
return UINT8_MAX;
}
+bool emberAfEndpointIndexIsEnabled(uint16_t index)
+{
+ return index < ArraySize(endpoints);
+}
+
// This duplication of basic utilities is really unfortunate, but we can't link
// to the normal attribute-storage.cpp because we redefine some of its symbols
// above.
diff --git a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml
index 16d96e1c1e9a90..1ff6f383c5b3a7 100644
--- a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml
@@ -24,14 +24,15 @@ limitations under the License.
true
true
This cluster provides information about an application running on a TV or media player device which is represented as an endpoint.
- vendor name
- vendor id
- application name
- product id
- application app
- application status
- application version
- allowed vendor list
+ vendor name
+ vendor id
+ application name
+ product id
+ application app
+ application status
+ application version
+ allowed vendor list
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml
index 14ee57f72f0110..5a7257ed735478 100644
--- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml
@@ -25,23 +25,23 @@ limitations under the License.
true
This cluster provides an interface for launching content on a media player device such as a TV or Speaker.
- application launcher list
- application launcher app
+ application launcher list
+ application launcher app
Upon receipt, this SHALL launch the specified app with optional data. The TV Device SHALL launch and bring to foreground the identified application in the command if the application is not already launched and in foreground. The TV Device SHALL update state attribute on the Application Basic cluster of the Endpoint corresponding to the launched application. This command returns a Launch Response.
-
-
+
+
Upon receipt on a Video Player endpoint this SHALL stop the specified application if it is running.
-
+
Upon receipt on a Video Player endpoint this SHALL hide the specified application if it is running and visible.
-
+
@@ -55,7 +55,7 @@ limitations under the License.
-
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml
index 27f92dbb34554d..a385a0836739dc 100644
--- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml
@@ -25,8 +25,8 @@ limitations under the License.
true
This cluster provides an interface for controlling the Output on a media device such as a TV.
- audio output list
- current audio output
+ audio output list
+ current audio output
Upon receipt, this SHALL change the output on the media device to the output at a specific index in the Output List.
diff --git a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml
index 66d3cf33f5f6f3..b7023d15ceb2b4 100644
--- a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml
@@ -16,22 +16,27 @@ limitations under the License.
-->
-
-
-
-
-
-
-
-
-
General
Binding
0x001e
BINDING_CLUSTER
+ true
+ true
The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table.
- binding list
+
+ Add a binding
+
+
+
+
+
+
+ Remove a binding
+
+
+
+
+
-
-
+
\ No newline at end of file
diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml
index b5284916f1e0d5..c3fdd78244732f 100644
--- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml
@@ -25,9 +25,9 @@ limitations under the License.
true
This cluster provides an interface for controlling the current Channel on a device.
- channel list
- channel lineup
- current channel
+ channel list
+ channel lineup
+ current channel
Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument.
@@ -48,25 +48,25 @@ limitations under the License.
Upon receipt, this SHALL display the active status of the input list on screen.
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
@@ -84,7 +84,7 @@ limitations under the License.
-
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml
index d42d97d0622b9b..69b5f117abbcfb 100644
--- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml
@@ -26,27 +26,27 @@ limitations under the License.
This cluster provides an interface for launching content on a media player device such as a TV or Speaker.
- accept header list
- supported streaming protocols
+ accept header list
+ supported streaming protocols
Upon receipt, this SHALL launch the specified content with optional search criteria.
-
-
+
+
Upon receipt, this SHALL launch content from the specified URL.
-
-
+
+
This command SHALL be generated in response to LaunchContent command.
-
+
@@ -77,19 +77,19 @@ limitations under the License.
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -121,7 +121,7 @@ limitations under the License.
-
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
index f4a3962e9ac8d2..3b6ae576ef1135 100644
--- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml
@@ -25,8 +25,8 @@ limitations under the License.
true
This cluster provides an interface for controlling the Input Selector on a media device such as a TV.
- media input list
- current media input
+ media input list
+ current media input
Upon receipt, this SHALL change the input on the media device to the input at a specific index in the Input List.
diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml
index e9b4dde1249ef6..89b15795c054ce 100644
--- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml
@@ -26,13 +26,13 @@ limitations under the License.
This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker.
- playback state
- start time
- duration
- position
- playback speed
- seek range end
- seek range start
+ playback state
+ start time
+ duration
+ position
+ playback speed
+ seek range end
+ seek range start
@@ -47,37 +47,37 @@ limitations under the License.
Upon receipt, this SHALL stop media. User experience is context-specific. This will often navigate the user back to the location where media was originally launched.
-
+
Upon receipt, this SHALL Start Over with the current media playback item.
-
+
Upon receipt, this SHALL cause the handler to be invoked for "Previous". User experience is context-specific. This will often Go back to the previous media playback item.
-
+
Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item.
-
+
Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc).
-
+
Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc).
-
+
Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows:
-
+
Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows:
-
+
Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows:
@@ -92,7 +92,7 @@ limitations under the License.
-
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml
index 49bcfe104bfc3d..ef2729608a6044 100644
--- a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml
@@ -25,19 +25,19 @@ limitations under the License.
true
This cluster provides an interface for UX navigation within a set of targets on a device or endpoint.
- target navigator list
- current navigator target
+ target navigator list
+ current navigator target
Upon receipt, this SHALL navigation the UX to the target identified.
-
+
This command SHALL be generated in response to NavigateTarget commands.
-
+
diff --git a/src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml
index 903799c69c539c..a608b291a1ee13 100644
--- a/src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml
@@ -24,6 +24,6 @@ limitations under the License.
true
true
This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol.
- wake on lan mac address
+ wake on lan mac address
\ No newline at end of file
diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp
index 1e4fb605f75dc5..7fc59e44864572 100644
--- a/src/controller/CHIPDeviceController.cpp
+++ b/src/controller/CHIPDeviceController.cpp
@@ -932,6 +932,19 @@ CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningPa
return CHIP_NO_ERROR;
}
+CHIP_ERROR DeviceCommissioner::GetAttestationChallenge(ByteSpan & attestationChallenge)
+{
+ Optional secureSessionHandle;
+
+ VerifyOrReturnError(mDeviceBeingCommissioned != nullptr, CHIP_ERROR_INCORRECT_STATE);
+
+ secureSessionHandle = mDeviceBeingCommissioned->GetSecureSession();
+ VerifyOrReturnError(secureSessionHandle.HasValue(), CHIP_ERROR_INCORRECT_STATE);
+
+ attestationChallenge = secureSessionHandle.Value()->AsSecureSession()->GetCryptoContext().GetAttestationChallenge();
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR DeviceCommissioner::StopPairing(NodeId remoteDeviceId)
{
VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE);
diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h
index 81170a48df4376..f05ba0a840bd98 100644
--- a/src/controller/CHIPDeviceController.h
+++ b/src/controller/CHIPDeviceController.h
@@ -531,6 +531,16 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
CHIP_ERROR GetConnectedDevice(NodeId deviceId, chip::Callback::Callback * onConnection,
chip::Callback::Callback * onFailure) override;
+ /**
+ * @brief
+ * This function returns the attestation challenge for the secure session of the device being commissioned.
+ *
+ * @param[out] attestationChallenge The output for the attestationChallenge
+ *
+ * @return CHIP_ERROR CHIP_NO_ERROR on success, or CHIP_ERROR_INVALID_ARGUMENT if no secure session is active
+ */
+ CHIP_ERROR GetAttestationChallenge(ByteSpan & attestationChallenge);
+
/**
* @brief
* This function stops a pairing process that's in progress. It does not delete the pairing of a previously
diff --git a/src/controller/ExampleOperationalCredentialsIssuer.cpp b/src/controller/ExampleOperationalCredentialsIssuer.cpp
index ff94a229009d1f..19db629fb5c803 100644
--- a/src/controller/ExampleOperationalCredentialsIssuer.cpp
+++ b/src/controller/ExampleOperationalCredentialsIssuer.cpp
@@ -52,10 +52,10 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele
ReturnErrorOnFailure(ASN1ToChipEpochTime(effectiveTime, mNow));
Crypto::P256SerializedKeypair serializedKey;
- uint16_t keySize = static_cast(sizeof(serializedKey));
+ uint16_t keySize = static_cast(serializedKey.Capacity());
PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIssuerKeypairStorage, key,
- err = storage.SyncGetKeyValue(key, &serializedKey, keySize));
+ err = storage.SyncGetKeyValue(key, serializedKey.Bytes(), keySize));
serializedKey.SetLength(keySize);
if (err != CHIP_NO_ERROR)
@@ -65,10 +65,10 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele
ReturnErrorOnFailure(mIssuer.Initialize());
ReturnErrorOnFailure(mIssuer.Serialize(serializedKey));
- keySize = static_cast(sizeof(serializedKey));
+ keySize = static_cast(serializedKey.Capacity());
PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIssuerKeypairStorage, key,
- ReturnErrorOnFailure(storage.SyncSetKeyValue(key, &serializedKey, keySize)));
+ ReturnErrorOnFailure(storage.SyncSetKeyValue(key, serializedKey.Bytes(), keySize)));
}
else
{
@@ -76,10 +76,10 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele
ReturnErrorOnFailure(mIssuer.Deserialize(serializedKey));
}
- keySize = static_cast(sizeof(serializedKey));
+ keySize = static_cast(serializedKey.Capacity());
PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIntermediateIssuerKeypairStorage, key,
- err = storage.SyncGetKeyValue(key, &serializedKey, keySize));
+ err = storage.SyncGetKeyValue(key, serializedKey.Bytes(), keySize));
serializedKey.SetLength(keySize);
if (err != CHIP_NO_ERROR)
@@ -90,10 +90,10 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele
ReturnErrorOnFailure(mIntermediateIssuer.Initialize());
ReturnErrorOnFailure(mIntermediateIssuer.Serialize(serializedKey));
- keySize = static_cast(sizeof(serializedKey));
+ keySize = static_cast(serializedKey.Capacity());
PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIntermediateIssuerKeypairStorage, key,
- ReturnErrorOnFailure(storage.SyncSetKeyValue(key, &serializedKey, keySize)));
+ ReturnErrorOnFailure(storage.SyncSetKeyValue(key, serializedKey.Bytes(), keySize)));
}
else
{
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 9db8a7056202b5..fd543624842f09 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -178,7 +178,7 @@ client cluster ApplicationLauncher = 1292 {
struct ApplicationEP {
Application application = 0;
- CHAR_STRING endpoint = 1;
+ optional ENDPOINT_NO endpoint = 1;
}
struct Application {
@@ -187,7 +187,7 @@ client cluster ApplicationLauncher = 1292 {
}
readonly attribute INT16U applicationLauncherList[] = 0;
- attribute ApplicationEP applicationLauncherApp = 1;
+ attribute nullable ApplicationEP applicationLauncherApp = 1;
readonly global attribute command_id serverGeneratedCommandList[] = 65528;
readonly global attribute command_id clientGeneratedCommandList[] = 65529;
readonly global attribute attrib_id attributeList[] = 65531;
@@ -199,7 +199,7 @@ client cluster ApplicationLauncher = 1292 {
request struct LaunchAppRequestRequest {
Application application = 0;
- OCTET_STRING data = 1;
+ optional OCTET_STRING data = 1;
}
request struct StopAppRequestRequest {
@@ -325,18 +325,27 @@ client cluster BinaryInputBasic = 15 {
}
client cluster Binding = 30 {
- struct BindingEntry {
+ readonly global attribute command_id serverGeneratedCommandList[] = 65528;
+ readonly global attribute command_id clientGeneratedCommandList[] = 65529;
+ readonly global attribute attrib_id attributeList[] = 65531;
+ readonly global attribute int16u clusterRevision = 65533;
+
+ request struct BindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}
- attribute BindingEntry bindingList[] = 0;
- readonly global attribute command_id serverGeneratedCommandList[] = 65528;
- readonly global attribute command_id clientGeneratedCommandList[] = 65529;
- readonly global attribute attrib_id attributeList[] = 65531;
- readonly global attribute int16u clusterRevision = 65533;
+ request struct UnbindRequest {
+ NODE_ID nodeId = 0;
+ GROUP_ID groupId = 1;
+ ENDPOINT_NO endpointId = 2;
+ CLUSTER_ID clusterId = 3;
+ }
+
+ command Bind(BindRequest): DefaultSuccess = 0;
+ command Unbind(UnbindRequest): DefaultSuccess = 1;
}
client cluster BooleanState = 69 {
@@ -559,21 +568,21 @@ client cluster Channel = 1284 {
struct ChannelInfo {
INT16U majorNumber = 0;
INT16U minorNumber = 1;
- CHAR_STRING<32> name = 2;
- CHAR_STRING<32> callSign = 3;
- CHAR_STRING<32> affiliateCallSign = 4;
+ optional CHAR_STRING<32> name = 2;
+ optional CHAR_STRING<32> callSign = 3;
+ optional CHAR_STRING<32> affiliateCallSign = 4;
}
struct LineupInfo {
CHAR_STRING operatorName = 0;
- CHAR_STRING lineupName = 1;
- CHAR_STRING postalCode = 2;
+ optional CHAR_STRING lineupName = 1;
+ optional CHAR_STRING postalCode = 2;
LineupInfoTypeEnum lineupInfoType = 3;
}
readonly attribute ChannelInfo channelList[] = 0;
- attribute LineupInfo channelLineup = 1;
- attribute ChannelInfo currentChannel = 2;
+ readonly attribute nullable LineupInfo channelLineup = 1;
+ readonly attribute nullable ChannelInfo currentChannel = 2;
readonly global attribute command_id serverGeneratedCommandList[] = 65528;
readonly global attribute command_id clientGeneratedCommandList[] = 65529;
readonly global attribute attrib_id attributeList[] = 65531;
@@ -935,7 +944,7 @@ client cluster ContentLauncher = 1290 {
struct Parameter {
ParameterEnum type = 0;
CHAR_STRING value = 1;
- AdditionalInfo externalIDList[] = 2;
+ optional AdditionalInfo externalIDList[] = 2;
}
struct AdditionalInfo {
@@ -945,17 +954,17 @@ client cluster ContentLauncher = 1290 {
struct BrandingInformation {
CHAR_STRING providerName = 0;
- StyleInformation background = 1;
- StyleInformation logo = 2;
- StyleInformation progressBar = 3;
- StyleInformation splash = 4;
- StyleInformation waterMark = 5;
+ optional StyleInformation background = 1;
+ optional StyleInformation logo = 2;
+ optional StyleInformation progressBar = 3;
+ optional StyleInformation splash = 4;
+ optional StyleInformation waterMark = 5;
}
struct StyleInformation {
- CHAR_STRING imageUrl = 0;
- CHAR_STRING color = 1;
- Dimension size = 2;
+ optional CHAR_STRING imageUrl = 0;
+ optional CHAR_STRING color = 1;
+ optional Dimension size = 2;
}
struct Dimension {
@@ -972,20 +981,20 @@ client cluster ContentLauncher = 1290 {
readonly global attribute int16u clusterRevision = 65533;
request struct LaunchContentRequestRequest {
- BOOLEAN autoPlay = 0;
- CHAR_STRING data = 1;
- ContentSearch search[] = 2;
+ ContentSearch search[] = 0;
+ BOOLEAN autoPlay = 1;
+ optional CHAR_STRING data = 2;
}
request struct LaunchURLRequestRequest {
CHAR_STRING contentURL = 0;
- CHAR_STRING displayString = 1;
- BrandingInformation brandingInformation = 2;
+ optional CHAR_STRING displayString = 1;
+ optional BrandingInformation brandingInformation = 2;
}
response struct LaunchResponse {
StatusEnum status = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
command LaunchContentRequest(LaunchContentRequestRequest): LaunchResponse = 0;
@@ -2299,16 +2308,16 @@ client cluster MediaPlayback = 1286 {
struct PlaybackPosition {
INT64U updatedAt = 0;
- INT64U position = 1;
+ nullable INT64U position = 1;
}
readonly attribute PlaybackStateEnum playbackState = 0;
- readonly attribute epoch_us startTime = 1;
- readonly attribute int64u duration = 2;
- attribute PlaybackPosition position = 3;
+ readonly attribute nullable epoch_us startTime = 1;
+ readonly attribute nullable int64u duration = 2;
+ readonly attribute PlaybackPosition position = 3;
readonly attribute single playbackSpeed = 4;
- readonly attribute int64u seekRangeEnd = 5;
- readonly attribute int64u seekRangeStart = 6;
+ readonly attribute nullable int64u seekRangeEnd = 5;
+ readonly attribute nullable int64u seekRangeStart = 6;
readonly global attribute command_id serverGeneratedCommandList[] = 65528;
readonly global attribute command_id clientGeneratedCommandList[] = 65529;
readonly global attribute attrib_id attributeList[] = 65531;
@@ -3226,12 +3235,12 @@ client cluster TargetNavigator = 1285 {
request struct NavigateTargetRequestRequest {
INT8U target = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
response struct NavigateTargetResponse {
StatusEnum status = 0;
- CHAR_STRING data = 1;
+ optional CHAR_STRING data = 1;
}
command NavigateTargetRequest(NavigateTargetRequestRequest): NavigateTargetResponse = 0;
diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap
index 01203314f00425..d7583dabb2d8e5 100644
--- a/src/controller/data_model/controller-clusters.zap
+++ b/src/controller/data_model/controller-clusters.zap
@@ -1935,6 +1935,24 @@
"define": "BINDING_CLUSTER",
"side": "client",
"enabled": 1,
+ "commands": [
+ {
+ "name": "Bind",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "Unbind",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "ClusterRevision",
@@ -1962,21 +1980,6 @@
"enabled": 0,
"commands": [],
"attributes": [
- {
- "name": "binding list",
- "code": 0,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "ServerGeneratedCommandList",
"code": 65528,
@@ -17945,4 +17948,4 @@
}
],
"log": []
-}
+}
\ No newline at end of file
diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp
index 73849bd74ce3d4..09a79d386677cf 100644
--- a/src/controller/java/CHIPDeviceController-JNI.cpp
+++ b/src/controller/java/CHIPDeviceController-JNI.cpp
@@ -572,6 +572,37 @@ JNI_METHOD(jboolean, openPairingWindowWithPIN)
return true;
}
+JNI_METHOD(jbyteArray, getAttestationChallenge)
+(JNIEnv * env, jobject self, jlong handle, jlong devicePtr)
+{
+ chip::DeviceLayer::StackLock lock;
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ ByteSpan attestationChallenge;
+ jbyteArray attestationChallengeJbytes = nullptr;
+
+ DeviceProxy * chipDevice = reinterpret_cast(devicePtr);
+ if (chipDevice == nullptr)
+ {
+ ChipLogProgress(Controller, "Could not cast device pointer to Device object");
+ JniReferences::GetInstance().ThrowError(env, sChipDeviceControllerExceptionCls, CHIP_ERROR_INCORRECT_STATE);
+ }
+
+ AndroidDeviceControllerWrapper * wrapper = AndroidDeviceControllerWrapper::FromJNIHandle(handle);
+ err = wrapper->Controller()->GetAttestationChallenge(attestationChallenge);
+ SuccessOrExit(err);
+
+ err = JniReferences::GetInstance().N2J_ByteArray(env, attestationChallenge.data(), sizeof(attestationChallenge.data()),
+ attestationChallengeJbytes);
+ SuccessOrExit(err);
+
+exit:
+ if (err != CHIP_NO_ERROR)
+ {
+ JniReferences::GetInstance().ThrowError(env, sChipDeviceControllerExceptionCls, err);
+ }
+ return attestationChallengeJbytes;
+}
+
JNI_METHOD(void, deleteDeviceController)(JNIEnv * env, jobject self, jlong handle)
{
chip::DeviceLayer::StackLock lock;
diff --git a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java
index 1e47838e2df2e7..ef36c3e8e91b44 100644
--- a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java
+++ b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java
@@ -300,6 +300,17 @@ public void shutdownSubscriptions(long devicePtr) {
shutdownSubscriptions(deviceControllerPtr, devicePtr);
}
+ /**
+ * Returns an attestation challenge for the given device, for which there must be an existing
+ * secure session.
+ *
+ * @param devicePtr a pointer to the device from which to retrieve the challenge
+ * @throws ChipDeviceControllerException if there is no secure session for the given device
+ */
+ public byte[] getAttestationChallenge(long devicePtr) {
+ return getAttestationChallenge(deviceControllerPtr, devicePtr);
+ }
+
/** Subscribe to the given attribute path. */
public void subscribeToPath(
SubscriptionEstablishedCallback subscriptionEstablishedCallback,
@@ -417,6 +428,8 @@ private native boolean openPairingWindowWithPIN(
private native boolean isActive(long deviceControllerPtr, long deviceId);
+ private native byte[] getAttestationChallenge(long deviceControllerPtr, long devicePtr);
+
private native void shutdownSubscriptions(long deviceControllerPtr, long devicePtr);
static {
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index 9495f2414bc45e..ddf62dcc25bddb 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -857,56 +857,75 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- jobject value_application;
- jobject value_application_catalogVendorId;
- std::string value_application_catalogVendorIdClassName = "java/lang/Integer";
- std::string value_application_catalogVendorIdCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(
- value_application_catalogVendorIdClassName.c_str(), value_application_catalogVendorIdCtorSignature.c_str(),
- cppValue.application.catalogVendorId, value_application_catalogVendorId);
- jobject value_application_applicationId;
- value_application_applicationId = env->NewStringUTF(
- std::string(cppValue.application.applicationId.data(), cppValue.application.applicationId.size()).c_str());
-
- jclass applicationStructClass;
- err = chip::JniReferences::GetInstance().GetClassRef(
- env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication", applicationStructClass);
- if (err != CHIP_NO_ERROR)
+ if (cppValue.IsNull())
{
- ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplication");
- return nullptr;
+ value = nullptr;
}
- jmethodID applicationStructCtor =
- env->GetMethodID(applicationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V");
- if (applicationStructCtor == nullptr)
+ else
{
- ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplication constructor");
- return nullptr;
- }
+ jobject value_application;
+ jobject value_application_catalogVendorId;
+ std::string value_application_catalogVendorIdClassName = "java/lang/Integer";
+ std::string value_application_catalogVendorIdCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ value_application_catalogVendorIdClassName.c_str(), value_application_catalogVendorIdCtorSignature.c_str(),
+ cppValue.Value().application.catalogVendorId, value_application_catalogVendorId);
+ jobject value_application_applicationId;
+ value_application_applicationId = env->NewStringUTF(std::string(cppValue.Value().application.applicationId.data(),
+ cppValue.Value().application.applicationId.size())
+ .c_str());
+
+ jclass applicationStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication", applicationStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplication");
+ return nullptr;
+ }
+ jmethodID applicationStructCtor =
+ env->GetMethodID(applicationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V");
+ if (applicationStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplication constructor");
+ return nullptr;
+ }
- value_application = env->NewObject(applicationStructClass, applicationStructCtor, value_application_catalogVendorId,
- value_application_applicationId);
- jobject value_endpoint;
- value_endpoint = env->NewStringUTF(std::string(cppValue.endpoint.data(), cppValue.endpoint.size()).c_str());
+ value_application = env->NewObject(applicationStructClass, applicationStructCtor, value_application_catalogVendorId,
+ value_application_applicationId);
+ jobject value_endpoint;
+ if (!cppValue.Value().endpoint.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_endpoint);
+ }
+ else
+ {
+ std::string value_endpointClassName = "java/lang/Integer";
+ std::string value_endpointCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ value_endpointClassName.c_str(), value_endpointCtorSignature.c_str(), cppValue.Value().endpoint.Value(),
+ value_endpoint);
+ }
- jclass applicationEPStructClass;
- err = chip::JniReferences::GetInstance().GetClassRef(
- env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEP", applicationEPStructClass);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEP");
- return nullptr;
- }
- jmethodID applicationEPStructCtor =
- env->GetMethodID(applicationEPStructClass, "",
- "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication;Ljava/lang/String;)V");
- if (applicationEPStructCtor == nullptr)
- {
- ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEP constructor");
- return nullptr;
- }
+ jclass applicationEPStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEP", applicationEPStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEP");
+ return nullptr;
+ }
+ jmethodID applicationEPStructCtor = env->GetMethodID(
+ applicationEPStructClass, "",
+ "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication;Ljava/util/Optional;)V");
+ if (applicationEPStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEP constructor");
+ return nullptr;
+ }
- value = env->NewObject(applicationEPStructClass, applicationEPStructCtor, value_application, value_endpoint);
+ value = env->NewObject(applicationEPStructClass, applicationEPStructCtor, value_application, value_endpoint);
+ }
return value;
}
case Attributes::ServerGeneratedCommandList::Id: {
@@ -1816,69 +1835,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
using namespace app::Clusters::Binding;
switch (aPath.mAttributeId)
{
- case Attributes::BindingList::Id: {
- using TypeInfo = Attributes::BindingList::TypeInfo;
- TypeInfo::DecodableType cppValue;
- *aError = app::DataModel::Decode(aReader, cppValue);
- if (*aError != CHIP_NO_ERROR)
- {
- return nullptr;
- }
- jobject value;
- chip::JniReferences::GetInstance().CreateArrayList(value);
-
- auto iter_value_0 = cppValue.begin();
- while (iter_value_0.Next())
- {
- auto & entry_0 = iter_value_0.GetValue();
- jobject newElement_0;
- jobject newElement_0_nodeId;
- std::string newElement_0_nodeIdClassName = "java/lang/Long";
- std::string newElement_0_nodeIdCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_nodeIdClassName.c_str(),
- newElement_0_nodeIdCtorSignature.c_str(),
- entry_0.nodeId, newElement_0_nodeId);
- jobject newElement_0_groupId;
- std::string newElement_0_groupIdClassName = "java/lang/Integer";
- std::string newElement_0_groupIdCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(),
- newElement_0_groupIdCtorSignature.c_str(),
- entry_0.groupId, newElement_0_groupId);
- jobject newElement_0_endpointId;
- std::string newElement_0_endpointIdClassName = "java/lang/Integer";
- std::string newElement_0_endpointIdCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endpointIdClassName.c_str(),
- newElement_0_endpointIdCtorSignature.c_str(),
- entry_0.endpointId, newElement_0_endpointId);
- jobject newElement_0_clusterId;
- std::string newElement_0_clusterIdClassName = "java/lang/Long";
- std::string newElement_0_clusterIdCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_clusterIdClassName.c_str(),
- newElement_0_clusterIdCtorSignature.c_str(),
- entry_0.clusterId, newElement_0_clusterId);
-
- jclass bindingEntryStructClass;
- err = chip::JniReferences::GetInstance().GetClassRef(
- env, "chip/devicecontroller/ChipStructs$BindingClusterBindingEntry", bindingEntryStructClass);
- if (err != CHIP_NO_ERROR)
- {
- ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterBindingEntry");
- return nullptr;
- }
- jmethodID bindingEntryStructCtor = env->GetMethodID(
- bindingEntryStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;)V");
- if (bindingEntryStructCtor == nullptr)
- {
- ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterBindingEntry constructor");
- return nullptr;
- }
-
- newElement_0 = env->NewObject(bindingEntryStructClass, bindingEntryStructCtor, newElement_0_nodeId,
- newElement_0_groupId, newElement_0_endpointId, newElement_0_clusterId);
- chip::JniReferences::GetInstance().AddToArrayList(value, newElement_0);
- }
- return value;
- }
case Attributes::ServerGeneratedCommandList::Id: {
using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo;
TypeInfo::DecodableType cppValue;
@@ -2647,12 +2603,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
newElement_0_minorNumberCtorSignature.c_str(),
entry_0.minorNumber, newElement_0_minorNumber);
jobject newElement_0_name;
- newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str());
+ if (!entry_0.name.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name);
+ }
+ else
+ {
+ newElement_0_name =
+ env->NewStringUTF(std::string(entry_0.name.Value().data(), entry_0.name.Value().size()).c_str());
+ }
jobject newElement_0_callSign;
- newElement_0_callSign = env->NewStringUTF(std::string(entry_0.callSign.data(), entry_0.callSign.size()).c_str());
+ if (!entry_0.callSign.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_callSign);
+ }
+ else
+ {
+ newElement_0_callSign =
+ env->NewStringUTF(std::string(entry_0.callSign.Value().data(), entry_0.callSign.Value().size()).c_str());
+ }
jobject newElement_0_affiliateCallSign;
- newElement_0_affiliateCallSign =
- env->NewStringUTF(std::string(entry_0.affiliateCallSign.data(), entry_0.affiliateCallSign.size()).c_str());
+ if (!entry_0.affiliateCallSign.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_affiliateCallSign);
+ }
+ else
+ {
+ newElement_0_affiliateCallSign = env->NewStringUTF(
+ std::string(entry_0.affiliateCallSign.Value().data(), entry_0.affiliateCallSign.Value().size()).c_str());
+ }
jclass channelInfoStructClass;
err = chip::JniReferences::GetInstance().GetClassRef(
@@ -2664,7 +2643,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
}
jmethodID channelInfoStructCtor = env->GetMethodID(
channelInfoStructClass, "",
- "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+ "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V");
if (channelInfoStructCtor == nullptr)
{
ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfo constructor");
@@ -2687,37 +2666,64 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- jobject value_operatorName;
- value_operatorName = env->NewStringUTF(std::string(cppValue.operatorName.data(), cppValue.operatorName.size()).c_str());
- jobject value_lineupName;
- value_lineupName = env->NewStringUTF(std::string(cppValue.lineupName.data(), cppValue.lineupName.size()).c_str());
- jobject value_postalCode;
- value_postalCode = env->NewStringUTF(std::string(cppValue.postalCode.data(), cppValue.postalCode.size()).c_str());
- jobject value_lineupInfoType;
- std::string value_lineupInfoTypeClassName = "java/lang/Integer";
- std::string value_lineupInfoTypeCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(
- value_lineupInfoTypeClassName.c_str(), value_lineupInfoTypeCtorSignature.c_str(),
- static_cast(cppValue.lineupInfoType), value_lineupInfoType);
-
- jclass lineupInfoStructClass;
- err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfo",
- lineupInfoStructClass);
- if (err != CHIP_NO_ERROR)
+ if (cppValue.IsNull())
{
- ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfo");
- return nullptr;
+ value = nullptr;
}
- jmethodID lineupInfoStructCtor = env->GetMethodID(
- lineupInfoStructClass, "", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V");
- if (lineupInfoStructCtor == nullptr)
+ else
{
- ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfo constructor");
- return nullptr;
- }
+ jobject value_operatorName;
+ value_operatorName = env->NewStringUTF(
+ std::string(cppValue.Value().operatorName.data(), cppValue.Value().operatorName.size()).c_str());
+ jobject value_lineupName;
+ if (!cppValue.Value().lineupName.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_lineupName);
+ }
+ else
+ {
+ value_lineupName = env->NewStringUTF(
+ std::string(cppValue.Value().lineupName.Value().data(), cppValue.Value().lineupName.Value().size())
+ .c_str());
+ }
+ jobject value_postalCode;
+ if (!cppValue.Value().postalCode.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_postalCode);
+ }
+ else
+ {
+ value_postalCode = env->NewStringUTF(
+ std::string(cppValue.Value().postalCode.Value().data(), cppValue.Value().postalCode.Value().size())
+ .c_str());
+ }
+ jobject value_lineupInfoType;
+ std::string value_lineupInfoTypeClassName = "java/lang/Integer";
+ std::string value_lineupInfoTypeCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(
+ value_lineupInfoTypeClassName.c_str(), value_lineupInfoTypeCtorSignature.c_str(),
+ static_cast(cppValue.Value().lineupInfoType), value_lineupInfoType);
- value = env->NewObject(lineupInfoStructClass, lineupInfoStructCtor, value_operatorName, value_lineupName,
- value_postalCode, value_lineupInfoType);
+ jclass lineupInfoStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfo", lineupInfoStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfo");
+ return nullptr;
+ }
+ jmethodID lineupInfoStructCtor =
+ env->GetMethodID(lineupInfoStructClass, "",
+ "(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V");
+ if (lineupInfoStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfo constructor");
+ return nullptr;
+ }
+
+ value = env->NewObject(lineupInfoStructClass, lineupInfoStructCtor, value_operatorName, value_lineupName,
+ value_postalCode, value_lineupInfoType);
+ }
return value;
}
case Attributes::CurrentChannel::Id: {
@@ -2729,45 +2735,76 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- jobject value_majorNumber;
- std::string value_majorNumberClassName = "java/lang/Integer";
- std::string value_majorNumberCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(value_majorNumberClassName.c_str(),
- value_majorNumberCtorSignature.c_str(),
- cppValue.majorNumber, value_majorNumber);
- jobject value_minorNumber;
- std::string value_minorNumberClassName = "java/lang/Integer";
- std::string value_minorNumberCtorSignature = "(I)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(value_minorNumberClassName.c_str(),
- value_minorNumberCtorSignature.c_str(),
- cppValue.minorNumber, value_minorNumber);
- jobject value_name;
- value_name = env->NewStringUTF(std::string(cppValue.name.data(), cppValue.name.size()).c_str());
- jobject value_callSign;
- value_callSign = env->NewStringUTF(std::string(cppValue.callSign.data(), cppValue.callSign.size()).c_str());
- jobject value_affiliateCallSign;
- value_affiliateCallSign =
- env->NewStringUTF(std::string(cppValue.affiliateCallSign.data(), cppValue.affiliateCallSign.size()).c_str());
-
- jclass channelInfoStructClass;
- err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfo",
- channelInfoStructClass);
- if (err != CHIP_NO_ERROR)
+ if (cppValue.IsNull())
{
- ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo");
- return nullptr;
+ value = nullptr;
}
- jmethodID channelInfoStructCtor =
- env->GetMethodID(channelInfoStructClass, "",
- "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
- if (channelInfoStructCtor == nullptr)
+ else
{
- ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfo constructor");
- return nullptr;
- }
+ jobject value_majorNumber;
+ std::string value_majorNumberClassName = "java/lang/Integer";
+ std::string value_majorNumberCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(value_majorNumberClassName.c_str(),
+ value_majorNumberCtorSignature.c_str(),
+ cppValue.Value().majorNumber, value_majorNumber);
+ jobject value_minorNumber;
+ std::string value_minorNumberClassName = "java/lang/Integer";
+ std::string value_minorNumberCtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(value_minorNumberClassName.c_str(),
+ value_minorNumberCtorSignature.c_str(),
+ cppValue.Value().minorNumber, value_minorNumber);
+ jobject value_name;
+ if (!cppValue.Value().name.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_name);
+ }
+ else
+ {
+ value_name = env->NewStringUTF(
+ std::string(cppValue.Value().name.Value().data(), cppValue.Value().name.Value().size()).c_str());
+ }
+ jobject value_callSign;
+ if (!cppValue.Value().callSign.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_callSign);
+ }
+ else
+ {
+ value_callSign = env->NewStringUTF(
+ std::string(cppValue.Value().callSign.Value().data(), cppValue.Value().callSign.Value().size()).c_str());
+ }
+ jobject value_affiliateCallSign;
+ if (!cppValue.Value().affiliateCallSign.HasValue())
+ {
+ chip::JniReferences::GetInstance().CreateOptional(nullptr, value_affiliateCallSign);
+ }
+ else
+ {
+ value_affiliateCallSign = env->NewStringUTF(std::string(cppValue.Value().affiliateCallSign.Value().data(),
+ cppValue.Value().affiliateCallSign.Value().size())
+ .c_str());
+ }
- value = env->NewObject(channelInfoStructClass, channelInfoStructCtor, value_majorNumber, value_minorNumber, value_name,
- value_callSign, value_affiliateCallSign);
+ jclass channelInfoStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfo", channelInfoStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo");
+ return nullptr;
+ }
+ jmethodID channelInfoStructCtor = env->GetMethodID(
+ channelInfoStructClass, "",
+ "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V");
+ if (channelInfoStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfo constructor");
+ return nullptr;
+ }
+
+ value = env->NewObject(channelInfoStructClass, channelInfoStructCtor, value_majorNumber, value_minorNumber,
+ value_name, value_callSign, value_affiliateCallSign);
+ }
return value;
}
case Attributes::ServerGeneratedCommandList::Id: {
@@ -7476,10 +7513,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Long";
- std::string valueCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Long";
+ std::string valueCtorSignature = "(J)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ cppValue.Value(), value);
+ }
return value;
}
case Attributes::Duration::Id: {
@@ -7491,10 +7535,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Long";
- std::string valueCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Long";
+ std::string valueCtorSignature = "(J)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
+ cppValue.Value(), value);
+ }
return value;
}
case Attributes::Position::Id: {
@@ -7512,10 +7563,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
chip::JniReferences::GetInstance().CreateBoxedObject(
value_updatedAtClassName.c_str(), value_updatedAtCtorSignature.c_str(), cppValue.updatedAt, value_updatedAt);
jobject value_position;
- std::string value_positionClassName = "java/lang/Long";
- std::string value_positionCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(
- value_positionClassName.c_str(), value_positionCtorSignature.c_str(), cppValue.position, value_position);
+ if (cppValue.position.IsNull())
+ {
+ value_position = nullptr;
+ }
+ else
+ {
+ std::string value_positionClassName = "java/lang/Long";
+ std::string value_positionCtorSignature = "(J)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject(value_positionClassName.c_str(),
+ value_positionCtorSignature.c_str(),
+ cppValue.position.Value(), value_position);
+ }
jclass playbackPositionStructClass;
err = chip::JniReferences::GetInstance().GetClassRef(
@@ -7560,10 +7619,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR
return nullptr;
}
jobject value;
- std::string valueClassName = "java/lang/Long";
- std::string valueCtorSignature = "(J)V";
- chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(),
- cppValue, value);
+ if (cppValue.IsNull())
+ {
+ value = nullptr;
+ }
+ else
+ {
+ std::string valueClassName = "java/lang/Long";
+ std::string valueCtorSignature = "(J)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject