Skip to content

Commit

Permalink
Merge branch 'master' into remove_start_and_stop_from_run
Browse files Browse the repository at this point in the history
  • Loading branch information
ccruzagralopes authored Nov 10, 2023
2 parents 37c1fe0 + 8d8d8a2 commit 0998158
Show file tree
Hide file tree
Showing 57 changed files with 811 additions and 484 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void InitOTARequestor(void)
// TODO: instatiate and initialize these values when QueryImageResponse tells us an image is available
// TODO: add API for OTARequestor to pass QueryImageResponse info to the application to use for OTADownloader init
// OTAImageProcessor ipParams;
// ipParams.imageFile = CharSpan("dnld_img.txt");
// ipParams.imageFile = "dnld_img.txt"_span;
// gImageProcessor.SetOTAImageProcessorParams(ipParams);
gImageProcessor.SetOTADownloader(&gDownloader);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3202,15 +3202,15 @@ server cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
server cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -3227,7 +3227,7 @@ server cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/common/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class LockManager
endpoints[0].id = 1;
uint8_t pin[6] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36 };
endpoints[0].credentials[0].set(DlCredentialStatus::kOccupied, CredentialTypeEnum::kPin, chip::ByteSpan(pin));
endpoints[0].users[0].set(chip::CharSpan("default"), 1, UserStatusEnum::kOccupiedEnabled, UserTypeEnum::kUnrestrictedUser,
endpoints[0].users[0].set("default"_span, 1, UserStatusEnum::kOccupiedEnabled, UserTypeEnum::kUnrestrictedUser,
CredentialRuleEnum::kSingle);
endpoints[0].users[0].addCredential(CredentialTypeEnum::kPin, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,15 +1173,15 @@ server cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
server cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -1198,7 +1198,7 @@ server cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand Down
4 changes: 4 additions & 0 deletions examples/chip-tool/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ matter_enable_tracing_support = true

matter_log_json_payload_hex = true
matter_log_json_payload_decode_full = true

# make chip-tool very strict by default
chip_tlv_validate_char_string_on_read = true
chip_tlv_validate_char_string_on_write = true
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,7 @@ server cluster AdministratorCommissioning = 60 {
octet_string<32> salt = 4;
}

request struct OpenBasicCommissioningWindowRequest {
int16u commissioningTimeout = 0;
}

timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2;
}

Expand Down Expand Up @@ -1326,7 +1321,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;

handle command OpenCommissioningWindow;
handle command OpenBasicCommissioningWindow;
handle command RevokeCommissioning;
}

Expand Down
8 changes: 0 additions & 8 deletions examples/dishwasher-app/dishwasher-common/dishwasher-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2500,14 +2500,6 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OpenBasicCommissioningWindow",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "RevokeCommissioning",
"code": 2,
Expand Down
10 changes: 5 additions & 5 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5451,15 +5451,15 @@ server cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
client cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -5477,7 +5477,7 @@ client cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand All @@ -5487,15 +5487,15 @@ client cluster TargetNavigator = 1285 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
server cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand Down
10 changes: 5 additions & 5 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5410,15 +5410,15 @@ server cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
client cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -5436,7 +5436,7 @@ client cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand All @@ -5446,15 +5446,15 @@ client cluster TargetNavigator = 1285 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
server cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ using namespace chip::app::Clusters::TemperatureControl;
using chip::Protocols::InteractionModel::Status;

// TODO: Configure your options for each endpoint
CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan("Hot", 3), CharSpan("Warm", 4),
CharSpan("Cold", 4) };
CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan::fromCharString("Hot"),
CharSpan::fromCharString("Warm"),
CharSpan::fromCharString("Cold") };

