diff --git a/.restyled.yaml b/.restyled.yaml index 5d4ba637148bf0..195765b70a34d4 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -72,8 +72,6 @@ exclude: - "scripts/idl/tests/outputs/**/*" # Matches generated output 1:1 - "examples/chef/sample_app_util/test_files/*.yaml" - "examples/chef/zzz_generated/**/*" - - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # https://github.com/project-chip/connectedhomeip/issues/20236 - - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h" # https://github.com/project-chip/connectedhomeip/issues/20236 - "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*" - "integrations/cloudbuild/*.yaml" # uglier long command line content diff --git a/.spellcheck.yml b/.spellcheck.yml index 225ab2ed951c8f..09fc2794be1c94 100644 --- a/.spellcheck.yml +++ b/.spellcheck.yml @@ -61,6 +61,6 @@ matrix: # converts markdown to HTML - pyspelling.filters.markdown: sources: - - '**/*.md|!third_party/**|!examples/common/**/repo/**' + - '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md' aspell: ignore-case: true diff --git a/build/chip/java/rules.gni b/build/chip/java/rules.gni index 059e95c45e9153..166050f27f56db 100644 --- a/build/chip/java/rules.gni +++ b/build/chip/java/rules.gni @@ -114,7 +114,7 @@ template("java_library") { _data_deps = invoker.data_deps } - # Generates a .java file containing all sources to be compiled + # Generates a .sources file containing all sources to be compiled _java_sources_file = "$target_gen_dir/$target_name.sources" if (defined(invoker.java_sources_file)) { _java_sources_file = invoker.java_sources_file @@ -176,6 +176,162 @@ template("java_library") { } } +# Declare a Java executable target +# +# Manifext.txt: contains the given class as the entrypoint about the files packaged in a Java executable target. +# +# sources: List of .java files included in this binary. Mutually exclusive with jar_path. +# +# jar_path: A path to an existing JAR. Mutually exclusive with sources. +# +# output_name: File name for the output binary under root_build_dir/bin. +# +# javac_flags: additional flags to pass to the javac compiler +# +template("java_binary") { + # Figure out the output name + _jar_name = target_name + if (defined(invoker.output_name)) { + _jar_name = invoker.output_name + } else { + _jar_name += ".jar" + } + + _deps = [] + if (defined(invoker.deps)) { + _deps = invoker.deps + } + + # What files will be compiled + _java_files = [] + if (defined(invoker.sources)) { + _java_files = invoker.sources + } + + _is_prebuilt = defined(invoker.jar_path) + + _jar_output = "" + _target_dir_name = get_label_info(":$target_name", "dir") + if (_is_prebuilt) { + assert(_java_files == []) + _jar_output = "$root_out_dir/bin/$_target_dir_name/" + + get_path_info(invoker.jar_path, "name") + ".jar" + } else { + _jar_output = "$root_out_dir/bin/$_target_dir_name/$_jar_name" + } + + # Generate a list containing the expected build_config filepath of every dependency. + _deps_configs = [] + foreach(_dep, _deps) { + _dep_gen_dir = get_label_info(_dep, "target_gen_dir") + _dep_name = get_label_info(_dep, "name") + _dep_config = "$_dep_gen_dir/$_dep_name.json" + _deps_configs += [ _dep_config ] + } + _rebased_deps_configs = rebase_path(_deps_configs, root_build_dir) + + # Create the name for this target's build_config. + _library_target_name = target_name + _build_config = "$target_gen_dir/$_library_target_name.json" + _rebased_build_config = rebase_path(_build_config, root_build_dir) + + # Write the build_config file for this target. + _config_target_name = target_name + "_config" + action(_config_target_name) { + script = write_build_config + + deps = _deps + + outputs = [ _build_config ] + args = [ + "--jar-path", + rebase_path(_jar_output, root_build_dir), + "--build-config", + _rebased_build_config, + "--deps-configs=$_rebased_deps_configs", + ] + } + + # Building from sources - perform Java compilation and JAR creation. + if (!_is_prebuilt) { + # Additional flags + _javac_flags = [ + "-Werror", + "-Xlint:all", + ] + if (defined(invoker.javac_flags)) { + _javac_flags += invoker.javac_flags + } + + # Data deps + _data_deps = [] + if (defined(invoker.data_deps)) { + _data_deps = invoker.data_deps + } + + # Generates a .sources file containing all sources to be compiled + _java_sources_file = "$target_gen_dir/$target_name.sources" + if (defined(invoker.java_sources_file)) { + _java_sources_file = invoker.java_sources_file + } + write_file(_java_sources_file, rebase_path(_java_files, root_build_dir)) + + # Compiles the given files into a directory and generates a 'class list' + _javac_target_name = target_name + "__javac" + _class_dir = rebase_path(target_out_dir, root_build_dir) + "/classes" + _class_list_file = "$target_gen_dir/$target_name.classlist" + action(_javac_target_name) { + sources = _java_files + deps = [ ":$_config_target_name" ] + + outputs = [ _class_list_file ] + + script = javac_runner + + args = [ + "--classdir", + _class_dir, + "--outfile", + rebase_path(_class_list_file, root_build_dir), + "--build-config", + _rebased_build_config, + "--", + "-d", + _class_dir, + "@" + rebase_path(_java_sources_file, root_build_dir), + ] + _javac_flags + } + + # Bundles all files within the 'class directory' into a jar file + action(target_name) { + deps = [ ":$_javac_target_name" ] + _deps + + data_deps = _data_deps + + outputs = [ _jar_output ] + + script = jar_runner + + args = [ + "cfm", + rebase_path(_jar_output, root_build_dir), + "Manifest.txt", + "-C", + _class_dir, + ".", + ] + } + } else { + # Using pre-specified JAR instead of building from sources - simply copy the JAR to the output directory. + _original_jar_path = invoker.jar_path + copy(target_name) { + sources = [ _original_jar_path ] + outputs = [ _jar_output ] + deps = [ ":$_config_target_name" ] + _deps + } + } +} + template("android_library") { java_library(target_name) { forward_variables_from(invoker, "*") @@ -194,6 +350,24 @@ template("android_library") { } } +template("android_binary") { + java_binary(target_name) { + forward_variables_from(invoker, "*") + + if (!defined(javac_flags)) { + javac_flags = [] + } + + javac_flags += [ + "-Xlint:-options", + "-source", + "8", + "-target", + "8", + ] + } +} + template("java_prebuilt") { java_library(target_name) { forward_variables_from(invoker, "*") diff --git a/config/nrfconnect/chip-module/generate_factory_data.cmake b/config/nrfconnect/chip-module/generate_factory_data.cmake index 55b247619a0c84..2888822efcaea3 100644 --- a/config/nrfconnect/chip-module/generate_factory_data.cmake +++ b/config/nrfconnect/chip-module/generate_factory_data.cmake @@ -63,10 +63,11 @@ if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS) # convert decimal PID to its hexadecimal representation to find out certification files in repository math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) + string(TOUPPER ${raw_pid} raw_pid_upper) # all certs are located in ${CHIP_ROOT}/credentials/development/attestation # it can be used during development without need to generate new certifications - string(APPEND script_args "--dac_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid}-Cert.der\"\n") - string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid}-Key.der\"\n") + string(APPEND script_args "--dac_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Cert.der\"\n") + string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Key.der\"\n") string(APPEND script_args "--pai_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.der\"\n") else() find_program(chip_cert_exe NAMES chip-cert REQUIRED) @@ -79,6 +80,7 @@ string(APPEND script_args "--spake2_it \"${CONFIG_CHIP_DEVICE_SPAKE2_IT}\"\n") string(APPEND script_args "--spake2_salt \"${CONFIG_CHIP_DEVICE_SPAKE2_SALT}\"\n") string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n") string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") +string(APPEND script_args "--include_passcode\n") string(APPEND script_args "--overwrite\n") # check if spake2 verifier should be generated using script diff --git a/docs/ERROR_CODES.md b/docs/ERROR_CODES.md index 7415d292ce1e26..4f07058f43c2bb 100644 --- a/docs/ERROR_CODES.md +++ b/docs/ERROR_CODES.md @@ -14,336 +14,336 @@ This file was **AUTOMATICALLY** generated by ## SDK Core errors -| Decimal | Hex | Name | Description | -| ------- | ---- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 0 | 0x00 | `CHIP_NO_ERROR` | This defines the CHIP error code for success or no error | -| 1 | 0x01 | `CHIP_ERROR_SENDING_BLOCKED` | A message exceeds the sent limit | -| 2 | 0x02 | `CHIP_ERROR_CONNECTION_ABORTED` | A connection has been aborted | -| 3 | 0x03 | `CHIP_ERROR_INCORRECT_STATE` | An unexpected state was encountered | -| 4 | 0x04 | `CHIP_ERROR_MESSAGE_TOO_LONG` | A message is too long | -| 5 | 0x05 | `CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION` | An exchange version is not supported | -| 6 | 0x06 | `CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS` | The attempt to register an unsolicited message handler failed because the unsolicited message handler pool is full | -| 7 | 0x07 | `CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER` | The attempt to unregister an unsolicited message handler failed because the target handler was not found in the unsolicited message handler pool | -| 8 | 0x08 | `CHIP_ERROR_NO_CONNECTION_HANDLER` | No callback has been registered for handling a connection | -| 9 | 0x09 | `CHIP_ERROR_TOO_MANY_PEER_NODES` | The number of peer nodes exceeds the maximum limit of a local node | -| 10 | 0x0A | `CHIP_ERROR_SENTINEL` | For use locally to mark conditions such as value found or end of iteration | -| 11 | 0x0B | `CHIP_ERROR_NO_MEMORY` | The attempt to allocate a buffer or object failed due to a lack of memory | -| 12 | 0x0C | `CHIP_ERROR_NO_MESSAGE_HANDLER` | No callback has been registered for handling a message | -| 13 | 0x0D | `CHIP_ERROR_MESSAGE_INCOMPLETE` | A message is incomplete | -| 14 | 0x0E | `CHIP_ERROR_DATA_NOT_ALIGNED` | The data is not aligned | -| 15 | 0x0F | `CHIP_ERROR_UNKNOWN_KEY_TYPE` | The encryption key type is unknown | -| 16 | 0x10 | `CHIP_ERROR_KEY_NOT_FOUND` | The encryption key is not found | -| 17 | 0x11 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE` | The encryption type is incorrect for the specified key | -| 18 | 0x12 | `CHIP_ERROR_TOO_MANY_KEYS` | The attempt to allocate a key failed because the number of active keys exceeds the maximum limit | -| 19 | 0x13 | `CHIP_ERROR_INTEGRITY_CHECK_FAILED` | The integrity check in the message does not match the expected integrity check | -| 20 | 0x14 | `CHIP_ERROR_INVALID_SIGNATURE` | Invalid signature | -| 21 | 0x15 | `CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION` | A message version is unsupported | -| 22 | 0x16 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE` | An encryption type is unsupported | -| 23 | 0x17 | `CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE` | A signature type is unsupported | -| 24 | 0x18 | `CHIP_ERROR_INVALID_MESSAGE_LENGTH` | A message length is invalid | -| 25 | 0x19 | `CHIP_ERROR_BUFFER_TOO_SMALL` | A buffer is too small | -| 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | A key id is duplicate | -| 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | A key type does not match the expected key type | -| 28 | 0x1C | `CHIP_ERROR_WELL_UNINITIALIZED` | A requested object is uninitialized | -| 29 | 0x1D | `CHIP_ERROR_WELL_EMPTY` | A requested object is empty | -| 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | A string length is invalid | -| 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | A list length is invalid | -| 32 | 0x20 | `CHIP_ERROR_INVALID_INTEGRITY_TYPE` | An integrity type is invalid | -| 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | The end of a TLV encoding, or the end of a TLV container element has been reached | -| 34 | 0x22 | `CHIP_ERROR_TLV_UNDERRUN` | The TLV encoding ended prematurely | -| 35 | 0x23 | `CHIP_ERROR_INVALID_TLV_ELEMENT` | A TLV element is invalid | -| 36 | 0x24 | `CHIP_ERROR_INVALID_TLV_TAG` | A TLV tag is invalid | -| 37 | 0x25 | `CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG` | An implicitly encoded TLV tag was encountered, but an implicit profile id has not been defined | -| 38 | 0x26 | `CHIP_ERROR_WRONG_TLV_TYPE` | A TLV type is wrong | -| 39 | 0x27 | `CHIP_ERROR_TLV_CONTAINER_OPEN` | A TLV container is unexpectedly open | -| 40 | 0x28 | `CHIP_ERROR_INVALID_TRANSFER_MODE` | A transfer mode is invalid | -| 41 | 0x29 | `CHIP_ERROR_INVALID_PROFILE_ID` | A profile id is invalid | -| 42 | 0x2A | `CHIP_ERROR_INVALID_MESSAGE_TYPE` | A message type is invalid | -| 43 | 0x2B | `CHIP_ERROR_UNEXPECTED_TLV_ELEMENT` | An unexpected TLV element was encountered | -| 44 | 0x2C | `CHIP_ERROR_STATUS_REPORT_RECEIVED` | A status report is received from a peer node | -| 45 | 0x2D | `CHIP_ERROR_NOT_IMPLEMENTED` | A requested function or feature is not implemented | -| 46 | 0x2E | `CHIP_ERROR_INVALID_ADDRESS` | An address is invalid | -| 47 | 0x2F | `CHIP_ERROR_INVALID_ARGUMENT` | An argument is invalid | -| 48 | 0x30 | `CHIP_ERROR_INVALID_PATH_LIST` | A TLV path list is invalid | -| 49 | 0x31 | `CHIP_ERROR_INVALID_DATA_LIST` | A TLV data list is invalid | -| 50 | 0x32 | `CHIP_ERROR_TIMEOUT` | A request timed out | -| 51 | 0x33 | `CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR` | A device descriptor is invalid | -| 52 | 0x34 | `CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION` | A device descriptor version is unsupported | -| 53 | 0x35 | `CHIP_ERROR_END_OF_INPUT` | An input ended | -| 54 | 0x36 | `CHIP_ERROR_RATE_LIMIT_EXCEEDED` | A rate limit is exceeded | -| 55 | 0x37 | `CHIP_ERROR_SECURITY_MANAGER_BUSY` | A security manager is busy | -| 56 | 0x38 | `CHIP_ERROR_INVALID_PASE_PARAMETER` | A PASE parameter is invalid | -| 57 | 0x39 | `CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1` | PASE supports only config1 | -| 58 | 0x3A | `CHIP_ERROR_KEY_CONFIRMATION_FAILED` | A key confirmation failed | -| 59 | 0x3B | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY` | A use of session key is invalid | -| 60 | 0x3C | `CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY` | A connection is closed unexpectedly | -| 61 | 0x3D | `CHIP_ERROR_MISSING_TLV_ELEMENT` | A TLV element is missing | -| 62 | 0x3E | `CHIP_ERROR_RANDOM_DATA_UNAVAILABLE` | Secure random data is not available | -| 63 | 0x3F | `CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT` | A type in host/port list is unsupported | -| 64 | 0x40 | `CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX` | A suffix index in host/port list is invalid | -| 65 | 0x41 | `CHIP_ERROR_HOST_PORT_LIST_EMPTY` | A host/port list is empty | -| 66 | 0x42 | `CHIP_ERROR_UNSUPPORTED_AUTH_MODE` | An authentication mode is unsupported | -| 67 | 0x43 | `CHIP_ERROR_INVALID_SERVICE_EP` | A service endpoint is invalid | -| 68 | 0x44 | `CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE` | A directory entry type is unknown | -| 69 | 0x45 | `CHIP_ERROR_FORCED_RESET` | A service manager is forced to reset | -| 70 | 0x46 | `CHIP_ERROR_NO_ENDPOINT` | No endpoint is available | -| 71 | 0x47 | `CHIP_ERROR_INVALID_DESTINATION_NODE_ID` | A destination node id is invalid | -| 72 | 0x48 | `CHIP_ERROR_NOT_CONNECTED` | The operation cannot be performed because the underlying object is not connected | -| 73 | 0x49 | `CHIP_ERROR_NO_SW_UPDATE_AVAILABLE` | No software update is available | -| 74 | 0x4A | `CHIP_ERROR_CA_CERT_NOT_FOUND` | CA certificate is not found | -| 75 | 0x4B | `CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED` | A certificate path length exceeds the constraint | -| 76 | 0x4C | `CHIP_ERROR_CERT_PATH_TOO_LONG` | A certificate path is too long | -| 77 | 0x4D | `CHIP_ERROR_CERT_USAGE_NOT_ALLOWED` | A requested certificate usage is not allowed | -| 78 | 0x4E | `CHIP_ERROR_CERT_EXPIRED` | A certificate expired | -| 79 | 0x4F | `CHIP_ERROR_CERT_NOT_VALID_YET` | A certificate is not valid yet | -| 80 | 0x50 | `CHIP_ERROR_UNSUPPORTED_CERT_FORMAT` | A certificate format is unsupported | -| 81 | 0x51 | `CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE` | An elliptic curve is unsupported | -| 82 | 0x52 | `CHIP_ERROR_CERT_NOT_USED` | A certificate was not used during the chain validation | -| 83 | 0x53 | `CHIP_ERROR_CERT_NOT_FOUND` | A certificate is not found | -| 84 | 0x54 | `CHIP_ERROR_INVALID_CASE_PARAMETER` | A CASE parameter is invalid | -| 85 | 0x55 | `CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION` | A CASE configuration is unsupported | -| 86 | 0x56 | `CHIP_ERROR_CERT_LOAD_FAILED` | A certificate load failed | -| 87 | 0x57 | `CHIP_ERROR_CERT_NOT_TRUSTED` | A certificate is not trusted | -| 88 | 0x58 | `CHIP_ERROR_INVALID_ACCESS_TOKEN` | An access token is invalid | -| 89 | 0x59 | `CHIP_ERROR_WRONG_CERT_DN` | A certificate subject/issuer distinguished name is wrong | -| 90 | 0x5A | `CHIP_ERROR_INVALID_PROVISIONING_BUNDLE` | A provisioning bundle is invalid | -| 91 | 0x5B | `CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR` | A provision bundle encountered a decryption error | -| 92 | 0x5C | `CHIP_ERROR_WRONG_NODE_ID` | A node id is wrong | -| 93 | 0x5D | `CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT` | A connection is accepted on a wrong port | -| 94 | 0x5E | `CHIP_ERROR_CALLBACK_REPLACED` | An application callback has been replaced | -| 95 | 0x5F | `CHIP_ERROR_NO_CASE_AUTH_DELEGATE` | No CASE authentication delegate is set | -| 96 | 0x60 | `CHIP_ERROR_DEVICE_LOCATE_TIMEOUT` | The attempt to locate device timed out | -| 97 | 0x61 | `CHIP_ERROR_DEVICE_CONNECT_TIMEOUT` | The attempt to connect device timed out | -| 98 | 0x62 | `CHIP_ERROR_DEVICE_AUTH_TIMEOUT` | The attempt to authenticate device timed out | -| 99 | 0x63 | `CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED` | A message is not acknowledged after max retries | -| 100 | 0x64 | `CHIP_ERROR_RETRANS_TABLE_FULL` | A retransmission table is already full | -| 101 | 0x65 | `CHIP_ERROR_INVALID_ACK_MESSAGE_COUNTER` | An acknowledgment id is invalid | -| 102 | 0x66 | `CHIP_ERROR_SEND_THROTTLED` | A send is throttled | -| 103 | 0x67 | `CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE` | A message version is not supported by the current exchange context | -| 104 | 0x68 | `CHIP_ERROR_TRANSACTION_CANCELED` | A transaction is cancelled | -| 105 | 0x69 | `CHIP_ERROR_LISTENER_ALREADY_STARTED` | A listener has already started | -| 106 | 0x6A | `CHIP_ERROR_LISTENER_ALREADY_STOPPED` | A listener has already stopped | -| 107 | 0x6B | `CHIP_ERROR_INVALID_SUBSCRIPTION` | A message was received as part of a subscription exchange that has a mis-matching subscription id | -| 108 | 0x6C | `CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE` | A CHIP feature is unsupported | -| 109 | 0x6D | `CHIP_ERROR_PASE_RECONFIGURE_REQUIRED` | PASE is required to reconfigure | -| 110 | 0x6E | `CHIP_ERROR_INVALID_PASE_CONFIGURATION` | A PASE configuration is invalid | -| 111 | 0x6F | `CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS` | No PASE configuration is in common | -| 112 | 0x70 | `CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR` | An unsolicited message with the originator bit clear | -| 113 | 0x71 | `CHIP_ERROR_INVALID_FABRIC_INDEX` | A fabric index is invalid | -| 114 | 0x72 | `CHIP_ERROR_TOO_MANY_CONNECTIONS` | The attempt to allocate a connection object failed because too many connections exist | -| 115 | 0x73 | `CHIP_ERROR_SHUT_DOWN` | The operation cancelled because a shut down was initiated | -| 116 | 0x74 | `CHIP_ERROR_CANCELLED` | The operation has been cancelled, generally by calling a cancel/abort request | -| 117 | 0x75 | `CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED` | DRBG entropy source failed to generate entropy data | -| 118 | 0x76 | `CHIP_ERROR_TLV_TAG_NOT_FOUND` | A specified TLV tag was not found | -| 119 | 0x77 | `CHIP_ERROR_MISSING_SECURE_SESSION` | A secure session is needed to do work, but is missing/is not present | -| 120 | 0x78 | `CHIP_ERROR_INVALID_ADMIN_SUBJECT` | The CaseAdminSubject field is not valid in AddNOC command | -| 121 | 0x79 | `CHIP_ERROR_INSUFFICIENT_PRIVILEGE` | Required privilege was insufficient during an operation | -| 122 | 0x7A | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB` | The Attribute Report IB is malformed: it does not contain the required elements | -| 123 | 0x7B | `CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB` | The Event Status IB is malformed: it does not contain the required elements | -| 124 | 0x7C | `CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE` | The Status Response Message is malformed: it does not contain the required elements | -| 125 | 0x7D | `CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED` | The message counter of the session is exhausted, the session should be closed | -| 126 | 0x7E | `CHIP_ERROR_FABRIC_EXISTS` | The fabric with the given fabric id and root public key already exists | -| 127 | 0x7F | `CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER` | The encryption key is not found error received from a peer node | -| 128 | 0x80 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER` | The wrong encryption type error received from a peer node | -| 129 | 0x81 | `CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER` | The unknown key type error received from a peer node | -| 130 | 0x82 | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER` | The invalid use of session key error received from a peer node | -| 131 | 0x83 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER` | An unsupported encryption type error received from a peer node | -| 132 | 0x84 | `CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER` | The internal key error received from a peer node | -| 133 | 0x85 | `CHIP_ERROR_INVALID_KEY_ID` | A key id is invalid | -| 134 | 0x86 | `CHIP_ERROR_INVALID_TIME` | Time has invalid value | -| 135 | 0x87 | `CHIP_ERROR_LOCKING_FAILURE` | Failure to acquire or release an OS provided mutex | -| 136 | 0x88 | `CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG` | A passcode encryption configuration is unsupported | -| 137 | 0x89 | `CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED` | The CHIP passcode authentication failed | -| 138 | 0x8A | `CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED` | The CHIP passcode fingerprint failed | -| 139 | 0x8B | `CHIP_ERROR_SERIALIZATION_ELEMENT_NULL` | The element of the struct is null | -| 140 | 0x8C | `CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM` | The certificate was not signed using the required signature algorithm | -| 141 | 0x8D | `CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM` | The CHIP signature was not signed using the required signature algorithm | -| 142 | 0x8E | `CHIP_ERROR_SCHEMA_MISMATCH` | A mismatch in schema was encountered | -| 143 | 0x8F | `CHIP_ERROR_INVALID_INTEGER_VALUE` | An integer does not have the kind of value we expect | -| 144 | 0x90 | `CHIP_ERROR_CASE_RECONFIG_REQUIRED` | CASE is required to reconfigure | -| 145 | 0x91 | `CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS` | Too many CASE reconfigurations were received | -| 146 | 0x92 | `CHIP_ERROR_BAD_REQUEST` | The request cannot be processed or fulfilled | -| 147 | 0x93 | `CHIP_ERROR_INVALID_MESSAGE_FLAG` | One or more message flags have invalid value | -| 148 | 0x94 | `CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED` | Key export protocol required to reconfigure | -| 149 | 0x95 | `CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION` | A key export protocol configuration is invalid | -| 150 | 0x96 | `CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS` | No key export protocol configuration is in common | -| 151 | 0x97 | `CHIP_ERROR_NO_KEY_EXPORT_DELEGATE` | No key export delegate is set | -| 152 | 0x98 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST` | Unauthorized key export request | -| 153 | 0x99 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE` | Unauthorized key export response | -| 154 | 0x9A | `CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED` | The CHIP exported encrypted key authentication failed | -| 155 | 0x9B | `CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES` | The number of shared secure sessions end nodes exceeds the maximum limit | -| 156 | 0x9C | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB` | The Attribute Data IB is malformed: it does not contain the required elements | -| 157 | 0x9D | `CHIP_ERROR_WRONG_CERT_TYPE` | The presented certificate was of the wrong type | -| 158 | 0x9E | `CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED` | The application's event handler failed to call the default event handler function when presented with an unknown event | -| 159 | 0x9F | `CHIP_ERROR_PERSISTED_STORAGE_FAILED` | Persisted storage memory read/write failure | -| 160 | 0xA0 | `CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND` | The specific value is not found in the persisted storage | -| 161 | 0xA1 | `CHIP_ERROR_IM_FABRIC_DELETED` | The fabric is deleted, and the corresponding IM resources are released | -| 162 | 0xA2 | `CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED` | The specified profile string support context is not registered | -| 163 | 0xA3 | `CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION` | Encountered a mismatch in compatibility wrt to IDL schema version | -| 165 | 0xA5 | `CHIP_ERROR_ACCESS_DENIED` | The CHIP message is not granted access for further processing | -| 166 | 0xA6 | `CHIP_ERROR_UNKNOWN_RESOURCE_ID` | Unknown resource ID | -| 167 | 0xA7 | `CHIP_ERROR_VERSION_MISMATCH` | The conditional update of a trait instance path has failed because the local changes are based on an obsolete version of the data | -| 168 | 0xA8 | `CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE` | Device doesn't support standalone Thread network creation On some legacy devices new Thread network can only be created together with CHIP Fabric using CrateFabric() message | -| 169 | 0xA9 | `CHIP_ERROR_INCONSISTENT_CONDITIONALITY` | A TraitPath was declared updated with a conditionality that does not match that of other TraitPaths already updated in the same Trait Instance | -| 170 | 0xAA | `CHIP_ERROR_LOCAL_DATA_INCONSISTENT` | The local data does not match any known version of the Trait Instance and cannot support the operation requested | -| 171 | 0xAB | `CHIP_ERROR_EVENT_ID_FOUND` | Event ID matching the criteria was found | -| 172 | 0xAC | `CHIP_ERROR_INTERNAL` | Internal error | -| 173 | 0xAD | `CHIP_ERROR_OPEN_FAILED` | Open file failed | -| 174 | 0xAE | `CHIP_ERROR_READ_FAILED` | Read from file failed | -| 175 | 0xAF | `CHIP_ERROR_WRITE_FAILED` | Write to file failed | -| 176 | 0xB0 | `CHIP_ERROR_DECODE_FAILED` | Decoding failed | -| 177 | 0xB1 | `CHIP_ERROR_SESSION_KEY_SUSPENDED` | Use of the identified session key is suspended | -| 178 | 0xB2 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN` | The specified wireless regulatory domain is unsupported | -| 179 | 0xB3 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION` | The specified wireless operating location is unsupported | -| 180 | 0xB4 | `CHIP_ERROR_MDNS_COLLISION` | The registered service name has collision on the LAN | -| 181 | 0xB5 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB` | The Attribute path IB is malformed: it does not contain the required path | -| 182 | 0xB6 | `CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB` | The Event Path IB is malformed: it does not contain the required elements | -| 183 | 0xB7 | `CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB` | The Command Path IB is malformed: it does not contain the required elements | -| 184 | 0xB8 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB` | The Attribute Status IB is malformed: it does not contain the required elements | -| 185 | 0xB9 | `CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB` | The Command Data IB is malformed: it does not contain the required elements | -| 186 | 0xBA | `CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB` | The Event Data IB is malformed: it does not contain the required elements | -| 187 | 0xBB | `CHIP_ERROR_IM_MALFORMED_STATUS_IB` | The Attribute Data IB is malformed: it does not contain the required elements | -| 188 | 0xBC | `CHIP_ERROR_PEER_NODE_NOT_FOUND` | Unable to find the peer node | -| 189 | 0xBD | `CHIP_ERROR_HSM` | Error in Hardware security module Used for software fallback option | -| 190 | 0xBE | `CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED` | The commissioner doesn't require an intermediate CA to sign the operational certificates | -| 191 | 0xBF | `CHIP_ERROR_REAL_TIME_NOT_SYNCED` | The system's real time clock is not synchronized to an accurate time source | -| 192 | 0xC0 | `CHIP_ERROR_UNEXPECTED_EVENT` | An unexpected event was encountered | -| 193 | 0xC1 | `CHIP_ERROR_ENDPOINT_POOL_FULL` | No endpoint pool entry is available | -| 194 | 0xC2 | `CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG` | More inbound message data is pending than available buffer space available to copy it | -| 195 | 0xC3 | `CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG` | More outbound message data is pending than available buffer space available to copy it | -| 196 | 0xC4 | `CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED` | The received message is a duplicate of a previously received message | -| 197 | 0xC5 | `CHIP_ERROR_INVALID_PUBLIC_KEY` | The received public key doesn't match locally generated key | -| 198 | 0xC6 | `CHIP_ERROR_FABRIC_MISMATCH_ON_ICA` | The fabric ID in ICA certificate doesn't match the one in NOC | -| 199 | 0xC7 | `CHIP_ERROR_MESSAGE_COUNTER_OUT_OF_WINDOW` | The message counter of the received message is out of receiving window | -| 200 | 0xC8 | `CHIP_ERROR_REBOOT_SIGNAL_RECEIVED` | Termination signal is received | -| 201 | 0xC9 | `CHIP_ERROR_NO_SHARED_TRUSTED_ROOT` | The CASE session could not be established as peer's credentials do not have a common root of trust | -| 202 | 0xCA | `CHIP_ERROR_IM_STATUS_CODE_RECEIVED` | The CASE session could not be established as peer's credentials do not have a common root of trust | -| 203 | 0xCB | `CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB` | The Command Status IB is malformed: it does not contain the required elements | -| 204 | 0xCC | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB` | The Invoke Response IB is malformed: it does not contain the required elements | -| 205 | 0xCD | `CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE` | The Invoke Request Message is malformed: it does not contain the required elements | -| 206 | 0xCE | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE` | The Invoke Response Message is malformed: it does not contain the required elements | -| 207 | 0xCF | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE` | The Attribute Response Message is malformed: it does not contain the required elements | -| 208 | 0xD0 | `CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE` | The Write Request Message is malformed: it does not contain the required elements | -| 209 | 0xD1 | `CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB` | The Event Filter IB is malformed: it does not contain the required elements | -| 210 | 0xD2 | `CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE` | The Read Request Message is malformed: it does not contain the required elements | -| 211 | 0xD3 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE` | The Subscribe Request Message is malformed: it does not contain the required elements | -| 212 | 0xD4 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE` | The Subscribe Response Message is malformed: it does not contain the required elements | -| 213 | 0xD5 | `CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB` | The Event Report IB is malformed: it does not contain the required elements | -| 214 | 0xD6 | `CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB` | The Cluster Path IB is malformed: it does not contain the required elements | -| 215 | 0xD7 | `CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB` | The Data Version Filter IB is malformed: it does not contain the required elements | -| 216 | 0xD8 | `CHIP_ERROR_NOT_FOUND` | The item referenced in the function call was not found | -| 217 | 0xD9 | `CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE` | The Timed Request Message is malformed: it does not contain the required elements | -| 218 | 0xDA | `CHIP_ERROR_INVALID_FILE_IDENTIFIER` | The file identifier, encoded in the first few bytes of a processed file, has unexpected value | -| 219 | 0xDB | `CHIP_ERROR_BUSY` | The Resource is busy and cannot process the request Trying again might work | -| 220 | 0xDC | `CHIP_ERROR_MAX_RETRY_EXCEEDED` | The maximum retry limit has been exceeded | -| 221 | 0xDD | `CHIP_ERROR_PROVIDER_LIST_EXHAUSTED` | The provider list has been exhausted | -| 222 | 0xDE | `CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS` | The provider list has been exhausted | -| 223 | 0xDF | `CHIP_ERROR_INVALID_SCHEME_PREFIX` | The scheme field contains an invalid prefix | -| 224 | 0xE0 | `CHIP_ERROR_MISSING_URI_SEPARATOR` | The URI separator is missing | +| Decimal | Hex | Name | +| ------- | ---- | ---------------------------------------------------- | +| 0 | 0x00 | `CHIP_NO_ERROR` | +| 1 | 0x01 | `CHIP_ERROR_SENDING_BLOCKED` | +| 2 | 0x02 | `CHIP_ERROR_CONNECTION_ABORTED` | +| 3 | 0x03 | `CHIP_ERROR_INCORRECT_STATE` | +| 4 | 0x04 | `CHIP_ERROR_MESSAGE_TOO_LONG` | +| 5 | 0x05 | `CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION` | +| 6 | 0x06 | `CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS` | +| 7 | 0x07 | `CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER` | +| 8 | 0x08 | `CHIP_ERROR_NO_CONNECTION_HANDLER` | +| 9 | 0x09 | `CHIP_ERROR_TOO_MANY_PEER_NODES` | +| 10 | 0x0A | `CHIP_ERROR_SENTINEL` | +| 11 | 0x0B | `CHIP_ERROR_NO_MEMORY` | +| 12 | 0x0C | `CHIP_ERROR_NO_MESSAGE_HANDLER` | +| 13 | 0x0D | `CHIP_ERROR_MESSAGE_INCOMPLETE` | +| 14 | 0x0E | `CHIP_ERROR_DATA_NOT_ALIGNED` | +| 15 | 0x0F | `CHIP_ERROR_UNKNOWN_KEY_TYPE` | +| 16 | 0x10 | `CHIP_ERROR_KEY_NOT_FOUND` | +| 17 | 0x11 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE` | +| 18 | 0x12 | `CHIP_ERROR_TOO_MANY_KEYS` | +| 19 | 0x13 | `CHIP_ERROR_INTEGRITY_CHECK_FAILED` | +| 20 | 0x14 | `CHIP_ERROR_INVALID_SIGNATURE` | +| 21 | 0x15 | `CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION` | +| 22 | 0x16 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE` | +| 23 | 0x17 | `CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE` | +| 24 | 0x18 | `CHIP_ERROR_INVALID_MESSAGE_LENGTH` | +| 25 | 0x19 | `CHIP_ERROR_BUFFER_TOO_SMALL` | +| 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | +| 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | +| 28 | 0x1C | `CHIP_ERROR_WELL_UNINITIALIZED` | +| 29 | 0x1D | `CHIP_ERROR_WELL_EMPTY` | +| 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | +| 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | +| 32 | 0x20 | `CHIP_ERROR_INVALID_INTEGRITY_TYPE` | +| 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | +| 34 | 0x22 | `CHIP_ERROR_TLV_UNDERRUN` | +| 35 | 0x23 | `CHIP_ERROR_INVALID_TLV_ELEMENT` | +| 36 | 0x24 | `CHIP_ERROR_INVALID_TLV_TAG` | +| 37 | 0x25 | `CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG` | +| 38 | 0x26 | `CHIP_ERROR_WRONG_TLV_TYPE` | +| 39 | 0x27 | `CHIP_ERROR_TLV_CONTAINER_OPEN` | +| 40 | 0x28 | `CHIP_ERROR_INVALID_TRANSFER_MODE` | +| 41 | 0x29 | `CHIP_ERROR_INVALID_PROFILE_ID` | +| 42 | 0x2A | `CHIP_ERROR_INVALID_MESSAGE_TYPE` | +| 43 | 0x2B | `CHIP_ERROR_UNEXPECTED_TLV_ELEMENT` | +| 44 | 0x2C | `CHIP_ERROR_STATUS_REPORT_RECEIVED` | +| 45 | 0x2D | `CHIP_ERROR_NOT_IMPLEMENTED` | +| 46 | 0x2E | `CHIP_ERROR_INVALID_ADDRESS` | +| 47 | 0x2F | `CHIP_ERROR_INVALID_ARGUMENT` | +| 48 | 0x30 | `CHIP_ERROR_INVALID_PATH_LIST` | +| 49 | 0x31 | `CHIP_ERROR_INVALID_DATA_LIST` | +| 50 | 0x32 | `CHIP_ERROR_TIMEOUT` | +| 51 | 0x33 | `CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR` | +| 52 | 0x34 | `CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION` | +| 53 | 0x35 | `CHIP_ERROR_END_OF_INPUT` | +| 54 | 0x36 | `CHIP_ERROR_RATE_LIMIT_EXCEEDED` | +| 55 | 0x37 | `CHIP_ERROR_SECURITY_MANAGER_BUSY` | +| 56 | 0x38 | `CHIP_ERROR_INVALID_PASE_PARAMETER` | +| 57 | 0x39 | `CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1` | +| 58 | 0x3A | `CHIP_ERROR_KEY_CONFIRMATION_FAILED` | +| 59 | 0x3B | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY` | +| 60 | 0x3C | `CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY` | +| 61 | 0x3D | `CHIP_ERROR_MISSING_TLV_ELEMENT` | +| 62 | 0x3E | `CHIP_ERROR_RANDOM_DATA_UNAVAILABLE` | +| 63 | 0x3F | `CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT` | +| 64 | 0x40 | `CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX` | +| 65 | 0x41 | `CHIP_ERROR_HOST_PORT_LIST_EMPTY` | +| 66 | 0x42 | `CHIP_ERROR_UNSUPPORTED_AUTH_MODE` | +| 67 | 0x43 | `CHIP_ERROR_INVALID_SERVICE_EP` | +| 68 | 0x44 | `CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE` | +| 69 | 0x45 | `CHIP_ERROR_FORCED_RESET` | +| 70 | 0x46 | `CHIP_ERROR_NO_ENDPOINT` | +| 71 | 0x47 | `CHIP_ERROR_INVALID_DESTINATION_NODE_ID` | +| 72 | 0x48 | `CHIP_ERROR_NOT_CONNECTED` | +| 73 | 0x49 | `CHIP_ERROR_NO_SW_UPDATE_AVAILABLE` | +| 74 | 0x4A | `CHIP_ERROR_CA_CERT_NOT_FOUND` | +| 75 | 0x4B | `CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED` | +| 76 | 0x4C | `CHIP_ERROR_CERT_PATH_TOO_LONG` | +| 77 | 0x4D | `CHIP_ERROR_CERT_USAGE_NOT_ALLOWED` | +| 78 | 0x4E | `CHIP_ERROR_CERT_EXPIRED` | +| 79 | 0x4F | `CHIP_ERROR_CERT_NOT_VALID_YET` | +| 80 | 0x50 | `CHIP_ERROR_UNSUPPORTED_CERT_FORMAT` | +| 81 | 0x51 | `CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE` | +| 82 | 0x52 | `CHIP_ERROR_CERT_NOT_USED` | +| 83 | 0x53 | `CHIP_ERROR_CERT_NOT_FOUND` | +| 84 | 0x54 | `CHIP_ERROR_INVALID_CASE_PARAMETER` | +| 85 | 0x55 | `CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION` | +| 86 | 0x56 | `CHIP_ERROR_CERT_LOAD_FAILED` | +| 87 | 0x57 | `CHIP_ERROR_CERT_NOT_TRUSTED` | +| 88 | 0x58 | `CHIP_ERROR_INVALID_ACCESS_TOKEN` | +| 89 | 0x59 | `CHIP_ERROR_WRONG_CERT_DN` | +| 90 | 0x5A | `CHIP_ERROR_INVALID_PROVISIONING_BUNDLE` | +| 91 | 0x5B | `CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR` | +| 92 | 0x5C | `CHIP_ERROR_WRONG_NODE_ID` | +| 93 | 0x5D | `CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT` | +| 94 | 0x5E | `CHIP_ERROR_CALLBACK_REPLACED` | +| 95 | 0x5F | `CHIP_ERROR_NO_CASE_AUTH_DELEGATE` | +| 96 | 0x60 | `CHIP_ERROR_DEVICE_LOCATE_TIMEOUT` | +| 97 | 0x61 | `CHIP_ERROR_DEVICE_CONNECT_TIMEOUT` | +| 98 | 0x62 | `CHIP_ERROR_DEVICE_AUTH_TIMEOUT` | +| 99 | 0x63 | `CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED` | +| 100 | 0x64 | `CHIP_ERROR_RETRANS_TABLE_FULL` | +| 101 | 0x65 | `CHIP_ERROR_INVALID_ACK_MESSAGE_COUNTER` | +| 102 | 0x66 | `CHIP_ERROR_SEND_THROTTLED` | +| 103 | 0x67 | `CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE` | +| 104 | 0x68 | `CHIP_ERROR_TRANSACTION_CANCELED` | +| 105 | 0x69 | `CHIP_ERROR_LISTENER_ALREADY_STARTED` | +| 106 | 0x6A | `CHIP_ERROR_LISTENER_ALREADY_STOPPED` | +| 107 | 0x6B | `CHIP_ERROR_INVALID_SUBSCRIPTION` | +| 108 | 0x6C | `CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE` | +| 109 | 0x6D | `CHIP_ERROR_PASE_RECONFIGURE_REQUIRED` | +| 110 | 0x6E | `CHIP_ERROR_INVALID_PASE_CONFIGURATION` | +| 111 | 0x6F | `CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS` | +| 112 | 0x70 | `CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR` | +| 113 | 0x71 | `CHIP_ERROR_INVALID_FABRIC_INDEX` | +| 114 | 0x72 | `CHIP_ERROR_TOO_MANY_CONNECTIONS` | +| 115 | 0x73 | `CHIP_ERROR_SHUT_DOWN` | +| 116 | 0x74 | `CHIP_ERROR_CANCELLED` | +| 117 | 0x75 | `CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED` | +| 118 | 0x76 | `CHIP_ERROR_TLV_TAG_NOT_FOUND` | +| 119 | 0x77 | `CHIP_ERROR_MISSING_SECURE_SESSION` | +| 120 | 0x78 | `CHIP_ERROR_INVALID_ADMIN_SUBJECT` | +| 121 | 0x79 | `CHIP_ERROR_INSUFFICIENT_PRIVILEGE` | +| 122 | 0x7A | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB` | +| 123 | 0x7B | `CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB` | +| 124 | 0x7C | `CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE` | +| 125 | 0x7D | `CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED` | +| 126 | 0x7E | `CHIP_ERROR_FABRIC_EXISTS` | +| 127 | 0x7F | `CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER` | +| 128 | 0x80 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER` | +| 129 | 0x81 | `CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER` | +| 130 | 0x82 | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER` | +| 131 | 0x83 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER` | +| 132 | 0x84 | `CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER` | +| 133 | 0x85 | `CHIP_ERROR_INVALID_KEY_ID` | +| 134 | 0x86 | `CHIP_ERROR_INVALID_TIME` | +| 135 | 0x87 | `CHIP_ERROR_LOCKING_FAILURE` | +| 136 | 0x88 | `CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG` | +| 137 | 0x89 | `CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED` | +| 138 | 0x8A | `CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED` | +| 139 | 0x8B | `CHIP_ERROR_SERIALIZATION_ELEMENT_NULL` | +| 140 | 0x8C | `CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM` | +| 141 | 0x8D | `CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM` | +| 142 | 0x8E | `CHIP_ERROR_SCHEMA_MISMATCH` | +| 143 | 0x8F | `CHIP_ERROR_INVALID_INTEGER_VALUE` | +| 144 | 0x90 | `CHIP_ERROR_CASE_RECONFIG_REQUIRED` | +| 145 | 0x91 | `CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS` | +| 146 | 0x92 | `CHIP_ERROR_BAD_REQUEST` | +| 147 | 0x93 | `CHIP_ERROR_INVALID_MESSAGE_FLAG` | +| 148 | 0x94 | `CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED` | +| 149 | 0x95 | `CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION` | +| 150 | 0x96 | `CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS` | +| 151 | 0x97 | `CHIP_ERROR_NO_KEY_EXPORT_DELEGATE` | +| 152 | 0x98 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST` | +| 153 | 0x99 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE` | +| 154 | 0x9A | `CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED` | +| 155 | 0x9B | `CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES` | +| 156 | 0x9C | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB` | +| 157 | 0x9D | `CHIP_ERROR_WRONG_CERT_TYPE` | +| 158 | 0x9E | `CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED` | +| 159 | 0x9F | `CHIP_ERROR_PERSISTED_STORAGE_FAILED` | +| 160 | 0xA0 | `CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND` | +| 161 | 0xA1 | `CHIP_ERROR_IM_FABRIC_DELETED` | +| 162 | 0xA2 | `CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED` | +| 163 | 0xA3 | `CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION` | +| 165 | 0xA5 | `CHIP_ERROR_ACCESS_DENIED` | +| 166 | 0xA6 | `CHIP_ERROR_UNKNOWN_RESOURCE_ID` | +| 167 | 0xA7 | `CHIP_ERROR_VERSION_MISMATCH` | +| 168 | 0xA8 | `CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE` | +| 169 | 0xA9 | `CHIP_ERROR_INCONSISTENT_CONDITIONALITY` | +| 170 | 0xAA | `CHIP_ERROR_LOCAL_DATA_INCONSISTENT` | +| 171 | 0xAB | `CHIP_ERROR_EVENT_ID_FOUND` | +| 172 | 0xAC | `CHIP_ERROR_INTERNAL` | +| 173 | 0xAD | `CHIP_ERROR_OPEN_FAILED` | +| 174 | 0xAE | `CHIP_ERROR_READ_FAILED` | +| 175 | 0xAF | `CHIP_ERROR_WRITE_FAILED` | +| 176 | 0xB0 | `CHIP_ERROR_DECODE_FAILED` | +| 177 | 0xB1 | `CHIP_ERROR_SESSION_KEY_SUSPENDED` | +| 178 | 0xB2 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN` | +| 179 | 0xB3 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION` | +| 180 | 0xB4 | `CHIP_ERROR_MDNS_COLLISION` | +| 181 | 0xB5 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB` | +| 182 | 0xB6 | `CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB` | +| 183 | 0xB7 | `CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB` | +| 184 | 0xB8 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB` | +| 185 | 0xB9 | `CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB` | +| 186 | 0xBA | `CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB` | +| 187 | 0xBB | `CHIP_ERROR_IM_MALFORMED_STATUS_IB` | +| 188 | 0xBC | `CHIP_ERROR_PEER_NODE_NOT_FOUND` | +| 189 | 0xBD | `CHIP_ERROR_HSM` | +| 190 | 0xBE | `CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED` | +| 191 | 0xBF | `CHIP_ERROR_REAL_TIME_NOT_SYNCED` | +| 192 | 0xC0 | `CHIP_ERROR_UNEXPECTED_EVENT` | +| 193 | 0xC1 | `CHIP_ERROR_ENDPOINT_POOL_FULL` | +| 194 | 0xC2 | `CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG` | +| 195 | 0xC3 | `CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG` | +| 196 | 0xC4 | `CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED` | +| 197 | 0xC5 | `CHIP_ERROR_INVALID_PUBLIC_KEY` | +| 198 | 0xC6 | `CHIP_ERROR_FABRIC_MISMATCH_ON_ICA` | +| 199 | 0xC7 | `CHIP_ERROR_MESSAGE_COUNTER_OUT_OF_WINDOW` | +| 200 | 0xC8 | `CHIP_ERROR_REBOOT_SIGNAL_RECEIVED` | +| 201 | 0xC9 | `CHIP_ERROR_NO_SHARED_TRUSTED_ROOT` | +| 202 | 0xCA | `CHIP_ERROR_IM_STATUS_CODE_RECEIVED` | +| 203 | 0xCB | `CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB` | +| 204 | 0xCC | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB` | +| 205 | 0xCD | `CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE` | +| 206 | 0xCE | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE` | +| 207 | 0xCF | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE` | +| 208 | 0xD0 | `CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE` | +| 209 | 0xD1 | `CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB` | +| 210 | 0xD2 | `CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE` | +| 211 | 0xD3 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE` | +| 212 | 0xD4 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE` | +| 213 | 0xD5 | `CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB` | +| 214 | 0xD6 | `CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB` | +| 215 | 0xD7 | `CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB` | +| 216 | 0xD8 | `CHIP_ERROR_NOT_FOUND` | +| 217 | 0xD9 | `CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE` | +| 218 | 0xDA | `CHIP_ERROR_INVALID_FILE_IDENTIFIER` | +| 219 | 0xDB | `CHIP_ERROR_BUSY` | +| 220 | 0xDC | `CHIP_ERROR_MAX_RETRY_EXCEEDED` | +| 221 | 0xDD | `CHIP_ERROR_PROVIDER_LIST_EXHAUSTED` | +| 222 | 0xDE | `CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS` | +| 223 | 0xDF | `CHIP_ERROR_INVALID_SCHEME_PREFIX` | +| 224 | 0xE0 | `CHIP_ERROR_MISSING_URI_SEPARATOR` | ## SDK Inet Layer errors -| Decimal | Hex | Name | Description | -| ------- | ----- | ----------------------------------------- | ------------------------------------------------------------------------------------------ | -| 257 | 0x101 | `INET_ERROR_WRONG_ADDRESS_TYPE` | The Internet Protocol (IP) address type or scope does not match the expected type or scope | -| 258 | 0x102 | `INET_ERROR_PEER_DISCONNECTED` | A remote connection peer disconnected | -| 265 | 0x109 | `INET_ERROR_HOST_NOT_FOUND` | A requested host name could not be resolved to an address | -| 266 | 0x10A | `INET_ERROR_DNS_TRY_AGAIN` | A name server returned a temporary failure indication; try again later | -| 267 | 0x10B | `INET_ERROR_DNS_NO_RECOVERY` | A name server returned an unrecoverable error | -| 269 | 0x10D | `INET_ERROR_WRONG_PROTOCOL_TYPE` | An incorrect or unexpected protocol type was encountered | -| 270 | 0x10E | `INET_ERROR_UNKNOWN_INTERFACE` | An unknown interface identifier was encountered | -| 272 | 0x110 | `INET_ERROR_ADDRESS_NOT_FOUND` | A requested address type, class, or scope cannot be found | -| 273 | 0x111 | `INET_ERROR_HOST_NAME_TOO_LONG` | A requested host name is too long | -| 274 | 0x112 | `INET_ERROR_INVALID_HOST_NAME` | A requested host name and port is invalid | -| 277 | 0x115 | `INET_ERROR_IDLE_TIMEOUT` | A TCP connection timed out due to inactivity | -| 279 | 0x117 | `INET_ERROR_INVALID_IPV6_PKT` | An IPv6 packet is invalid | -| 280 | 0x118 | `INET_ERROR_INTERFACE_INIT_FAILURE` | Failure to initialize an interface | -| 281 | 0x119 | `INET_ERROR_TCP_USER_TIMEOUT` | TCP Connection timed out waiting for acknowledgment for transmitted packet | -| 282 | 0x11A | `INET_ERROR_TCP_CONNECT_TIMEOUT` | TCP Connection timed out waiting for a successful connection or a report of an error | -| 283 | 0x11B | `INET_ERROR_INCOMPATIBLE_IP_ADDRESS_TYPE` | The supplied text-form IP address was not compatible with the requested IP address type | +| Decimal | Hex | Name | +| ------- | ----- | ----------------------------------------- | +| 257 | 0x101 | `INET_ERROR_WRONG_ADDRESS_TYPE` | +| 258 | 0x102 | `INET_ERROR_PEER_DISCONNECTED` | +| 265 | 0x109 | `INET_ERROR_HOST_NOT_FOUND` | +| 266 | 0x10A | `INET_ERROR_DNS_TRY_AGAIN` | +| 267 | 0x10B | `INET_ERROR_DNS_NO_RECOVERY` | +| 269 | 0x10D | `INET_ERROR_WRONG_PROTOCOL_TYPE` | +| 270 | 0x10E | `INET_ERROR_UNKNOWN_INTERFACE` | +| 272 | 0x110 | `INET_ERROR_ADDRESS_NOT_FOUND` | +| 273 | 0x111 | `INET_ERROR_HOST_NAME_TOO_LONG` | +| 274 | 0x112 | `INET_ERROR_INVALID_HOST_NAME` | +| 277 | 0x115 | `INET_ERROR_IDLE_TIMEOUT` | +| 279 | 0x117 | `INET_ERROR_INVALID_IPV6_PKT` | +| 280 | 0x118 | `INET_ERROR_INTERFACE_INIT_FAILURE` | +| 281 | 0x119 | `INET_ERROR_TCP_USER_TIMEOUT` | +| 282 | 0x11A | `INET_ERROR_TCP_CONNECT_TIMEOUT` | +| 283 | 0x11B | `INET_ERROR_INCOMPATIBLE_IP_ADDRESS_TYPE` | ## SDK Device Layer errors -| Decimal | Hex | Name | Description | -| ------- | ----- | ------------------------------------------- | ----------------------------------------------- | -| 513 | 0x201 | `CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND` | The requested configuration value was not found | -| 514 | 0x202 | `CHIP_DEVICE_ERROR_NOT_SERVICE_PROVISIONED` | The device has not been service provisioned | -| 515 | 0x203 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED` | The software update was aborted by application | -| 516 | 0x204 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED` | The software update was ignored by application | +| Decimal | Hex | Name | +| ------- | ----- | ------------------------------------------- | +| 513 | 0x201 | `CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND` | +| 514 | 0x202 | `CHIP_DEVICE_ERROR_NOT_SERVICE_PROVISIONED` | +| 515 | 0x203 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED` | +| 516 | 0x204 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED` | ## ASN.1 Layer errors -| Decimal | Hex | Name | Description | -| ------- | ----- | --------------------------------- | ------------------------------------------------------------------------------------- | -| 768 | 0x300 | `ASN1_END` | An end of ASN1 container or stream condition occurred | -| 769 | 0x301 | `ASN1_ERROR_UNDERRUN` | The ASN1 encoding ended prematurely | -| 770 | 0x302 | `ASN1_ERROR_OVERFLOW` | The encoding exceeds the available space required to write it | -| 771 | 0x303 | `ASN1_ERROR_INVALID_STATE` | An unexpected or invalid state was encountered | -| 772 | 0x304 | `ASN1_ERROR_MAX_DEPTH_EXCEEDED` | The maximum number of container reading contexts was exceeded | -| 773 | 0x305 | `ASN1_ERROR_INVALID_ENCODING` | The ASN1 encoding is invalid | -| 774 | 0x306 | `ASN1_ERROR_UNSUPPORTED_ENCODING` | An unsupported encoding was requested or encountered | -| 775 | 0x307 | `ASN1_ERROR_TAG_OVERFLOW` | An encoded tag exceeds the available or allowed space required for it | -| 776 | 0x308 | `ASN1_ERROR_LENGTH_OVERFLOW` | An encoded length exceeds the available or allowed space required for it | -| 777 | 0x309 | `ASN1_ERROR_VALUE_OVERFLOW` | An encoded value exceeds the available or allowed space required for it | -| 778 | 0x30A | `ASN1_ERROR_UNKNOWN_OBJECT_ID` | A requested object identifier does not match the list of supported object identifiers | +| Decimal | Hex | Name | +| ------- | ----- | --------------------------------- | +| 768 | 0x300 | `ASN1_END` | +| 769 | 0x301 | `ASN1_ERROR_UNDERRUN` | +| 770 | 0x302 | `ASN1_ERROR_OVERFLOW` | +| 771 | 0x303 | `ASN1_ERROR_INVALID_STATE` | +| 772 | 0x304 | `ASN1_ERROR_MAX_DEPTH_EXCEEDED` | +| 773 | 0x305 | `ASN1_ERROR_INVALID_ENCODING` | +| 774 | 0x306 | `ASN1_ERROR_UNSUPPORTED_ENCODING` | +| 775 | 0x307 | `ASN1_ERROR_TAG_OVERFLOW` | +| 776 | 0x308 | `ASN1_ERROR_LENGTH_OVERFLOW` | +| 777 | 0x309 | `ASN1_ERROR_VALUE_OVERFLOW` | +| 778 | 0x30A | `ASN1_ERROR_UNKNOWN_OBJECT_ID` | ## BLE Layer errors -| Decimal | Hex | Name | Description | -| ------- | ----- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1027 | 0x403 | `BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK` | No callback was registered to receive a BLE Transport Protocol (BTP) connection | -| 1028 | 0x404 | `BLE_ERROR_CENTRAL_UNSUBSCRIBED` | A BLE central device unsubscribed from a peripheral device's BLE Transport Protocol (BTP) transmit characteristic | -| 1029 | 0x405 | `BLE_ERROR_GATT_SUBSCRIBE_FAILED` | A BLE central device failed to subscribe to a peripheral device's BLE Transport Protocol (BTP) transmit characteristic | -| 1030 | 0x406 | `BLE_ERROR_GATT_UNSUBSCRIBE_FAILED` | A BLE central device failed to unsubscribe from a peripheral device's BLE Transport Protocol (BTP) transmit characteristic | -| 1031 | 0x407 | `BLE_ERROR_GATT_WRITE_FAILED` | A General Attribute Profile (GATT) write operation failed | -| 1032 | 0x408 | `BLE_ERROR_GATT_INDICATE_FAILED` | A General Attribute Profile (GATT) indicate operation failed | -| 1035 | 0x40B | `BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT` | A BLE Transport Protocol (BTP) error was encountered | -| 1036 | 0x40C | `BLE_ERROR_REMOTE_DEVICE_DISCONNECTED` | A remote BLE connection peer disconnected, either actively or due to the expiration of a BLE connection supervision timeout | -| 1037 | 0x40D | `BLE_ERROR_APP_CLOSED_CONNECTION` | The local application closed a BLE connection, and has informed BleLayer | -| 1039 | 0x40F | `BLE_ERROR_NOT_CHIP_DEVICE` | A BLE peripheral device did not expose the General Attribute Profile (GATT) service required by the Bluetooth Transport Protocol (BTP) | -| 1040 | 0x410 | `BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS` | A remote device does not offer a compatible version of the Bluetooth Transport Protocol (BTP) | -| 1043 | 0x413 | `BLE_ERROR_INVALID_FRAGMENT_SIZE` | A remote device selected in invalid Bluetooth Transport Protocol (BTP) fragment size | -| 1044 | 0x414 | `BLE_ERROR_START_TIMER_FAILED` | A timer failed to start within BleLayer | -| 1045 | 0x415 | `BLE_ERROR_CONNECT_TIMED_OUT` | A remote BLE peripheral device's Bluetooth Transport Protocol (BTP) connect handshake response timed out | -| 1046 | 0x416 | `BLE_ERROR_RECEIVE_TIMED_OUT` | A remote BLE central device's Bluetooth Transport Protocol (BTP) connect handshake timed out | -| 1047 | 0x417 | `BLE_ERROR_INVALID_MESSAGE` | An invalid Bluetooth Transport Protocol (BTP) message was received | -| 1048 | 0x418 | `BLE_ERROR_FRAGMENT_ACK_TIMED_OUT` | Receipt of an expected Bluetooth Transport Protocol (BTP) fragment acknowledgement timed out | -| 1049 | 0x419 | `BLE_ERROR_KEEP_ALIVE_TIMED_OUT` | Receipt of an expected Bluetooth Transport Protocol (BTP) keep-alive fragment timed out | -| 1050 | 0x41A | `BLE_ERROR_NO_CONNECT_COMPLETE_CALLBACK` | No callback was registered to handle Bluetooth Transport Protocol (BTP) connect completion | -| 1051 | 0x41B | `BLE_ERROR_INVALID_ACK` | A Bluetooth Transport Protcol (BTP) fragment acknowledgement was invalid | -| 1052 | 0x41C | `BLE_ERROR_REASSEMBLER_MISSING_DATA` | A Bluetooth Transport Protocol (BTP) end-of-message fragment was received, but the total size of the received fragments is less than the indicated size of the original fragmented message | -| 1053 | 0x41D | `BLE_ERROR_INVALID_BTP_HEADER_FLAGS` | A set of Bluetooth Transport Protocol (BTP) header flags is invalid | -| 1054 | 0x41E | `BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER` | A Bluetooth Transport Protocol (BTP) fragment sequence number is invalid | -| 1055 | 0x41F | `BLE_ERROR_REASSEMBLER_INCORRECT_STATE` | The Bluetooth Transport Protocol (BTP) message reassembly engine encountered an unexpected state | +| Decimal | Hex | Name | +| ------- | ----- | ------------------------------------------- | +| 1027 | 0x403 | `BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK` | +| 1028 | 0x404 | `BLE_ERROR_CENTRAL_UNSUBSCRIBED` | +| 1029 | 0x405 | `BLE_ERROR_GATT_SUBSCRIBE_FAILED` | +| 1030 | 0x406 | `BLE_ERROR_GATT_UNSUBSCRIBE_FAILED` | +| 1031 | 0x407 | `BLE_ERROR_GATT_WRITE_FAILED` | +| 1032 | 0x408 | `BLE_ERROR_GATT_INDICATE_FAILED` | +| 1035 | 0x40B | `BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT` | +| 1036 | 0x40C | `BLE_ERROR_REMOTE_DEVICE_DISCONNECTED` | +| 1037 | 0x40D | `BLE_ERROR_APP_CLOSED_CONNECTION` | +| 1039 | 0x40F | `BLE_ERROR_NOT_CHIP_DEVICE` | +| 1040 | 0x410 | `BLE_ERROR_INCOMPATIBLE_PROTOCOL_VERSIONS` | +| 1043 | 0x413 | `BLE_ERROR_INVALID_FRAGMENT_SIZE` | +| 1044 | 0x414 | `BLE_ERROR_START_TIMER_FAILED` | +| 1045 | 0x415 | `BLE_ERROR_CONNECT_TIMED_OUT` | +| 1046 | 0x416 | `BLE_ERROR_RECEIVE_TIMED_OUT` | +| 1047 | 0x417 | `BLE_ERROR_INVALID_MESSAGE` | +| 1048 | 0x418 | `BLE_ERROR_FRAGMENT_ACK_TIMED_OUT` | +| 1049 | 0x419 | `BLE_ERROR_KEEP_ALIVE_TIMED_OUT` | +| 1050 | 0x41A | `BLE_ERROR_NO_CONNECT_COMPLETE_CALLBACK` | +| 1051 | 0x41B | `BLE_ERROR_INVALID_ACK` | +| 1052 | 0x41C | `BLE_ERROR_REASSEMBLER_MISSING_DATA` | +| 1053 | 0x41D | `BLE_ERROR_INVALID_BTP_HEADER_FLAGS` | +| 1054 | 0x41E | `BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER` | +| 1055 | 0x41F | `BLE_ERROR_REASSEMBLER_INCORRECT_STATE` | ## IM Global errors errors -| Decimal | Hex | Name | Description | -| ------- | ----- | -------------------------- | ----------- | -| 1280 | 0x500 | `SUCCESS` | | -| 1281 | 0x501 | `FAILURE` | | -| 1405 | 0x57D | `INVALID_SUBSCRIPTION` | | -| 1406 | 0x57E | `UNSUPPORTED_ACCESS` | | -| 1407 | 0x57F | `UNSUPPORTED_ENDPOINT` | | -| 1408 | 0x580 | `INVALID_ACTION` | | -| 1409 | 0x581 | `UNSUPPORTED_COMMAND` | | -| 1413 | 0x585 | `INVALID_COMMAND` | | -| 1414 | 0x586 | `UNSUPPORTED_ATTRIBUTE` | | -| 1415 | 0x587 | `CONSTRAINT_ERROR` | | -| 1416 | 0x588 | `UNSUPPORTED_WRITE` | | -| 1417 | 0x589 | `RESOURCE_EXHAUSTED` | | -| 1419 | 0x58B | `NOT_FOUND` | | -| 1420 | 0x58C | `UNREPORTABLE_ATTRIBUTE` | | -| 1421 | 0x58D | `INVALID_DATA_TYPE` | | -| 1423 | 0x58F | `UNSUPPORTED_READ` | | -| 1426 | 0x592 | `DATA_VERSION_MISMATCH` | | -| 1428 | 0x594 | `TIMEOUT` | | -| 1436 | 0x59C | `BUSY` | | -| 1475 | 0x5C3 | `UNSUPPORTED_CLUSTER` | | -| 1477 | 0x5C5 | `NO_UPSTREAM_SUBSCRIPTION` | | -| 1478 | 0x5C6 | `NEEDS_TIMED_INTERACTION` | | -| 1479 | 0x5C7 | `UNSUPPORTED_EVENT` | | -| 1480 | 0x5C8 | `PATHS_EXHAUSTED` | | -| 1481 | 0x5C9 | `TIMED_REQUEST_MISMATCH` | | -| 1482 | 0x5CA | `FAILSAFE_REQUIRED` | | -| 1520 | 0x5F0 | `WRITE_IGNORED` | | +| Decimal | Hex | Name | +| ------- | ----- | -------------------------- | +| 1280 | 0x500 | `SUCCESS` | +| 1281 | 0x501 | `FAILURE` | +| 1405 | 0x57D | `INVALID_SUBSCRIPTION` | +| 1406 | 0x57E | `UNSUPPORTED_ACCESS` | +| 1407 | 0x57F | `UNSUPPORTED_ENDPOINT` | +| 1408 | 0x580 | `INVALID_ACTION` | +| 1409 | 0x581 | `UNSUPPORTED_COMMAND` | +| 1413 | 0x585 | `INVALID_COMMAND` | +| 1414 | 0x586 | `UNSUPPORTED_ATTRIBUTE` | +| 1415 | 0x587 | `CONSTRAINT_ERROR` | +| 1416 | 0x588 | `UNSUPPORTED_WRITE` | +| 1417 | 0x589 | `RESOURCE_EXHAUSTED` | +| 1419 | 0x58B | `NOT_FOUND` | +| 1420 | 0x58C | `UNREPORTABLE_ATTRIBUTE` | +| 1421 | 0x58D | `INVALID_DATA_TYPE` | +| 1423 | 0x58F | `UNSUPPORTED_READ` | +| 1426 | 0x592 | `DATA_VERSION_MISMATCH` | +| 1428 | 0x594 | `TIMEOUT` | +| 1436 | 0x59C | `BUSY` | +| 1475 | 0x5C3 | `UNSUPPORTED_CLUSTER` | +| 1477 | 0x5C5 | `NO_UPSTREAM_SUBSCRIPTION` | +| 1478 | 0x5C6 | `NEEDS_TIMED_INTERACTION` | +| 1479 | 0x5C7 | `UNSUPPORTED_EVENT` | +| 1480 | 0x5C8 | `PATHS_EXHAUSTED` | +| 1481 | 0x5C9 | `TIMED_REQUEST_MISMATCH` | +| 1482 | 0x5CA | `FAILSAFE_REQUIRED` | +| 1520 | 0x5F0 | `WRITE_IGNORED` | diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp index 4e0d1c8cf731e8..54cc0a74a29635 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp @@ -23,7 +23,6 @@ #include "AppEvent.h" #include "ButtonHandler.h" #include "LEDWidget.h" -#include "qrcodegen.h" #include #include #include diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp index 13eb9e09e01431..a6d17539331230 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp @@ -23,7 +23,6 @@ #include "AppEvent.h" #include "ButtonHandler.h" #include "LEDWidget.h" -#include "qrcodegen.h" #include #include #include diff --git a/examples/darwin-framework-tool/commands/pairing/Commands.h b/examples/darwin-framework-tool/commands/pairing/Commands.h index 164c952ffc2f4f..ffda27b9e3d348 100644 --- a/examples/darwin-framework-tool/commands/pairing/Commands.h +++ b/examples/darwin-framework-tool/commands/pairing/Commands.h @@ -41,12 +41,6 @@ class PairCodeThread : public PairingCommandBridge PairCodeThread() : PairingCommandBridge("code-thread", PairingMode::Code, PairingNetworkType::Thread) {} }; -class PairWithIPAddress : public PairingCommandBridge -{ -public: - PairWithIPAddress() : PairingCommandBridge("ethernet", PairingMode::Ethernet, PairingNetworkType::Ethernet) {} -}; - class PairBleWiFi : public PairingCommandBridge { public: @@ -70,10 +64,13 @@ void registerCommandsPairing(Commands & commands) const char * clusterName = "Pairing"; commands_list clusterCommands = { - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.h b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.h index cf736e0e193387..4885b328c8ad9a 100644 --- a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.h +++ b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.h @@ -24,7 +24,6 @@ enum class PairingMode { None, Code, - Ethernet, Ble, }; @@ -64,12 +63,6 @@ class PairingCommandBridge : public CHIPCommandBridge case PairingMode::Code: AddArgument("payload", &mOnboardingPayload); break; - case PairingMode::Ethernet: - AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); - AddArgument("discriminator", 0, 4096, &mDiscriminator); - AddArgument("device-remote-ip", &ipAddress); - AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort); - break; case PairingMode::Ble: AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); AddArgument("discriminator", 0, 4096, &mDiscriminator); @@ -84,7 +77,6 @@ class PairingCommandBridge : public CHIPCommandBridge private: void PairWithCode(NSError * __autoreleasing * error); void PairWithPayload(NSError * __autoreleasing * error); - void PairWithIPAddress(NSError * __autoreleasing * error); void Unpair(); void SetUpPairingDelegate(); @@ -94,9 +86,7 @@ class PairingCommandBridge : public CHIPCommandBridge chip::ByteSpan mSSID; chip::ByteSpan mPassword; chip::NodeId mNodeId; - uint16_t mRemotePort; uint16_t mDiscriminator; uint32_t mSetupPINCode; char * mOnboardingPayload; - char * ipAddress; }; diff --git a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm index e8fca6ab8771f5..a0292b367c75f9 100644 --- a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm @@ -66,9 +66,6 @@ case PairingMode::Code: PairWithPayload(&error); break; - case PairingMode::Ethernet: - PairWithIPAddress(&error); - break; case PairingMode::Ble: PairWithCode(&error); break; @@ -83,28 +80,21 @@ void PairingCommandBridge::PairWithCode(NSError * __autoreleasing * error) { SetUpPairingDelegate(); + auto * payload = [[MTRSetupPayload alloc] initWithSetupPasscode:@(mSetupPINCode) discriminator:@(mDiscriminator)]; MTRDeviceController * commissioner = CurrentCommissioner(); - [commissioner pairDevice:mNodeId discriminator:mDiscriminator setupPINCode:mSetupPINCode error:error]; + [commissioner setupCommissioningSessionWithPayload:payload newNodeID:@(mNodeId) error:error]; } void PairingCommandBridge::PairWithPayload(NSError * __autoreleasing * error) { - NSString * payload = [NSString stringWithUTF8String:mOnboardingPayload]; - - SetUpPairingDelegate(); - MTRDeviceController * commissioner = CurrentCommissioner(); - [commissioner pairDevice:mNodeId onboardingPayload:payload error:error]; -} - -void PairingCommandBridge::PairWithIPAddress(NSError * __autoreleasing * error) -{ + NSString * onboardingPayload = [NSString stringWithUTF8String:mOnboardingPayload]; SetUpPairingDelegate(); + auto * payload = [MTRSetupPayload setupPayloadWithOnboardingPayload:onboardingPayload error:error]; + if (payload == nil) { + return; + } MTRDeviceController * commissioner = CurrentCommissioner(); - [commissioner pairDevice:mNodeId - address:[NSString stringWithUTF8String:ipAddress] - port:mRemotePort - setupPINCode:mSetupPINCode - error:error]; + [commissioner setupCommissioningSessionWithPayload:payload newNodeID:@(mNodeId) error:error]; } void PairingCommandBridge::Unpair() diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h index 14cd1eef4d4b94..20bf5ea53fdee5 100644 --- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h +++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h @@ -197,7 +197,11 @@ class TestCommandBridge : public CHIPCommandBridge, length:value.payload.size() encoding:NSUTF8StringEncoding]; NSError * err; - BOOL ok = [controller pairDevice:value.nodeId onboardingPayload:payloadStr error:&err]; + auto * payload = [MTRSetupPayload setupPayloadWithOnboardingPayload:payloadStr error:&err]; + if (err != nil) { + return MTRErrorToCHIPErrorCode(err); + } + BOOL ok = [controller setupCommissioningSessionWithPayload:payload newNodeID:@(value.nodeId) error:&err]; if (ok == YES) { return CHIP_NO_ERROR; } diff --git a/examples/java-matter-controller/.gitignore b/examples/java-matter-controller/.gitignore new file mode 100644 index 00000000000000..d59e52c6fd3f22 --- /dev/null +++ b/examples/java-matter-controller/.gitignore @@ -0,0 +1,20 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties + +# Shared libs & JAR libs (those libs are copied into source tree for easy Android build). +*.so +*.jar +*.map diff --git a/examples/java-matter-controller/.gn b/examples/java-matter-controller/.gn new file mode 100644 index 00000000000000..5cd171abcda9ff --- /dev/null +++ b/examples/java-matter-controller/.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2020-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. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + import("//args.gni") +} diff --git a/examples/java-matter-controller/BUILD.gn b/examples/java-matter-controller/BUILD.gn new file mode 100644 index 00000000000000..a82349286cc7e4 --- /dev/null +++ b/examples/java-matter-controller/BUILD.gn @@ -0,0 +1,43 @@ +# 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. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("${build_root}/config/android_abi.gni") +import("${chip_root}/build/chip/java/rules.gni") +import("${chip_root}/build/chip/tools.gni") + +android_binary("java-matter-controller") { + output_name = "java-matter-controller" + + deps = [ + ":android", + "${chip_root}/src/controller/java", + "${chip_root}/src/setup_payload/java", + "${chip_root}/third_party/android_deps:annotation", + ] + + sources = [ "java/src/com/matter/controller/Main.java" ] + + javac_flags = [ "-Xlint:deprecation" ] +} + +java_prebuilt("android") { + jar_path = "${android_sdk_root}/platforms/android-21/android.jar" +} + +group("default") { + deps = [ ":java-matter-controller" ] +} diff --git a/examples/java-matter-controller/Manifest.txt b/examples/java-matter-controller/Manifest.txt new file mode 100644 index 00000000000000..6a121a31a91790 --- /dev/null +++ b/examples/java-matter-controller/Manifest.txt @@ -0,0 +1,2 @@ +Main-Class: com.matter.controller.Main + diff --git a/examples/java-matter-controller/README.md b/examples/java-matter-controller/README.md new file mode 100644 index 00000000000000..daf6d0b2e88927 --- /dev/null +++ b/examples/java-matter-controller/README.md @@ -0,0 +1,67 @@ +# Matter Controller Java App Example + +This is a Matter Controller Java app that can be used to uses Matter to send +messages to a Matter server. + +
+ +- [Matter Controller Java App Example](#matter-controller-java-app-example) + - [Requirements for building](#requirements-for-building) + - [Gradle & JDK Version](#gradle--jdk-version) + - [Preparing for build](#preparing-for-build) + - [Building & Running the app](#building--running-the-app) + +
+ + + +## Requirements for building + +You need Android SDK 21 & NDK downloaded to your machine. Set the +`$ANDROID_HOME` environment variable to where the SDK is downloaded and the +`$ANDROID_NDK_HOME` environment variable to point to where the NDK package is +downloaded. + + + +### Gradle & JDK Version + +We are using Gradle 7.1.1 for all android project which does not support Java 17 +(https://docs.gradle.org/current/userguide/compatibility.html) while the default +JDK version on MacOS for Apple Silicon is 'openjdk 17.0.1' or above. + +Using JDK bundled with Android Studio will help with that. + +```shell +export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home/ +``` + +
+ + + +## Preparing for build + +Complete the following steps to prepare the Matter build: + +1. Check out the Matter repository. + +2. Run bootstrap (**only required first time**) + + ```shell + source scripts/bootstrap.sh + ``` + + + +## Building & Running the app + +This is the simplest option. In the command line, run the following command from +the top Matter directory: + +```shell +./scripts/build/build_examples.py --target android-x86-java-matter-controller build +``` + +The Java executable file `java-matter-controller` will be generated at +`out/android-x86-java-matter-controller/bin/` diff --git a/examples/java-matter-controller/args.gni b/examples/java-matter-controller/args.gni new file mode 100644 index 00000000000000..874fcdc22bb29c --- /dev/null +++ b/examples/java-matter-controller/args.gni @@ -0,0 +1,25 @@ +# Copyright (c) 2020-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. + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/java-matter-controller/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/java-matter-controller/build_overrides b/examples/java-matter-controller/build_overrides new file mode 120000 index 00000000000000..b430cf6a2e6391 --- /dev/null +++ b/examples/java-matter-controller/build_overrides @@ -0,0 +1 @@ +../build_overrides \ No newline at end of file diff --git a/examples/java-matter-controller/include/CHIPProjectAppConfig.h b/examples/java-matter-controller/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..7b8128a9dd2f76 --- /dev/null +++ b/examples/java-matter-controller/include/CHIPProjectAppConfig.h @@ -0,0 +1,65 @@ +/* + * + * Copyright (c) 2020-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. + */ + +/** + * @file + * Project configuration for Matter Controller. + * + */ +#ifndef CHIPPROJECTCONFIG_H +#define CHIPPROJECTCONFIG_H + +#define CHIP_CONFIG_MAX_FABRICS 17 + +#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2 + +#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1 + +// Enable support functions for parsing command-line arguments +#define CHIP_CONFIG_ENABLE_ARG_PARSER 1 + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +// Enable reading DRBG seed data from /dev/(u)random. +// This is needed for test applications and the CHIP device manager to function +// properly when CHIP_CONFIG_RNG_IMPLEMENTATION_CHIPDRBG is enabled. +#define CHIP_CONFIG_DEV_RANDOM_DRBG_SEED 1 + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +#define CHIP_CONFIG_ENABLE_UPDATE 1 + +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 0 + +#define CHIP_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1 + +// Enable some test-only interaction model APIs. +#define CONFIG_BUILD_FOR_HOST_UNIT_TEST 1 + +#endif /* CHIPPROJECTCONFIG_H */ diff --git a/examples/java-matter-controller/java/src/com/matter/controller/Main.java b/examples/java-matter-controller/java/src/com/matter/controller/Main.java new file mode 100644 index 00000000000000..6c2d18189f62d6 --- /dev/null +++ b/examples/java-matter-controller/java/src/com/matter/controller/Main.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 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. + * + */ +package com.matter.controller; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello Matter Controller!"); + + for (String s : args) { + System.out.println(s); + } + } +} diff --git a/examples/java-matter-controller/third_party/connectedhomeip b/examples/java-matter-controller/third_party/connectedhomeip new file mode 120000 index 00000000000000..1b20c9fb816b63 --- /dev/null +++ b/examples/java-matter-controller/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../ \ No newline at end of file diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp index 811f5ec2389cb9..64bd0c189fb377 100644 --- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp @@ -22,7 +22,6 @@ #include "AppEvent.h" #include "ButtonHandler.h" #include "LEDWidget.h" -#include "qrcodegen.h" #include #include #include diff --git a/examples/platform/efr32/wf200/host_if.cpp b/examples/platform/efr32/wf200/host_if.cpp index 58840fc724639c..8015a0cb7a1caa 100644 --- a/examples/platform/efr32/wf200/host_if.cpp +++ b/examples/platform/efr32/wf200/host_if.cpp @@ -565,7 +565,7 @@ static void sl_wfx_ap_client_rejected_callback(uint32_t status, uint8_t * mac) if ((now = xTaskGetTickCount()) > (last_dhcp_poll + pdMS_TO_TICKS(250))) { #if (CHIP_DEVICE_CONFIG_ENABLE_IPV4) - uint8_t dhcp_state = dhcpclient_poll(&sta_netif); + uint8_t dhcp_state = dhcpclient_poll(sta_netif); if ((dhcp_state == DHCP_ADDRESS_ASSIGNED) && !hasNotifiedIPV4) { diff --git a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp index 754d3ef2e86211..081c591fb4e670 100644 --- a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp @@ -91,7 +91,7 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) err = esp_nimble_hci_and_controller_deinit(); #endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - err += esp_bt_mem_release(ESP_BT_MODE_BLE); + err += esp_bt_mem_release(ESP_BT_MODE_BTDM); if (err == ESP_OK) { ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 6c68935123eea7..48ed20a2737c54 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -92,6 +92,7 @@ steps: --target linux-arm64-lock-clang --target linux-arm64-lock-ipv6only-clang --target linux-arm64-minmdns-clang + --target linux-arm64-minmdns-clang-minmdns-verbose --target linux-arm64-ota-provider-nodeps-ipv6only --target linux-arm64-ota-requestor-nodeps-ipv6only --target linux-arm64-shell-ipv6only-clang @@ -102,6 +103,7 @@ steps: --target linux-x64-all-clusters --target linux-x64-all-clusters-nodeps --target linux-x64-all-clusters-nodeps-ipv6only + --target linux-x64-all-clusters-nodeps-ipv6only-minmdns-verbose --target linux-x64-all-clusters-coverage --target linux-x64-all-clusters-ipv6only --target linux-x64-all-clusters-minimal @@ -111,9 +113,11 @@ steps: --target linux-x64-chip-tool --target linux-x64-chip-tool-coverage --target linux-x64-chip-tool-nodeps-ipv6only + --target linux-x64-chip-tool-nodeps-ipv6only-minmdns-verbose --target linux-x64-dynamic-bridge-ipv6only --target linux-x64-efr32-test-runner --target linux-x64-light-rpc-ipv6only + --target linux-x64-light-rpc-ipv6only-minmdns-verbose --target linux-x64-lock-ipv6only --target linux-x64-minmdns --target linux-x64-nl-test-runner diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index f05fa37cd568d1..b618bb46e4a4d8 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -114,11 +114,14 @@ steps: --target linux-x64-bridge-ipv6only --target linux-x64-chip-cert --target linux-x64-chip-tool-ipv6only + --target linux-x64-chip-tool-ipv6only-minmdns-verbose --target linux-x64-dynamic-bridge-ipv6only --target linux-x64-efr32-test-runner --target linux-x64-light-rpc-ipv6only + --target linux-x64-light-rpc-ipv6only-minmdns-verbose --target linux-x64-lock-ipv6only --target linux-x64-minmdns-ipv6only + --target linux-x64-minmdns-ipv6only-minmdns-verbose --target linux-x64-ota-provider-ipv6only --target linux-x64-ota-requestor-ipv6only --target linux-x64-python-bindings diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7916a1089d3b1f..9d869b8a7f1165 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -126,7 +126,8 @@ def BuildHostTarget(): target.AppendModifier('nodeps', enable_ble=False, enable_wifi=False, enable_thread=False, crypto_library=HostCryptoLibrary.MBEDTLS, use_clang=True).ExceptIfRe('-(clang|noble|boringssl|mbedtls)') - target.AppendModifier('libnl', minmdns_address_policy="libnl").OnlyIfRe('-minmdns') + target.AppendModifier('minmdns-verbose', minmdns_high_verbosity=True) + target.AppendModifier('libnl', minmdns_address_policy="libnl") target.AppendModifier('same-event-loop', separate_event_loop=False).OnlyIfRe('-(chip-tool|darwin-framework-tool)') target.AppendModifier('no-interactive', interactive_mode=False).OnlyIfRe('-chip-tool') target.AppendModifier("ipv6only", enable_ipv4=False) @@ -266,6 +267,7 @@ def BuildAndroidTarget(): TargetPart('chip-test', app=AndroidApp.CHIP_TEST), TargetPart('tv-server', app=AndroidApp.TV_SERVER), TargetPart('tv-casting-app', app=AndroidApp.TV_CASTING_APP), + TargetPart('java-matter-controller', app=AndroidApp.JAVA_MATTER_CONTROLLER), ]) return target diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index f16f8964a8db0a..b34382fdc06ca9 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -70,6 +70,7 @@ class AndroidApp(Enum): CHIP_TEST = auto() TV_SERVER = auto() TV_CASTING_APP = auto() + JAVA_MATTER_CONTROLLER = auto() def AppName(self): if self == AndroidApp.CHIP_TOOL: @@ -80,6 +81,8 @@ def AppName(self): return "tv-server" elif self == AndroidApp.TV_CASTING_APP: return "tv-casting" + elif self == AndroidApp.JAVA_MATTER_CONTROLLER: + return "java-matter-controller" else: raise Exception("Unknown app type: %r" % self) @@ -96,6 +99,8 @@ def ExampleName(self): return "tv-app" elif self == AndroidApp.TV_CASTING_APP: return "tv-casting-app" + elif self == AndroidApp.JAVA_MATTER_CONTROLLER: + return "java-matter-controller" else: return None @@ -216,25 +221,11 @@ def copyToSrcAndroid(self): ] ) - def copyToExampleAndroid(self): - jnilibs_dir = os.path.join( - self.root, - "examples", - self.app.ExampleName(), - "android/App/app/libs/jniLibs", - self.board.AbiName(), - ) - libs_dir = os.path.join( - self.root, "examples", self.app.ExampleName(), "android/App/app/libs" - ) + def copyToExampleApp(self, jnilibs_dir, libs_dir, libs, jars): self._Execute( ["mkdir", "-p", jnilibs_dir], title="Prepare Native libs " + self.identifier ) - if self.app.ExampleName() == "tv-casting-app": - libs = ["libc++_shared.so", "libTvCastingApp.so"] - else: - libs = ["libSetupPayloadParser.so", "libc++_shared.so", "libTvApp.so"] for libName in libs: self._Execute( [ @@ -246,19 +237,6 @@ def copyToExampleAndroid(self): ] ) - if self.app.ExampleName() == "tv-casting-app": - jars = { - "AndroidPlatform.jar": "third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar", - "CHIPAppServer.jar": "third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar", - "TvCastingApp.jar": "TvCastingApp.jar", - } - else: - jars = { - "SetupPayloadParser.jar": "third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar", - "AndroidPlatform.jar": "third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar", - "CHIPAppServer.jar": "third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar", - "TvApp.jar": "TvApp.jar", - } for jarName in jars.keys(): self._Execute( [ @@ -316,6 +294,16 @@ def gradlewBuildExampleAndroid(self): title="Building Example " + self.identifier, ) + def createJavaExecutable(self, java_program): + self._Execute( + [ + "chmod", + "+x", + "%s/bin/%s" % (self.output_dir, java_program), + ], + title="Make Java program executable", + ) + def generate(self): self._Execute( ["python3", "third_party/android_deps/set_up_android_deps.py"], @@ -356,7 +344,10 @@ def generate(self): exampleName = self.app.ExampleName() if exampleName is not None: - gn_gen += ["--root=%s/examples/%s/android/" % (self.root, exampleName)] + if exampleName == "java-matter-controller": + gn_gen += ["--root=%s/examples/%s/" % (self.root, exampleName)] + else: + gn_gen += ["--root=%s/examples/%s/android/" % (self.root, exampleName)] if self.board.IsIde(): gn_gen += [ @@ -387,6 +378,17 @@ def generate(self): title="Accepting NDK licenses @ tools", ) + app_dir = os.path.join(self.root, "examples/", self.app.AppName()) + if exampleName == "java-matter-controller": + self._Execute( + [ + "cp", + os.path.join(app_dir, "Manifest.txt"), + self.output_dir, + ], + title="Copying Manifest.txt to " + self.output_dir, + ) + def _build(self): if self.board.IsIde(): # App compilation IDE @@ -413,8 +415,78 @@ def _build(self): if exampleName is None: self.copyToSrcAndroid() self.gradlewBuildSrcAndroid() - else: - self.copyToExampleAndroid() + elif exampleName == "java-matter-controller": + jnilibs_dir = os.path.join( + self.root, + "examples/", + self.app.ExampleName(), + "app/libs/jniLibs", + self.board.AbiName(), + ) + + libs_dir = os.path.join( + self.root, "examples/", self.app.ExampleName(), "app/libs" + ) + + libs = [ + "libSetupPayloadParser.so", + "libCHIPController.so", + "libc++_shared.so", + ] + + jars = { + "CHIPController.jar": "third_party/connectedhomeip/src/controller/java/CHIPController.jar", + "SetupPayloadParser.jar": "third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar", + } + + self.copyToExampleApp(jnilibs_dir, libs_dir, libs, jars) + self.createJavaExecutable("java-matter-controller") + elif exampleName == "tv-casting-app": + jnilibs_dir = os.path.join( + self.root, + "examples/", + self.app.ExampleName(), + "android/App/app/libs/jniLibs", + self.board.AbiName(), + ) + + libs_dir = os.path.join( + self.root, "examples/", self.app.ExampleName(), "android/App/app/libs" + ) + + libs = ["libc++_shared.so", "libTvCastingApp.so"] + + jars = { + "AndroidPlatform.jar": "third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar", + "CHIPAppServer.jar": "third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar", + "TvCastingApp.jar": "TvCastingApp.jar", + } + + self.copyToExampleApp(jnilibs_dir, libs_dir, libs, jars) + self.gradlewBuildExampleAndroid() + elif exampleName == "tv-app": + jnilibs_dir = os.path.join( + self.root, + "examples/", + self.app.ExampleName(), + "android/App/app/libs/jniLibs", + self.board.AbiName(), + ) + + libs_dir = os.path.join( + self.root, "examples/", self.app.ExampleName(), "android/App/app/libs" + ) + + libs = ["libSetupPayloadParser.so", "libc++_shared.so", "libTvApp.so"] + + jars = { + "SetupPayloadParser.jar": "third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar", + "AndroidPlatform.jar": "third_party/connectedhomeip/src/platform/android/AndroidPlatform.jar", + "CHIPAppServer.jar": "third_party/connectedhomeip/src/app/server/java/CHIPAppServer.jar", + "TvApp.jar": "TvApp.jar", + } + + self.copyToExampleApp(jnilibs_dir, libs_dir, libs, jars) self.gradlewBuildExampleAndroid() def build_outputs(self): diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index af6c19ffe93462..ce735ad7ecde16 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -222,6 +222,7 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, use_platform_mdns=False, enable_rpcs=False, use_coverage=False, use_dmalloc=False, minmdns_address_policy=None, + minmdns_high_verbosity=False, crypto_library: HostCryptoLibrary = None): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), @@ -297,6 +298,9 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, self.extra_gn_options.append( 'chip_im_force_fabric_quota_check=true') + if minmdns_high_verbosity: + self.extra_gn_options.append('chip_minmdns_high_verbosity=true') + if app == HostApp.TESTS: self.extra_gn_options.append('chip_build_tests=true') self.build_command = 'check' diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 74d46221b04d61..472a8cba47860c 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,5 +1,5 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,pigweed} -android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app} +android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller} bl602-light bouffalolab-{bl706-iot-dvk,bl706-night-light}-light[-rpc] cc13x2x7_26x2x7-{all-clusters,all-clusters-minimal,lock,pump,pump-controller,shell}[-ftd][-mtd] @@ -8,7 +8,7 @@ efr32-{brd4161a,brd4187c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-requestor,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,minmdns,light,light-rpc,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool}[-nodeps][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang][-test] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,minmdns,light,light-rpc,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool}[-nodeps][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang][-test] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] diff --git a/scripts/error_table.py b/scripts/error_table.py index 5bd1e7a1832acd..46096e84a03afd 100644 --- a/scripts/error_table.py +++ b/scripts/error_table.py @@ -28,6 +28,7 @@ from enum import IntEnum from pathlib import Path from operator import attrgetter +from xml.etree.ElementInclude import include @dataclass @@ -43,7 +44,7 @@ class ErrorDescriptor: code_range: int # `macro_regex` needs to have `code` and `name` named groups. macro_regex: str - omit_description: bool = False + include_description: bool = False class CommentState(IntEnum): @@ -83,7 +84,7 @@ def _process_error_extract(self, descriptor: ErrorDescriptor, line: str): code = descriptor.code_range | code name = match.group("name") - description = "" if descriptor.omit_description else last_comment + description = last_comment if descriptor.include_description else "" self._error_codes.append(ErrorCode(code=code, name=name, description=description)) def load_error_header(self, filename: Path, descriptor: ErrorDescriptor) -> list[ErrorCode]: @@ -112,11 +113,18 @@ def dump_table(header_path: Path, descriptor: ErrorDescriptor): markdown_title, _ = get_section_title(descriptor.section) print(f"## {markdown_title}") print() - print("| Decimal | Hex | Name | Description |") - print("| --- | --- | --- | --- |") + if descriptor.include_description: + print("| Decimal | Hex | Name | Description |") + print("| --- | --- | --- | --- |") + else: + print("| Decimal | Hex | Name |") + print("| --- | --- | --- |") for code in sorted(codes_for_section, key=attrgetter("code")): - print(f"| {code.code} | 0x{code.code:02X} | `{code.name}` | {code.description} |") + if descriptor.include_description: + print(f"| {code.code} | 0x{code.code:02X} | `{code.name}` | {code.description} |") + else: + print(f"| {code.code} | 0x{code.code:02X} | `{code.name}` |") print() @@ -128,9 +136,12 @@ def main(): "src/include/platform/CHIPDeviceError.h": ErrorDescriptor(section="SDK Device Layer", code_range=0x200, macro_regex=r"^#define\s+(?P[_A-Z0-9]+)\s+CHIP_DEVICE_ERROR[(](?P(0x[a-fA-F0-9]+)|\d+)[)]"), "src/lib/asn1/ASN1Error.h": ErrorDescriptor(section="ASN.1 Layer", code_range=0x300, macro_regex=r"^#define\s+(?P[_A-Z0-9]+)\s+CHIP_ASN1_ERROR[(](?P(0x[a-fA-F0-9]+)|\d+)[)]"), "src/ble/BleError.h": ErrorDescriptor(section="BLE Layer", code_range=0x400, macro_regex=r"^#define\s+(?P[_A-Z0-9]+)\s+CHIP_BLE_ERROR[(](?P(0x[a-fA-F0-9]+)|\d+)[)]"), - "src/protocols/interaction_model/StatusCodeList.h": ErrorDescriptor(section="IM Global errors", code_range=0x500, macro_regex=r"^CHIP_IM_STATUS_CODE[(][A-Za-z0-9_]+\s*,\s*(?P[A-Z0-9_]+)\s*,\s*(?P(0x[a-fA-F0-9]+)|\d+)[)]", omit_description=True), + "src/protocols/interaction_model/StatusCodeList.h": ErrorDescriptor(section="IM Global errors", code_range=0x500, macro_regex=r"^CHIP_IM_STATUS_CODE[(][A-Za-z0-9_]+\s*,\s*(?P[A-Z0-9_]+)\s*,\s*(?P(0x[a-fA-F0-9]+)|\d+)[)]"), } + print() + print("[//]: # (start_ignore_spellcheck)") + print() print("# Matter SDK `CHIP_ERROR` enums values") print() print("This file was **AUTOMATICALLY** generated by `python scripts/error_table.py > docs/ERROR_CODES.md`.") @@ -146,6 +157,8 @@ def main(): for filename, descriptor in descriptors.items(): dump_table(Path(filename), descriptor) + print("[//]: # (end_ignore_spellcheck)") + if __name__ == "__main__": main() diff --git a/scripts/tests/chiptest/lsan-mac-suppressions.txt b/scripts/tests/chiptest/lsan-mac-suppressions.txt index fad4a1e0971248..0b7f0d0a3c8a08 100644 --- a/scripts/tests/chiptest/lsan-mac-suppressions.txt +++ b/scripts/tests/chiptest/lsan-mac-suppressions.txt @@ -19,17 +19,6 @@ leak:drbg_bytes # TODO: OpenSSL ERR_get_state seems to leak. leak:ERR_get_state -# TODO: BLE initialization allocates some UUIDs and strings that seem to leak. -leak:[BleConnection initWithDiscriminator:] -leak:[CBXpcConnection initWithDelegate:queue:options:sessionType:] - -# TODO: Figure out how we are managing to leak NSData while using ARC! -leak:[CHIPToolKeypair signMessageECDSA_RAW:] - -# TODO: Figure out how we are managing to leak NSData while using ARC, though -# this may just be a leak deep inside the CFPreferences stuff somewhere. -leak:[CHIPToolPersistentStorageDelegate storageDataForKey:] - # TODO: https://github.com/project-chip/connectedhomeip/issues/22333 leak:[MTRBaseCluster* subscribeAttribute*WithMinInterval:maxInterval:params:subscriptionEstablished:reportHandler:] diff --git a/src/app/zap-templates/app-templates.json b/src/app/zap-templates/app-templates.json index 05dfde001ff3f2..b79bb4f13e7266 100644 --- a/src/app/zap-templates/app-templates.json +++ b/src/app/zap-templates/app-templates.json @@ -15,14 +15,6 @@ "name": "header", "path": "partials/header.zapt" }, - { - "name": "clusters_header", - "path": "partials/clusters_header.zapt" - }, - { - "name": "cluster_header", - "path": "partials/cluster_header.zapt" - }, { "name": "im_command_handler_cluster_commands", "path": "partials/im_command_handler_cluster_commands.zapt" diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index a7467520083af9..de46330af677b8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -39,6 +39,38 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS */ @property (readonly, nonatomic, nullable) NSNumber * controllerNodeId; +/** + * Set up a commissioning session for a device, using the provided setup payload + * to discover it and connect to it. + * + * @param payload a setup payload (probably created from a QR code or numeric + * code onboarding payload). + * @param newNodeID the planned node id for the node. + * @error error indication if discovery can't start at all (e.g. because the + * setup payload is invalid). + * + * The IP and port for the device will be discovered automatically based on the + * provided discriminator. + * + * Then a PASE session will be established with the device, unless an error + * occurs. MTRDevicePairingDelegate will be notified as follows: + * + * * Discovery fails: onStatusUpdate with MTRPairingStatusFailed. + * + * * Discovery succeeds but commissioning session setup fails: onPairingComplete + * with an error. + * + * * Commissioning session setup succeeds: onPairingComplete with no error. + * + * Once a commissioning session is set up, getDeviceBeingCommissioned + * can be used to get an MTRBaseDevice and discover what sort of network + * credentials the device might need, and commissionDevice can be used to + * commission the device. + */ +- (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload + newNodeID:(NSNumber *)newNodeID + error:(NSError * __autoreleasing *)error; + /** * Start pairing for a device with the given ID, using the provided setup PIN * to establish a PASE connection. diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 7ff7d59a80072d..bbf793d25a4ff4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -361,6 +361,36 @@ - (NSNumber *)controllerNodeId return nodeID; } +- (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload + newNodeID:(NSNumber *)newNodeID + error:(NSError * __autoreleasing *)error +{ + VerifyOrReturnValue([self checkIsRunning:error], NO); + + __block BOOL success = NO; + dispatch_sync(_chipWorkQueue, ^{ + VerifyOrReturn([self checkIsRunning:error]); + + // Try to get a QR code if possible (because it has a better + // discriminator, etc), then fall back to manual code if that fails. + NSString * pairingCode = [payload qrCodeString:nil]; + if (pairingCode == nil) { + pairingCode = [payload manualEntryCode]; + } + if (pairingCode == nil) { + success = ![self checkForError:CHIP_ERROR_INVALID_ARGUMENT logMsg:kErrorSetupCodeGen error:error]; + return; + } + + chip::NodeId nodeId = [newNodeID unsignedLongLongValue]; + _operationalCredentialsDelegate->SetDeviceID(nodeId); + CHIP_ERROR errorCode = self.cppCommissioner->EstablishPASEConnection(nodeId, [pairingCode UTF8String]); + success = ![self checkForError:errorCode logMsg:kErrorPairDevice error:error]; + }); + + return success; +} + - (BOOL)pairDevice:(uint64_t)deviceID discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m index 54463a59f99a65..d8c2df5290514b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m @@ -46,6 +46,17 @@ + (MTRDeviceControllerOverXPC *)sharedControllerWithId:(id _Nullable) connectBlock:connectBlock]; } +- (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload + newNodeID:(NSNumber *)newNodeID + error:(NSError * __autoreleasing *)error +{ + MTR_LOG_ERROR("MTRDeviceController doesn't support setupCommissioningSessionWithPayload over XPC"); + if (error != nil) { + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeInvalidState userInfo:nil]; + } + return NO; +} + - (BOOL)pairDevice:(uint64_t)deviceID discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.h b/src/darwin/Framework/CHIP/MTRSetupPayload.h index de50f84211eeae..c5734e8dda6705 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.h +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.h @@ -81,9 +81,31 @@ typedef NS_ENUM(NSUInteger, MTROptionalQRCodeInfoType) { */ + (NSNumber *)generateRandomSetupPasscode; +/** + * Create an MTRSetupPayload with the given onboarding payload. + * + * Will return nil on errors (e.g. if the onboarding payload cannot be parsed). + */ ++ (MTRSetupPayload * _Nullable)setupPayloadWithOnboardingPayload:(NSString *)onboardingPayload + error:(NSError * __autoreleasing *)error; + +/** + * Initialize an MTRSetupPayload with the given passcode and discriminator. + * This will pre-set version, product id, and vendor id to 0. + */ +- (instancetype)initWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator; + /** Get 11 digit manual entry code from the setup payload. */ - (nullable NSString *)manualEntryCode; +/** + * Get a QR code from the setup payload. + * + * Returns nil on failure (e.g. if the setup payload does not have all the + * information a QR code needs). + */ +- (NSString * _Nullable)qrCodeString:(NSError * __autoreleasing *)error; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 3f058023bc45eb..159af529f813e0 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -17,8 +17,10 @@ #import "MTRError.h" #import "MTRError_Internal.h" +#import "MTROnboardingPayloadParser.h" #import "MTRSetupPayload_Internal.h" #import "setup_payload/ManualSetupPayloadGenerator.h" +#import "setup_payload/QRCodeSetupPayloadGenerator.h" #import @implementation MTROptionalQRCodeInfo @@ -47,6 +49,27 @@ - (NSNumber *)convertRendezvousFlags:(const chip::Optional)unconvertRendezvousFlags:(nullable NSNumber *)nullableValue +{ + if (nullableValue == nil) { + return chip::NullOptional; + } + + MTRDiscoveryCapabilities value = static_cast([nullableValue unsignedLongValue]); + + chip::RendezvousInformationFlags flags; + if (value & MTRDiscoveryCapabilitiesBLE) { + flags.Set(chip::RendezvousInformationFlag::kBLE); + } + if (value & MTRDiscoveryCapabilitiesSoftAP) { + flags.Set(chip::RendezvousInformationFlag::kSoftAP); + } + if (value & MTRDiscoveryCapabilitiesOnNetwork) { + flags.Set(chip::RendezvousInformationFlag::kOnNetwork); + } + return chip::MakeOptional(flags); +} + - (MTRCommissioningFlow)convertCommissioningFlow:(chip::CommissioningFlow)value { if (value == chip::CommissioningFlow::kStandard) { @@ -61,7 +84,23 @@ - (MTRCommissioningFlow)convertCommissioningFlow:(chip::CommissioningFlow)value return MTRCommissioningFlowInvalid; } -- (id)initWithSetupPayload:(chip::SetupPayload)setupPayload ++ (chip::CommissioningFlow)unconvertCommissioningFlow:(MTRCommissioningFlow)value +{ + if (value == MTRCommissioningFlowStandard) { + return chip::CommissioningFlow::kStandard; + } + if (value == MTRCommissioningFlowUserActionRequired) { + return chip::CommissioningFlow::kUserActionRequired; + } + if (value == MTRCommissioningFlowCustom) { + return chip::CommissioningFlow::kCustom; + } + // It's MTRCommissioningFlowInvalid ... now what? But in practice + // this is not called when we have MTRCommissioningFlowInvalid. + return chip::CommissioningFlow::kStandard; +} + +- (instancetype)initWithSetupPayload:(chip::SetupPayload)setupPayload { if (self = [super init]) { _chipSetupPayload = setupPayload; @@ -83,6 +122,22 @@ - (id)initWithSetupPayload:(chip::SetupPayload)setupPayload return self; } +- (instancetype)initWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator +{ + if (self = [super init]) { + _version = @(0); // Only supported Matter version so far. + _vendorID = @(0); // Not available. + _productID = @(0); // Not available. + _commissioningFlow = MTRCommissioningFlowStandard; + _rendezvousInformation = nil; + _hasShortDiscriminator = NO; + _discriminator = discriminator; + _setUpPINCode = setupPasscode; + _serialNumber = nil; + } + return self; +} + - (void)getSerialNumber:(chip::SetupPayload)setupPayload { std::string serialNumberC; @@ -143,6 +198,13 @@ + (NSNumber *)generateRandomSetupPasscode return @(chip::kSetupPINCodeUndefinedValue); } ++ (MTRSetupPayload * _Nullable)setupPayloadWithOnboardingPayload:(NSString *)onboardingPayload + error:(NSError * __autoreleasing *)error +{ + // TODO: Do we actually need the MTROnboardingPayloadParser abstraction? + return [MTROnboardingPayloadParser setupPayloadForOnboardingPayload:onboardingPayload error:error]; +} + #pragma mark - NSSecureCoding static NSString * const MTRSetupPayloadCodingKeyVersion = @"MTRSP.ck.version"; @@ -227,4 +289,53 @@ - (nullable NSString *)manualEntryCode return [NSString stringWithUTF8String:outDecimalString.c_str()]; } +- (NSString * _Nullable)qrCodeString:(NSError * __autoreleasing *)error +{ + if (self.commissioningFlow == MTRCommissioningFlowInvalid) { + // No idea how to map this to the standard codes. + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + return nil; + } + + if (self.hasShortDiscriminator) { + // Can't create a QR code with a short discriminator. + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + return nil; + } + + if (self.rendezvousInformation == nil) { + // Can't create a QR code if we don't know the discovery capabilities. + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + return nil; + } + + chip::SetupPayload payload; + + payload.version = [self.version unsignedCharValue]; + payload.vendorID = [self.vendorID unsignedShortValue]; + payload.productID = [self.productID unsignedShortValue]; + payload.commissioningFlow = [MTRSetupPayload unconvertCommissioningFlow:self.commissioningFlow]; + payload.rendezvousInformation = [MTRSetupPayload unconvertRendezvousFlags:self.rendezvousInformation]; + payload.discriminator.SetLongValue([self.discriminator unsignedShortValue]); + payload.setUpPINCode = [self.setUpPINCode unsignedIntValue]; + + std::string outDecimalString; + CHIP_ERROR err = chip::QRCodeSetupPayloadGenerator(payload).payloadBase38Representation(outDecimalString); + + if (err != CHIP_NO_ERROR) { + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + return [NSString stringWithUTF8String:outDecimalString.c_str()]; +} + @end diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload_Internal.h b/src/darwin/Framework/CHIP/MTRSetupPayload_Internal.h index 4abd9d9e8a5b05..1436decc816392 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload_Internal.h +++ b/src/darwin/Framework/CHIP/MTRSetupPayload_Internal.h @@ -17,7 +17,7 @@ @interface MTRSetupPayload () #ifdef __cplusplus -- (id)initWithSetupPayload:(chip::SetupPayload)setupPayload; +- (instancetype)initWithSetupPayload:(chip::SetupPayload)setupPayload; - (NSNumber *)convertRendezvousFlags:(const chip::Optional &)value; - (MTRCommissioningFlow)convertCommissioningFlow:(chip::CommissioningFlow)value; #endif diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index e2480742783907..c5a0643a6db9ff 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -42,11 +42,9 @@ static const uint16_t kCASESetupTimeoutInSeconds = 30; static const uint16_t kTimeoutInSeconds = 3; static const uint64_t kDeviceId = 0x12344321; -static const uint32_t kSetupPINCode = 20202021; -static const uint16_t kRemotePort = 5540; +static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; static const uint16_t kLocalPort = 5541; -static NSString * kAddress = @"::1"; -static uint16_t kTestVendorId = 0xFFF1u; +static const uint16_t kTestVendorId = 0xFFF1u; // This test suite reuses a device object to speed up the test process for CI. // The following global variable holds the reference to the device object. @@ -178,8 +176,12 @@ - (void)initStack [controller setPairingDelegate:pairing queue:callbackQueue]; NSError * error; - [controller pairDevice:kDeviceId address:kAddress port:kRemotePort setupPINCode:kSetupPINCode error:&error]; - XCTAssertEqual(error.code, 0); + __auto_type * payload = [MTRSetupPayload setupPayloadWithOnboardingPayload:kOnboardingPayload error:&error]; + XCTAssertNotNil(payload); + XCTAssertNil(error); + + [controller setupCommissioningSessionWithPayload:payload newNodeID:@(kDeviceId) error:&error]; + XCTAssertNil(error); [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; diff --git a/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m b/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m index e4ae881b3c45bb..ec592d75f20bad 100644 --- a/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m +++ b/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m @@ -436,10 +436,8 @@ - (void)readAttributeCacheWithController:(id _Nullable)controller static const uint16_t kCASESetupTimeoutInSeconds = 30; static const uint16_t kTimeoutInSeconds = 3; static const uint64_t kDeviceId = 0x12344321; -static const uint32_t kSetupPINCode = 20202021; -static const uint16_t kRemotePort = 5540; +static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; static const uint16_t kLocalPort = 5541; -static NSString * kAddress = @"::1"; // This test suite reuses a device object to speed up the test process for CI. // The following global variable holds the reference to the device object. @@ -544,8 +542,12 @@ - (void)initStack [controller setPairingDelegate:pairing queue:callbackQueue]; NSError * error; - [controller pairDevice:kDeviceId address:kAddress port:kRemotePort setupPINCode:kSetupPINCode error:&error]; - XCTAssertEqual(error.code, 0); + __auto_type * payload = [MTRSetupPayload setupPayloadWithOnboardingPayload:kOnboardingPayload error:&error]; + XCTAssertNotNil(payload); + XCTAssertNil(error); + + [controller setupCommissioningSessionWithPayload:payload newNodeID:@(kDeviceId) error:&error]; + XCTAssertNil(error); [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index f9c3d086aecefa..d18c4af235cb3d 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -40,7 +40,7 @@ #endif #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_PAIRING_PASSCODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE #endif #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp index 842ec4d7392fa5..f1866fc83fb8e5 100644 --- a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp @@ -213,8 +213,8 @@ void FlashHandler::DoAction(Action aAction) { #if CONFIG_PM_DEVICE && CONFIG_NORDIC_QSPI_NOR && !CONFIG_SOC_NRF52840 // nRF52 is optimized per default // utilize the QSPI driver sleep power mode - const auto * qspi_dev = device_get_binding(DT_LABEL(DT_INST(0, nordic_qspi_nor))); - if (qspi_dev) + const auto * qspi_dev = DEVICE_DT_GET(DT_INST(0, nordic_qspi_nor)); + if (device_is_ready(qspi_dev)) { const auto requestedAction = Action::WAKE_UP == aAction ? PM_DEVICE_ACTION_RESUME : PM_DEVICE_ACTION_SUSPEND; (void) pm_device_action_run(qspi_dev, requestedAction); // not much can be done in case of a failure