Skip to content

Commit

Permalink
Update PR per latest comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Jul 3, 2021
1 parent 3e51072 commit 450a1f3
Show file tree
Hide file tree
Showing 38 changed files with 251 additions and 276 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ jobs:
timeout-minutes: 10
run: |
ifconfig -a
scripts/tests/test_suites.sh
- name: Run TV Tests
timeout-minutes: 10
run: |
ifconfig -a
scripts/tests/test_suites.sh -a tv -i 20
scripts/tests/test_suites.sh
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }}
Expand Down Expand Up @@ -169,10 +164,6 @@ jobs:
timeout-minutes: 15
run: |
scripts/tests/test_suites.sh
- name: Run TV Tests
timeout-minutes: 10
run: |
scripts/tests/test_suites.sh -a tv -i 20
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11616,7 +11616,7 @@
"outgoing": 1
},
{
"name": "MediaSkipSeek",
"name": "MediaSeek",
"code": 10,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -11731,11 +11731,11 @@
"outgoing": 0
},
{
"name": "MediaSkipSeekResponse",
"code": 10,
"name": "MediaSeekResponse",
"code": 11,
"mfgCode": null,
"source": "server",
"incoming": 1,
"incoming": 0,
"outgoing": 0
}
],
Expand Down Expand Up @@ -12399,7 +12399,7 @@
"reportableChange": 0
},
{
"name": "application satus",
"name": "application status",
"code": 7,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -16316,4 +16316,4 @@
}
],
"log": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@

// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
#define EMBER_AF_GENERATED_COMMAND_COUNT (200)
#define EMBER_AF_GENERATED_COMMAND_COUNT (201)
#define GENERATED_COMMANDS \
{ \
\
Expand Down Expand Up @@ -2825,7 +2825,8 @@
{ 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \
{ 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \
{ 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \
{ 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipSeek */ \
{ 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \
{ 0x0506, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSeekResponse */ \
\
/* Endpoint: 1, Cluster: Media Input (server) */ \
{ 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \
Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ set(PRIV_INCLUDE_DIRS_LIST
set(SRC_DIRS_LIST
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/gen"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/linux/include/tv-callbacks"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,8 @@ extern "C" void app_main()
vTaskDelay(50 / portTICK_PERIOD_MS);
}
}

bool lowPowerClusterSleep()
{
return true;
}
79 changes: 39 additions & 40 deletions examples/chip-tool/commands/clusters/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,25 +463,25 @@ static void OnMediaPlaybackClusterMediaRewindResponse(void * context, uint8_t me
command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaSkipBackwardResponse(void * context, uint8_t mediaPlaybackStatus)
static void OnMediaPlaybackClusterMediaSeekResponse(void * context, uint8_t mediaPlaybackStatus)
{
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipBackwardResponse");
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSeekResponse");

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

static void OnMediaPlaybackClusterMediaSkipForwardResponse(void * context, uint8_t mediaPlaybackStatus)
static void OnMediaPlaybackClusterMediaSkipBackwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipForwardResponse");
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipBackwardResponse");

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

static void OnMediaPlaybackClusterMediaSkipSeekResponse(void * context, uint8_t mediaPlaybackStatus)
static void OnMediaPlaybackClusterMediaSkipForwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipSeekResponse");
ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipForwardResponse");

ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(CHIP_NO_ERROR);
Expand Down Expand Up @@ -11979,9 +11979,9 @@ class ReadMediaInputClusterRevision : public ModelCommand
| * MediaPlay | 0x00 |
| * MediaPrevious | 0x04 |
| * MediaRewind | 0x06 |
| * MediaSeek | 0x0A |
| * MediaSkipBackward | 0x09 |
| * MediaSkipForward | 0x08 |
| * MediaSkipSeek | 0x0A |
| * MediaStartOver | 0x03 |
| * MediaStop | 0x02 |
|------------------------------------------------------------------------------|
Expand Down Expand Up @@ -12168,108 +12168,107 @@ class MediaPlaybackMediaRewind : public ModelCommand
};

/*
* Command MediaSkipBackward
* Command MediaSeek
*/
class MediaPlaybackMediaSkipBackward : public ModelCommand
class MediaPlaybackMediaSeek : public ModelCommand
{
public:
MediaPlaybackMediaSkipBackward() : ModelCommand("media-skip-backward")
MediaPlaybackMediaSeek() : ModelCommand("media-seek")
{
AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
AddArgument("Position", 0, UINT64_MAX, &mPosition);
ModelCommand::AddArguments();
}
~MediaPlaybackMediaSkipBackward()
~MediaPlaybackMediaSeek()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x09) on endpoint %" PRIu8, endpointId);
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x0A) on endpoint %" PRIu8, endpointId);

chip::Controller::MediaPlaybackCluster cluster;
cluster.Associate(device, endpointId);
return cluster.MediaSkipBackward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
return cluster.MediaSeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPosition);
}

private:
chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback>(
OnMediaPlaybackClusterMediaSkipBackwardResponse, this);
chip::Callback::Callback<MediaPlaybackClusterMediaSeekResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSeekResponseCallback>(OnMediaPlaybackClusterMediaSeekResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
uint64_t mDeltaPositionMilliseconds;
uint64_t mPosition;
};

/*
* Command MediaSkipForward
* Command MediaSkipBackward
*/
class MediaPlaybackMediaSkipForward : public ModelCommand
class MediaPlaybackMediaSkipBackward : public ModelCommand
{
public:
MediaPlaybackMediaSkipForward() : ModelCommand("media-skip-forward")
MediaPlaybackMediaSkipBackward() : ModelCommand("media-skip-backward")
{
AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
ModelCommand::AddArguments();
}
~MediaPlaybackMediaSkipForward()
~MediaPlaybackMediaSkipBackward()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x08) on endpoint %" PRIu8, endpointId);
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x09) on endpoint %" PRIu8, endpointId);

chip::Controller::MediaPlaybackCluster cluster;
cluster.Associate(device, endpointId);
return cluster.MediaSkipForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
return cluster.MediaSkipBackward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
}

private:
chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback>(
OnMediaPlaybackClusterMediaSkipForwardResponse, this);
chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback>(
OnMediaPlaybackClusterMediaSkipBackwardResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
uint64_t mDeltaPositionMilliseconds;
};

/*
* Command MediaSkipSeek
* Command MediaSkipForward
*/
class MediaPlaybackMediaSkipSeek : public ModelCommand
class MediaPlaybackMediaSkipForward : public ModelCommand
{
public:
MediaPlaybackMediaSkipSeek() : ModelCommand("media-skip-seek")
MediaPlaybackMediaSkipForward() : ModelCommand("media-skip-forward")
{
AddArgument("Position", 0, UINT64_MAX, &mPosition);
AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
ModelCommand::AddArguments();
}
~MediaPlaybackMediaSkipSeek()
~MediaPlaybackMediaSkipForward()
{
delete onSuccessCallback;
delete onFailureCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x0A) on endpoint %" PRIu8, endpointId);
ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x08) on endpoint %" PRIu8, endpointId);

chip::Controller::MediaPlaybackCluster cluster;
cluster.Associate(device, endpointId);
return cluster.MediaSkipSeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPosition);
return cluster.MediaSkipForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
}

private:
chip::Callback::Callback<MediaPlaybackClusterMediaSkipSeekResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSkipSeekResponseCallback>(OnMediaPlaybackClusterMediaSkipSeekResponse,
this);
chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback> * onSuccessCallback =
new chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback>(
OnMediaPlaybackClusterMediaSkipForwardResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
uint64_t mPosition;
uint64_t mDeltaPositionMilliseconds;
};

/*
Expand Down Expand Up @@ -22862,8 +22861,8 @@ void registerClusterMediaPlayback(Commands & commands)
make_unique<MediaPlaybackMediaFastForward>(), make_unique<MediaPlaybackMediaNext>(),
make_unique<MediaPlaybackMediaPause>(), make_unique<MediaPlaybackMediaPlay>(),
make_unique<MediaPlaybackMediaPrevious>(), make_unique<MediaPlaybackMediaRewind>(),
make_unique<MediaPlaybackMediaSkipBackward>(), make_unique<MediaPlaybackMediaSkipForward>(),
make_unique<MediaPlaybackMediaSkipSeek>(), make_unique<MediaPlaybackMediaStartOver>(),
make_unique<MediaPlaybackMediaSeek>(), make_unique<MediaPlaybackMediaSkipBackward>(),
make_unique<MediaPlaybackMediaSkipForward>(), make_unique<MediaPlaybackMediaStartOver>(),
make_unique<MediaPlaybackMediaStop>(), make_unique<DiscoverMediaPlaybackAttributes>(),
make_unique<ReadMediaPlaybackClusterRevision>(),
};
Expand Down
8 changes: 0 additions & 8 deletions examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ EmberAfTvChannelInfo tvChannelClusterChangeChannel(std::string match)
{
// TODO: Insert code here
EmberAfTvChannelInfo channel = {};
char affiliateCallSign[] = "exampleResponseASign";
char callSign[] = "exampleResponseCSign";
char name[] = "exampleResponseName";
channel.affiliateCallSign = ByteSpan(Uint8::from_char(affiliateCallSign), sizeof(affiliateCallSign));
channel.callSign = ByteSpan(Uint8::from_char(callSign), sizeof(callSign));
channel.name = ByteSpan(Uint8::from_char(name), sizeof(name));
channel.majorNumber = static_cast<uint8_t>(1);
channel.minorNumber = static_cast<uint16_t>(2);
return channel;
}
bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber)
Expand Down
12 changes: 6 additions & 6 deletions examples/tv-app/tv-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -2533,22 +2533,22 @@ bool emberAfMediaPlaybackClusterMediaPreviousCallback(chip::app::Command * comma
bool emberAfMediaPlaybackClusterMediaRewindCallback(chip::app::Command * commandObj);

/**
* @brief Media Playback Cluster MediaSkipBackward Command callback
* @brief Media Playback Cluster MediaSeek Command callback
*/

bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(chip::app::Command * commandObj, uint64_t deltaPositionMilliseconds);
bool emberAfMediaPlaybackClusterMediaSeekCallback(chip::app::Command * commandObj, uint64_t position);

/**
* @brief Media Playback Cluster MediaSkipForward Command callback
* @brief Media Playback Cluster MediaSkipBackward Command callback
*/

bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::app::Command * commandObj, uint64_t deltaPositionMilliseconds);
bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(chip::app::Command * commandObj, uint64_t deltaPositionMilliseconds);

/**
* @brief Media Playback Cluster MediaSkipSeek Command callback
* @brief Media Playback Cluster MediaSkipForward Command callback
*/

bool emberAfMediaPlaybackClusterMediaSkipSeekCallback(chip::app::Command * commandObj, uint64_t position);
bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::app::Command * commandObj, uint64_t deltaPositionMilliseconds);

/**
* @brief Media Playback Cluster MediaStartOver Command callback
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/tv-common/gen/endpoint_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@
{ 0x0506, 0x08, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipForwardResponse */ \
{ 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipBackward */ \
{ 0x0506, 0x09, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipBackwardResponse */ \
{ 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSkipSeek */ \
{ 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \
\
/* Endpoint: 3, Cluster: Content Launcher (server) */ \
{ 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchContent */ \
Expand Down
Loading

0 comments on commit 450a1f3

Please sign in to comment.