const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints
[EMBER_AF_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper<Navigate
if (target == kNoCurrentTarget || target > mTargets.size())
{
response.data = chip::MakeOptional(CharSpan::fromCharString("error"));
response.status = TargetNavigatorStatusEnum::kTargetNotFound;
response.status = StatusEnum::kTargetNotFound;
helper.Success(response);
return;
}
mCurrentTarget = static_cast<uint8_t>(target);

response.data = chip::MakeOptional(CharSpan::fromCharString("data response"));
response.status = TargetNavigatorStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
3 changes: 1 addition & 2 deletions examples/tv-app/android/java/ContentAppCommandDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ NavigateTargetResponseType ContentAppCommandDelegate::FormatNavigateTargetRespon
}
else
{
navigateTargetResponse.status =
static_cast<app::Clusters::TargetNavigator::TargetNavigatorStatusEnum>(value[statusFieldId].asInt());
navigateTargetResponse.status = static_cast<app::Clusters::TargetNavigator::StatusEnum>(value[statusFieldId].asInt());
std::string dataFieldId =
std::to_string(to_underlying(app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Fields::kData));
if (!value[dataFieldId].empty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper<Navigate
if (target == kNoCurrentTarget || target > mTargets.size())
{
response.data = chip::MakeOptional(CharSpan::fromCharString("error"));
response.status = TargetNavigatorStatusEnum::kTargetNotFound;
response.status = StatusEnum::kTargetNotFound;
helper.Success(response);
return;
}
mCurrentTarget = static_cast<uint8_t>(target);

response.data = chip::MakeOptional(CharSpan::fromCharString("data response"));
response.status = TargetNavigatorStatusEnum::kSuccess;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
6 changes: 3 additions & 3 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1934,15 +1934,15 @@ server cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
server cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -1960,7 +1960,7 @@ server cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1436,15 +1436,15 @@ client cluster Channel = 1284 {

/** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */
client cluster TargetNavigator = 1285 {
enum TargetNavigatorStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
}

struct TargetInfoStruct {
int8u identifier = 0;
char_string<32> name = 1;
char_string name = 1;
}

readonly attribute TargetInfoStruct targetList[] = 0;
Expand All @@ -1462,7 +1462,7 @@ client cluster TargetNavigator = 1285 {
}

response struct NavigateTargetResponse = 1 {
TargetNavigatorStatusEnum status = 0;
StatusEnum status = 0;
optional char_string data = 1;
}

Expand Down
10 changes: 10 additions & 0 deletions scripts/helpers/platforms/iwyu.imp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
{ symbol: [ 'declval', private, '<utility>', public ] },
{ symbol: [ 'tm', private, '<sys/time.h>', public ] },

## GLib/GIO
{ include: [ '"gio/gdbusinterface.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusinterfaceskeleton.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusobject.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusobjectmanager.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusobjectmanagerclient.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusobjectmanagerserver.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gio/gdbusobjectskeleton.h"', private, '<gio/gio.h>', public ] },
{ include: [ '"gobject/gclosure.h"', private, '<glib-object.h>', public ] },

## ble/*
{ include: [ '"ble/CHIPBleServiceData.h"', private, '<ble/CHIPBleServiceData.h>', public ] },
{ include: [ '@"ble/Ble.*.h"', private, '<ble/Ble.h>', public ] },
Expand Down
5 changes: 5 additions & 0 deletions src/app/CompatEnumNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ namespace Channel {
using ChannelStatusEnum = StatusEnum;
} // namespace Channel

namespace TargetNavigator {
// https://github.com/project-chip/connectedhomeip/pull/30322 renamed this
using TargetNavigatorStatusEnum = StatusEnum;
} // namespace TargetNavigator

} // namespace Clusters
} // namespace app
} // namespace chip
2 changes: 1 addition & 1 deletion src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ Status DoorLockServer::clearUser(chip::EndpointId endpointId, chip::FabricIndex
}

// Remove the user entry
if (!emberAfPluginDoorLockSetUser(endpointId, userIndex, kUndefinedFabricIndex, kUndefinedFabricIndex, chip::CharSpan(""), 0,
if (!emberAfPluginDoorLockSetUser(endpointId, userIndex, kUndefinedFabricIndex, kUndefinedFabricIndex, ""_span, 0,
UserStatusEnum::kAvailable, UserTypeEnum::kUnrestrictedUser, CredentialRuleEnum::kSingle,
nullptr, 0))
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ CHIP_ERROR DefaultOTARequestor::SendQueryImageRequest(Messaging::ExchangeManager
else
{
// Country code unavailable or invalid, use default
args.location.SetValue(CharSpan("XX", strlen("XX")));
args.location.SetValue(CharSpan::fromCharString("XX"));
}

args.metadataForProvider = mMetadataForProvider;
Expand Down
13 changes: 6 additions & 7 deletions src/app/clusters/scenes-server/SceneTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ class SceneTable
}
~SceneData(){};

bool operator==(const SceneData & other) const
{
return ((CharSpan(mName, mNameLength).data_equal(CharSpan(other.mName, other.mNameLength))) &&
(mSceneTransitionTimeMs == other.mSceneTransitionTimeMs) && (mExtensionFieldSets == other.mExtensionFieldSets));
}

void SetName(const CharSpan & sceneName)
{
if (nullptr == sceneName.data())
Expand All @@ -204,17 +210,10 @@ class SceneTable
void Clear()
{
SetName(CharSpan());

mSceneTransitionTimeMs = 0;
mExtensionFieldSets.Clear();
}

bool operator==(const SceneData & other)
{
return (mNameLength == other.mNameLength && !memcmp(mName, other.mName, mNameLength) &&
(mSceneTransitionTimeMs == other.mSceneTransitionTimeMs) && (mExtensionFieldSets == other.mExtensionFieldSets));
}

void operator=(const SceneData & other)
{
SetName(CharSpan(other.mName, other.mNameLength));
Expand Down
1 change: 1 addition & 0 deletions src/app/clusters/scenes-server/SceneTableImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ struct SceneTableData : public SceneTableEntry, PersistentData<kPersistentSceneB

CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override
{
// TODO: if we have mNameLength, should this bin ByteSpan instead?
CharSpan nameSpan(mStorageData.mName, mStorageData.mNameLength);
TLV::TLVType container;
ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container));
Expand Down
Loading

0 comments on commit 0998158

Please sign in to comment.