Skip to content

Commit

Permalink
Adding list attriubtes to the clusters and updating the TV example app (
Browse files Browse the repository at this point in the history
#6582)

Problem
We do not have list attributes enabled on app clusters.

Summary of Changes
- Updated all the app clusters where list attributes are used
- Updated the TV example app to use the new attributes

Test
- Tested locally using chip-tool client and newly created tv-server
- Used the zap_regen_all.py and gn_build.sh to verify the building is successful
  • Loading branch information
lazarkov authored and pull[bot] committed May 27, 2021
1 parent 568f99e commit 3357990
Show file tree
Hide file tree
Showing 53 changed files with 2,619 additions and 5,545 deletions.
14 changes: 7 additions & 7 deletions examples/all-clusters-app/all-clusters-common/gen/af-structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef struct _AudioOutputInfo
{
uint8_t index;
uint8_t outputType;
uint8_t * name;
chip::ByteSpan name;
} EmberAfAudioOutputInfo;

// Struct for BasicCommissioningInfoType
Expand Down Expand Up @@ -282,8 +282,8 @@ typedef struct _MediaInputInfo
{
uint8_t index;
uint8_t inputType;
uint8_t * name;
uint8_t * description;
chip::ByteSpan name;
chip::ByteSpan description;
} EmberAfMediaInputInfo;

// Struct for MediaPlaybackPosition
Expand All @@ -297,7 +297,7 @@ typedef struct _MediaPlaybackPosition
typedef struct _NavigateTargetTargetInfo
{
uint8_t identifier;
uint8_t * name;
chip::ByteSpan name;
} EmberAfNavigateTargetTargetInfo;

// Struct for NeighborInfo
Expand Down Expand Up @@ -597,9 +597,9 @@ typedef struct _TvChannelInfo
{
uint16_t majorNumber;
uint16_t minorNumber;
uint8_t * name;
uint8_t * callSign;
uint8_t * affiliateCallSign;
chip::ByteSpan name;
chip::ByteSpan callSign;
chip::ByteSpan affiliateCallSign;
} EmberAfTvChannelInfo;

// Struct for TvChannelLineupInfo
Expand Down
14 changes: 7 additions & 7 deletions examples/bridge-app/bridge-common/gen/af-structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef struct _AudioOutputInfo
{
uint8_t index;
uint8_t outputType;
uint8_t * name;
chip::ByteSpan name;
} EmberAfAudioOutputInfo;

// Struct for BasicCommissioningInfoType
Expand Down Expand Up @@ -282,8 +282,8 @@ typedef struct _MediaInputInfo
{
uint8_t index;
uint8_t inputType;
uint8_t * name;
uint8_t * description;
chip::ByteSpan name;
chip::ByteSpan description;
} EmberAfMediaInputInfo;

// Struct for MediaPlaybackPosition
Expand All @@ -297,7 +297,7 @@ typedef struct _MediaPlaybackPosition
typedef struct _NavigateTargetTargetInfo
{
uint8_t identifier;
uint8_t * name;
chip::ByteSpan name;
} EmberAfNavigateTargetTargetInfo;

// Struct for NeighborInfo
Expand Down Expand Up @@ -597,9 +597,9 @@ typedef struct _TvChannelInfo
{
uint16_t majorNumber;
uint16_t minorNumber;
uint8_t * name;
uint8_t * callSign;
uint8_t * affiliateCallSign;
chip::ByteSpan name;
chip::ByteSpan callSign;
chip::ByteSpan affiliateCallSign;
} EmberAfTvChannelInfo;

// Struct for TvChannelLineupInfo
Expand Down
141 changes: 127 additions & 14 deletions examples/chip-tool/commands/clusters/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,61 @@ static void OnTestClusterClusterTestSpecificResponse(void * context, uint8_t ret
command->SetCommandExitStatus(true);
}

static void OnApplicationLauncherApplicationLauncherListListAttributeResponse(void * context, uint16_t count, uint16_t * entries)
{
ChipLogProgress(chipTool, "OnApplicationLauncherApplicationLauncherListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "INT16U[%lu]: %" PRIu16 "", i, entries[i]);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnAudioOutputAudioOutputListListAttributeResponse(void * context, uint16_t count, _AudioOutputInfo * entries)
{
ChipLogProgress(chipTool, "OnAudioOutputAudioOutputListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "AudioOutputInfo[%lu]:", i);
ChipLogProgress(chipTool, " index: %" PRIu8 "", entries[i].index);
ChipLogProgress(chipTool, " outputType: %" PRIu8 "", entries[i].outputType);
ChipLogProgress(chipTool, " name: %s", entries[i].name);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnContentLaunchAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries)
{
ChipLogProgress(chipTool, "OnContentLaunchAcceptsHeaderListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "OCTET_STRING[%lu]: %s", i, entries[i]);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnContentLaunchSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
ChipLogProgress(chipTool, "OnContentLaunchSupportedStreamingTypesListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "ContentLaunchStreamingType[%lu]: %" PRIu8 "", i, entries[i]);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries)
{
ChipLogProgress(chipTool, "OnDescriptorDeviceListListAttributeResponse: %lu entries", count);
Expand Down Expand Up @@ -768,6 +823,23 @@ static void OnGroupKeyManagementGroupKeysListAttributeResponse(void * context, u
command->SetCommandExitStatus(true);
}

static void OnMediaInputMediaInputListListAttributeResponse(void * context, uint16_t count, _MediaInputInfo * entries)
{
ChipLogProgress(chipTool, "OnMediaInputMediaInputListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "MediaInputInfo[%lu]:", i);
ChipLogProgress(chipTool, " index: %" PRIu8 "", entries[i].index);
ChipLogProgress(chipTool, " inputType: %" PRIu8 "", entries[i].inputType);
ChipLogProgress(chipTool, " name: %s", entries[i].name);
ChipLogProgress(chipTool, " description: %s", entries[i].description);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnOperationalCredentialsFabricsListListAttributeResponse(void * context, uint16_t count, _FabricDescriptor * entries)
{
ChipLogProgress(chipTool, "OnOperationalCredentialsFabricsListListAttributeResponse: %lu entries", count);
Expand All @@ -784,6 +856,40 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse(void * cont
command->SetCommandExitStatus(true);
}

static void OnTvChannelTvChannelListListAttributeResponse(void * context, uint16_t count, _TvChannelInfo * entries)
{
ChipLogProgress(chipTool, "OnTvChannelTvChannelListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "TvChannelInfo[%lu]:", i);
ChipLogProgress(chipTool, " majorNumber: %" PRIu16 "", entries[i].majorNumber);
ChipLogProgress(chipTool, " minorNumber: %" PRIu16 "", entries[i].minorNumber);
ChipLogProgress(chipTool, " name: %s", entries[i].name);
ChipLogProgress(chipTool, " callSign: %s", entries[i].callSign);
ChipLogProgress(chipTool, " affiliateCallSign: %s", entries[i].affiliateCallSign);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnTargetNavigatorTargetNavigatorListListAttributeResponse(void * context, uint16_t count,
_NavigateTargetTargetInfo * entries)
{
ChipLogProgress(chipTool, "OnTargetNavigatorTargetNavigatorListListAttributeResponse: %lu entries", count);

for (uint16_t i = 0; i < count; i++)
{
ChipLogProgress(chipTool, "NavigateTargetTargetInfo[%lu]:", i);
ChipLogProgress(chipTool, " identifier: %" PRIu8 "", entries[i].identifier);
ChipLogProgress(chipTool, " name: %s", entries[i].name);
}

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
}

static void OnTestClusterListInt8uListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
ChipLogProgress(chipTool, "OnTestClusterListInt8uListAttributeResponse: %lu entries", count);
Expand Down Expand Up @@ -1474,8 +1580,9 @@ class ReadApplicationLauncherApplicationLauncherList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<ApplicationLauncherApplicationLauncherListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<ApplicationLauncherApplicationLauncherListListAttributeCallback>(
OnApplicationLauncherApplicationLauncherListListAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -1655,8 +1762,9 @@ class ReadAudioOutputAudioOutputList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<AudioOutputAudioOutputListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<AudioOutputAudioOutputListListAttributeCallback>(
OnAudioOutputAudioOutputListListAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -6173,8 +6281,9 @@ class ReadContentLaunchAcceptsHeaderList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<ContentLaunchAcceptsHeaderListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<ContentLaunchAcceptsHeaderListListAttributeCallback>(
OnContentLaunchAcceptsHeaderListListAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -6207,8 +6316,9 @@ class ReadContentLaunchSupportedStreamingTypes : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<ContentLaunchSupportedStreamingTypesListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<ContentLaunchSupportedStreamingTypesListAttributeCallback>(
OnContentLaunchSupportedStreamingTypesListAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -9531,8 +9641,9 @@ class ReadMediaInputMediaInputList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<MediaInputMediaInputListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaInputMediaInputListListAttributeCallback>(OnMediaInputMediaInputListListAttributeResponse,
this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -12224,8 +12335,9 @@ class ReadTvChannelTvChannelList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<TvChannelTvChannelListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<TvChannelTvChannelListListAttributeCallback>(OnTvChannelTvChannelListListAttributeResponse,
this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down Expand Up @@ -12439,8 +12551,9 @@ class ReadTargetNavigatorTargetNavigatorList : public ModelCommand
}

private:
chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<TargetNavigatorTargetNavigatorListListAttributeCallback> * onSuccessCallback =
new chip::Callback::Callback<TargetNavigatorTargetNavigatorListListAttributeCallback>(
OnTargetNavigatorTargetNavigatorListListAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
Expand Down
Loading

0 comments on commit 3357990

Please sign in to comment.