Skip to content

Commit

Permalink
[QPG] Update version + fix in DoorLock state after boot
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdm-qorvo committed Jun 8, 2023
1 parent 518d861 commit 358d362
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/lighting-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* A uint32_t identifying the software version running on the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 0x0002
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 0x0003
#endif

/**
Expand All @@ -53,7 +53,7 @@
* {MAJOR_VERSION}.0d{MINOR_VERSION}
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0"
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1"
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* A uint32_t identifying the software version running on the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 0x0002
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 0x0003
#endif

/**
Expand All @@ -53,7 +53,7 @@
* {MAJOR_VERSION}.0d{MINOR_VERSION}
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0"
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1"
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
Expand Down
21 changes: 16 additions & 5 deletions examples/lock-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,24 @@ void AppTask::UpdateClusterState(void)
auto newValue = BoltLockMgr().IsUnlocked() ? DoorLock::DlLockState::kUnlocked : DoorLock::DlLockState::kLocked;

SystemLayer().ScheduleLambda([newValue] {
ChipLogProgress(NotSpecified, "UpdateClusterState");
chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DlLockState> currentLockState;
chip::app::Clusters::DoorLock::Attributes::LockState::Get(QPG_LOCK_ENDPOINT_ID, currentLockState);

EmberAfStatus status = DoorLock::Attributes::LockState::Set(QPG_LOCK_ENDPOINT_ID, newValue);

if (status != EMBER_ZCL_STATUS_SUCCESS)
if (currentLockState.IsNull())
{
EmberAfStatus status = DoorLock::Attributes::LockState::Set(QPG_LOCK_ENDPOINT_ID, newValue);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(NotSpecified, "ERR: updating DoorLock %x", status);
}
}
else
{
ChipLogError(NotSpecified, "ERR: updating DoorLock %x", status);
ChipLogProgress(NotSpecified, "Updating LockState attribute");
if (!DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue))
{
ChipLogError(NotSpecified, "ERR: updating DoorLock");
}
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/qpg/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ CHIP_ERROR CHIP_Init(void)
qvIO_EnableSleep(true);
#elif CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
qvIO_EnableSleep(false);
qvIO_EnableSleep(true);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
qvIO_EnableSleep(false);
Expand Down

0 comments on commit 358d362

Please sign in to comment.