Skip to content

Commit 1888722

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Change the VendorID attribute in Basic Information to the vendor_id type. (#13110)
1 parent 6eaa7bb commit 1888722

File tree

34 files changed

+153
-57
lines changed

34 files changed

+153
-57
lines changed

src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class BasicClientFragment : Fragment() {
179179
}
180180

181181
private suspend fun sendReadVendorIDAttribute() {
182-
getBasicClusterForDevice().readVendorIDAttribute(object : ChipClusters.IntegerAttributeCallback {
182+
getBasicClusterForDevice().readVendorIDAttribute(object : ChipClusters.BasicCluster.VendorIDAttributeCallback {
183183
override fun onSuccess(value: Int) {
184184
Log.i(TAG,"[Read Success] VendorID: $value")
185185
showMessage("[Read Success] VendorID: $value")

src/app/clusters/basic/basic.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint)
209209
uint16_t vendorId;
210210
if (ConfigurationMgr().GetVendorId(vendorId) == CHIP_NO_ERROR)
211211
{
212-
status = Attributes::VendorID::Set(endpoint, vendorId);
212+
status = Attributes::VendorID::Set(endpoint, static_cast<VendorId>(vendorId));
213213
VerifyOrdo(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Vendor Id: 0x%02x", status));
214214
}
215215

src/app/clusters/ota-requestor/OTARequestor.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ CHIP_ERROR OTARequestor::SendQueryImageRequest(OperationalDeviceProxy & devicePr
374374
constexpr OTADownloadProtocol kProtocolsSupported[] = { OTADownloadProtocol::kBDXSynchronous };
375375
QueryImage::Type args;
376376

377-
uint16_t vendorId;
378-
VerifyOrReturnError(Basic::Attributes::VendorID::Get(kRootEndpointId, &vendorId) == EMBER_ZCL_STATUS_SUCCESS,
377+
VerifyOrReturnError(Basic::Attributes::VendorID::Get(kRootEndpointId, &args.vendorId) == EMBER_ZCL_STATUS_SUCCESS,
379378
CHIP_ERROR_READ_FAILED);
380-
args.vendorId = static_cast<VendorId>(vendorId);
381379

382380
VerifyOrReturnError(Basic::Attributes::ProductID::Get(kRootEndpointId, &args.productId) == EMBER_ZCL_STATUS_SUCCESS,
383381
CHIP_ERROR_READ_FAILED);

src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ limitations under the License.
2626

2727
<attribute side="server" code="0" define="INTERACTION_MODEL_VERSION" type="int16u" default="1" >InteractionModelVersion</attribute>
2828
<attribute side="server" code="1" define="VENDOR_NAME" type="char_string" length="32" >VendorName</attribute>
29-
<attribute side="server" code="2" define="VENDOR_ID" type="int16u" >VendorID</attribute>
29+
<attribute side="server" code="2" define="VENDOR_ID" type="vendor_id" >VendorID</attribute>
3030
<attribute side="server" code="3" define="PRODUCT_NAME" type="char_string" length="32" >ProductName</attribute>
3131
<attribute side="server" code="4" define="PRODUCT_ID" type="int16u" >ProductID</attribute>
3232
<attribute side="server" code="5" define="NODE_LABEL" type="char_string" length="32" default="" writable="true" >NodeLabel</attribute>

src/controller/CHIPDeviceController.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ void DeviceController::OnPIDReadResponse(void * context, uint16_t value)
370370
}
371371
}
372372

373-
void DeviceController::OnVIDReadResponse(void * context, uint16_t value)
373+
void DeviceController::OnVIDReadResponse(void * context, VendorId value)
374374
{
375-
ChipLogProgress(Controller, "Received VID for the device. Value %d", value);
375+
ChipLogProgress(Controller, "Received VID for the device. Value %d", to_underlying(value));
376376

377377
DeviceController * controller = static_cast<DeviceController *>(context);
378378

src/controller/CHIPDeviceController.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate,
397397
Callback::Callback<DefaultFailureCallback> mOpenPairingFailureCallback;
398398

399399
static void OnPIDReadResponse(void * context, uint16_t value);
400-
static void OnVIDReadResponse(void * context, uint16_t value);
400+
static void OnVIDReadResponse(void * context, VendorId value);
401401
static void OnVIDPIDReadFailureResponse(void * context, EmberAfStatus status);
402402

403403
CHIP_ERROR OpenCommissioningWindowInternal();

src/controller/java/zap-generated/CHIPClusters-JNI.cpp

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPReadCallbacks.cpp

+58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/CHIPReadCallbacks.h

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java

+12-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/all-clusters-app/zap-generated/endpoint_config.h

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)