Skip to content

Commit

Permalink
Change the VendorID attribute in Basic Information to the vendor_id t…
Browse files Browse the repository at this point in the history
…ype. (#13110)
  • Loading branch information
bzbarsky-apple authored Jan 6, 2022
1 parent a9982ae commit 4112be5
Show file tree
Hide file tree
Showing 34 changed files with 153 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class BasicClientFragment : Fragment() {
}

private suspend fun sendReadVendorIDAttribute() {
getBasicClusterForDevice().readVendorIDAttribute(object : ChipClusters.IntegerAttributeCallback {
getBasicClusterForDevice().readVendorIDAttribute(object : ChipClusters.BasicCluster.VendorIDAttributeCallback {
override fun onSuccess(value: Int) {
Log.i(TAG,"[Read Success] VendorID: $value")
showMessage("[Read Success] VendorID: $value")
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/basic/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint)
uint16_t vendorId;
if (ConfigurationMgr().GetVendorId(vendorId) == CHIP_NO_ERROR)
{
status = Attributes::VendorID::Set(endpoint, vendorId);
status = Attributes::VendorID::Set(endpoint, static_cast<VendorId>(vendorId));
VerifyOrdo(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Vendor Id: 0x%02x", status));
}

Expand Down
4 changes: 1 addition & 3 deletions src/app/clusters/ota-requestor/OTARequestor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,8 @@ CHIP_ERROR OTARequestor::SendQueryImageRequest(OperationalDeviceProxy & devicePr
constexpr OTADownloadProtocol kProtocolsSupported[] = { OTADownloadProtocol::kBDXSynchronous };
QueryImage::Type args;

uint16_t vendorId;
VerifyOrReturnError(Basic::Attributes::VendorID::Get(kRootEndpointId, &vendorId) == EMBER_ZCL_STATUS_SUCCESS,
VerifyOrReturnError(Basic::Attributes::VendorID::Get(kRootEndpointId, &args.vendorId) == EMBER_ZCL_STATUS_SUCCESS,
CHIP_ERROR_READ_FAILED);
args.vendorId = static_cast<VendorId>(vendorId);

VerifyOrReturnError(Basic::Attributes::ProductID::Get(kRootEndpointId, &args.productId) == EMBER_ZCL_STATUS_SUCCESS,
CHIP_ERROR_READ_FAILED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.

<attribute side="server" code="0" define="INTERACTION_MODEL_VERSION" type="int16u" default="1" >InteractionModelVersion</attribute>
<attribute side="server" code="1" define="VENDOR_NAME" type="char_string" length="32" >VendorName</attribute>
<attribute side="server" code="2" define="VENDOR_ID" type="int16u" >VendorID</attribute>
<attribute side="server" code="2" define="VENDOR_ID" type="vendor_id" >VendorID</attribute>
<attribute side="server" code="3" define="PRODUCT_NAME" type="char_string" length="32" >ProductName</attribute>
<attribute side="server" code="4" define="PRODUCT_ID" type="int16u" >ProductID</attribute>
<attribute side="server" code="5" define="NODE_LABEL" type="char_string" length="32" default="" writable="true" >NodeLabel</attribute>
Expand Down
4 changes: 2 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ void DeviceController::OnPIDReadResponse(void * context, uint16_t value)
}
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate,
Callback::Callback<DefaultFailureCallback> mOpenPairingFailureCallback;

static void OnPIDReadResponse(void * context, uint16_t value);
static void OnVIDReadResponse(void * context, uint16_t value);
static void OnVIDReadResponse(void * context, VendorId value);
static void OnVIDPIDReadFailureResponse(void * context, EmberAfStatus status);

CHIP_ERROR OpenCommissioningWindowInternal();
Expand Down
7 changes: 4 additions & 3 deletions src/controller/java/zap-generated/CHIPClusters-JNI.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions src/controller/java/zap-generated/CHIPReadCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions src/controller/java/zap-generated/CHIPReadCallbacks.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4112be5

Please sign in to comment.