From f1d6826d64ba8e7942364e37e38c78b6d344dc82 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Thu, 1 Jul 2021 01:07:15 +0200 Subject: [PATCH] Update PR per latest comments --- .github/workflows/tests.yaml | 11 +-- .../all-clusters-common/all-clusters-app.zap | 12 +-- .../all-clusters-common/gen/endpoint_config.h | 5 +- .../esp32/main/CMakeLists.txt | 1 - examples/all-clusters-app/esp32/main/main.cpp | 5 ++ .../chip-tool/commands/clusters/Commands.h | 79 +++++++++---------- examples/chip-tool/commands/tests/Commands.h | 22 +++--- .../include/tv-channel/TvChannelManager.cpp | 8 -- .../tv-common/gen/IMClusterCommandHandler.cpp | 48 +++++------ examples/tv-app/tv-common/gen/callback.h | 12 +-- .../tv-app/tv-common/gen/endpoint_config.h | 2 +- examples/tv-app/tv-common/tv-app.zap | 29 ++----- scripts/tests/test_suites.sh | 16 ++-- .../application-launcher-server.h | 2 +- .../media-playback-server.cpp | 4 +- .../media-playback-server.h | 2 +- .../target-navigator-server.h | 2 +- .../tv-channel-server/tv-channel-server.cpp | 8 +- src/app/common/gen/client-command-macro.h | 16 ++-- src/app/common/gen/command-id.h | 4 +- src/app/common/gen/ids/Attributes.h | 14 ++-- src/app/common/gen/ids/Commands.h | 4 +- .../tests/suites/TV_MediaPlaybackCluster.yaml | 4 +- .../chip/media-playback-cluster.xml | 4 +- .../data_model/controller-clusters.zap | 4 +- .../data_model/gen/CHIPClientCallbacks.cpp | 26 +++--- .../data_model/gen/CHIPClientCallbacks.h | 2 +- .../data_model/gen/CHIPClusters.cpp | 26 +++--- src/controller/data_model/gen/CHIPClusters.h | 4 +- .../gen/IMClusterCommandHandler.cpp | 12 +-- src/controller/data_model/gen/callback.h | 12 +-- .../data_model/gen/chip-zcl-zpro-codec-api.h | 2 +- src/controller/data_model/gen/encoder.cpp | 9 ++- .../data_model/gen/endpoint_config.h | 4 +- src/controller/java/gen/CHIPClusters-JNI.cpp | 68 ++++++++-------- src/controller/java/gen/ChipClusters.java | 20 ++--- .../python/chip/clusters/CHIPClusters.cpp | 16 ++-- .../python/chip/clusters/CHIPClusters.py | 20 ++--- .../Framework/CHIP/gen/CHIPClustersObjc.h | 2 +- .../Framework/CHIP/gen/CHIPClustersObjc.mm | 66 ++++++++-------- 40 files changed, 291 insertions(+), 316 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 43753dcb708c89..57255a2950c1de 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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() }} @@ -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() }} diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 2c30d594e95359..4b7b2f74b7ede3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -11616,7 +11616,7 @@ "outgoing": 1 }, { - "name": "MediaSkipSeek", + "name": "MediaSeek", "code": 10, "mfgCode": null, "source": "client", @@ -11731,11 +11731,11 @@ "outgoing": 0 }, { - "name": "MediaSkipSeekResponse", - "code": 10, + "name": "MediaSeekResponse", + "code": 11, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 0 } ], @@ -12399,7 +12399,7 @@ "reportableChange": 0 }, { - "name": "application satus", + "name": "application status", "code": 7, "mfgCode": null, "side": "server", @@ -16099,4 +16099,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index d60b52f9a8accd..5a0a2463a62cad 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -2567,7 +2567,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 \ { \ \ @@ -2792,7 +2792,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 */ \ diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index bbae13622d9dfa..c50bf6e7b06cef 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -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" diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index ec91e67794a2c8..6de0390eaa204b 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -766,3 +766,8 @@ extern "C" void app_main() vTaskDelay(50 / portTICK_PERIOD_MS); } } + +bool lowPowerClusterSleep() +{ + return true; +} diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index afd99c177a8e95..4ae0859496fa9f 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -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(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(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(context); command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -11519,9 +11519,9 @@ class ReadMediaInputClusterRevision : public ModelCommand | * MediaPlay | 0x00 | | * MediaPrevious | 0x04 | | * MediaRewind | 0x06 | +| * MediaSeek | 0x0A | | * MediaSkipBackward | 0x09 | | * MediaSkipForward | 0x08 | -| * MediaSkipSeek | 0x0A | | * MediaStartOver | 0x03 | | * MediaStop | 0x02 | |------------------------------------------------------------------------------| @@ -11708,17 +11708,17 @@ 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; @@ -11726,34 +11726,33 @@ class MediaPlaybackMediaSkipBackward : public ModelCommand 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 * onSuccessCallback = - new chip::Callback::Callback( - OnMediaPlaybackClusterMediaSkipBackwardResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnMediaPlaybackClusterMediaSeekResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(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; @@ -11761,34 +11760,34 @@ class MediaPlaybackMediaSkipForward : public ModelCommand 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 * onSuccessCallback = - new chip::Callback::Callback( - OnMediaPlaybackClusterMediaSkipForwardResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnMediaPlaybackClusterMediaSkipBackwardResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(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; @@ -11796,20 +11795,20 @@ class MediaPlaybackMediaSkipSeek : public ModelCommand 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 * onSuccessCallback = - new chip::Callback::Callback(OnMediaPlaybackClusterMediaSkipSeekResponse, - this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnMediaPlaybackClusterMediaSkipForwardResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - uint64_t mPosition; + uint64_t mDeltaPositionMilliseconds; }; /* @@ -22386,8 +22385,8 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), }; diff --git a/examples/chip-tool/commands/tests/Commands.h b/examples/chip-tool/commands/tests/Commands.h index aa9c2f5edb3d2e..44e4cafe772503 100644 --- a/examples/chip-tool/commands/tests/Commands.h +++ b/examples/chip-tool/commands/tests/Commands.h @@ -1603,7 +1603,7 @@ class TV_MediaPlaybackCluster : public TestCommand err = TestSendClusterMediaPlaybackCommandMediaSkipBackward_9(); break; case 10: - err = TestSendClusterMediaPlaybackCommandMediaSkipSeek_10(); + err = TestSendClusterMediaPlaybackCommandMediaSeek_10(); break; } @@ -2317,20 +2317,20 @@ class TV_MediaPlaybackCluster : public TestCommand runner->NextTest(); } - // Test Media Playback Skip Seek Command + // Test Media Playback Seek Command typedef void (*SuccessCallback_10)(void * context, uint8_t mediaPlaybackStatus); chip::Callback::Callback * mOnSuccessCallback_10 = nullptr; chip::Callback::Callback * mOnFailureCallback_10 = nullptr; bool mIsFailureExpected_10 = 0; - CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaSkipSeek_10() + CHIP_ERROR TestSendClusterMediaPlaybackCommandMediaSeek_10() { - ChipLogProgress(chipTool, "Media Playback - Media Playback Skip Seek Command: Sending command..."); + ChipLogProgress(chipTool, "Media Playback - Media Playback Seek Command: Sending command..."); mOnFailureCallback_10 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipSeek_10_FailureResponse, this); + OnTestSendClusterMediaPlaybackCommandMediaSeek_10_FailureResponse, this); mOnSuccessCallback_10 = new chip::Callback::Callback( - OnTestSendClusterMediaPlaybackCommandMediaSkipSeek_10_SuccessResponse, this); + OnTestSendClusterMediaPlaybackCommandMediaSeek_10_SuccessResponse, this); chip::Controller::MediaPlaybackCluster cluster; cluster.Associate(mDevice, 3); @@ -2338,7 +2338,7 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR err = CHIP_NO_ERROR; uint64_t positionArgument = 100ULL; - err = cluster.MediaSkipSeek(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel(), positionArgument); + err = cluster.MediaSeek(mOnSuccessCallback_10->Cancel(), mOnFailureCallback_10->Cancel(), positionArgument); if (CHIP_NO_ERROR != err) { @@ -2349,9 +2349,9 @@ class TV_MediaPlaybackCluster : public TestCommand return err; } - static void OnTestSendClusterMediaPlaybackCommandMediaSkipSeek_10_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterMediaPlaybackCommandMediaSeek_10_FailureResponse(void * context, uint8_t status) { - ChipLogProgress(chipTool, "Media Playback - Media Playback Skip Seek Command: Failure Response"); + ChipLogProgress(chipTool, "Media Playback - Media Playback Seek Command: Failure Response"); TV_MediaPlaybackCluster * runner = reinterpret_cast(context); @@ -2368,9 +2368,9 @@ class TV_MediaPlaybackCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterMediaPlaybackCommandMediaSkipSeek_10_SuccessResponse(void * context, uint8_t mediaPlaybackStatus) + static void OnTestSendClusterMediaPlaybackCommandMediaSeek_10_SuccessResponse(void * context, uint8_t mediaPlaybackStatus) { - ChipLogProgress(chipTool, "Media Playback - Media Playback Skip Seek Command: Success Response"); + ChipLogProgress(chipTool, "Media Playback - Media Playback Seek Command: Success Response"); TV_MediaPlaybackCluster * runner = reinterpret_cast(context); diff --git a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp b/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp index f0c5cd769c150c..744e4774b82eeb 100644 --- a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp +++ b/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp @@ -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(1); - channel.minorNumber = static_cast(2); return channel; } bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber) diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index 543a1ef2924c64..5c221aa46cc8d0 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -206,8 +206,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -433,8 +433,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -1341,8 +1341,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -1979,8 +1979,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -2034,8 +2034,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -2279,9 +2279,9 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En wasHandled = emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); break; } - case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { + case ZCL_MEDIA_SEEK_COMMAND_ID: { expectArgumentCount = 1; - uint64_t deltaPositionMilliseconds; + uint64_t position; bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -2312,7 +2312,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); + TLVUnpackError = aDataTlv.Get(position); break; default: // Unsupported tag, ignore it. @@ -2334,11 +2334,11 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); + wasHandled = emberAfMediaPlaybackClusterMediaSeekCallback(apCommandObj, position); } break; } - case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { + case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { expectArgumentCount = 1; uint64_t deltaPositionMilliseconds; bool argExists[1]; @@ -2393,13 +2393,13 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); + wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); } break; } - case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { + case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { expectArgumentCount = 1; - uint64_t position; + uint64_t deltaPositionMilliseconds; bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -2430,7 +2430,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(position); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); break; default: // Unsupported tag, ignore it. @@ -2452,7 +2452,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); + wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); } break; } @@ -4037,8 +4037,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } @@ -4268,8 +4268,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 - ", UnpackError=%" PRIu32 " (last decoded tag = %" PRIu32, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); } } diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index dc7c6a0c1c2646..092843d68b81eb 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -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 diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h index 872f5a37aa1ee9..e12fcc97e816ee 100644 --- a/examples/tv-app/tv-common/gen/endpoint_config.h +++ b/examples/tv-app/tv-common/gen/endpoint_config.h @@ -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 */ \ diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 33b5f70cd65c88..01b30d6c9afbe7 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1619,16 +1619,9 @@ "source": "client", "incoming": 1, "outgoing": 0 - }, - { - "name": "RetrieveLogsResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 } - ] + ], + "attributes": [] }, { "name": "General Diagnostics", @@ -7091,7 +7084,7 @@ "outgoing": 1 }, { - "name": "MediaSkipSeek", + "name": "MediaSeek", "code": 10, "mfgCode": null, "source": "client", @@ -7204,14 +7197,6 @@ "source": "server", "incoming": 1, "outgoing": 0 - }, - { - "name": "MediaSkipSeekResponse", - "code": 10, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 } ], "attributes": [ @@ -7603,7 +7588,7 @@ "reportableChange": 0 }, { - "name": "application satus", + "name": "application status", "code": 7, "mfgCode": null, "side": "server", @@ -7962,7 +7947,7 @@ "reportableChange": 0 }, { - "name": "application satus", + "name": "application status", "code": 7, "mfgCode": null, "side": "server", @@ -8127,7 +8112,7 @@ "reportableChange": 0 }, { - "name": "application satus", + "name": "application status", "code": 7, "mfgCode": null, "side": "server", @@ -8218,4 +8203,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/scripts/tests/test_suites.sh b/scripts/tests/test_suites.sh index 2f70ca2ad551ba..bcf045b75dba90 100755 --- a/scripts/tests/test_suites.sh +++ b/scripts/tests/test_suites.sh @@ -25,9 +25,9 @@ declare -i background_pid=0 # - a for application # - i for number of iterations you want to have while getopts a:i: flag; do - case "${flag}" in - a) application=${OPTARG} ;; - i) iterations=${OPTARG} ;; + case "$flag" in + a) application=$OPTARG ;; + i) iterations=$OPTARG ;; esac done @@ -90,14 +90,14 @@ for j in "${iter_array[@]}"; do # Clear out our temp files so we don't accidentally do a stale # read from them before we write to them. - rm -rf /tmp/$application-log - touch /tmp/$application-log + rm -rf /tmp/"$application"-log + touch /tmp/"$application"-log rm -rf /tmp/pid ( - stdbuf -o0 out/debug/standalone/chip-$application-app & + stdbuf -o0 out/debug/standalone/chip-"$application"-app & echo $! >&3 - ) 3>/tmp/pid | tee /tmp/$application-log & - while ! grep -q "Server Listening" /tmp/$application-log; do + ) 3>/tmp/pid | tee /tmp/"$application"-log & + while ! grep -q "Server Listening" /tmp/"$application"-log; do : done # Now read $background_pid from /tmp/pid; presumably it's diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.h b/src/app/clusters/application-launcher-server/application-launcher-server.h index ae41a0418fd6b6..1cf0c22b3586c6 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.h +++ b/src/app/clusters/application-launcher-server/application-launcher-server.h @@ -41,4 +41,4 @@ typedef struct _ApplicationLauncherResponse { uint8_t status; uint8_t * data; -} ApplicationLauncherResponse; \ No newline at end of file +} ApplicationLauncherResponse; diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 32f77642ab8fdb..3a159987011a95 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -174,11 +174,11 @@ bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(chip::app::Command * co return true; } -bool emberAfMediaPlaybackClusterMediaSkipSeekCallback(chip::app::Command * command, uint64_t positionMilliseconds) +bool emberAfMediaPlaybackClusterMediaSeekCallback(chip::app::Command * command, uint64_t positionMilliseconds) { EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SEEK, positionMilliseconds); - sendResponse(command, "MediaSeek", ZCL_MEDIA_SKIP_SEEK_RESPONSE_COMMAND_ID, status); + sendResponse(command, "MediaSeek", ZCL_MEDIA_SEEK_RESPONSE_COMMAND_ID, status); return true; } diff --git a/src/app/clusters/media-playback-server/media-playback-server.h b/src/app/clusters/media-playback-server/media-playback-server.h index c536bbb58d8907..f9be35bff5b383 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.h +++ b/src/app/clusters/media-playback-server/media-playback-server.h @@ -53,4 +53,4 @@ enum MediaPlaybackRequest : uint8_t MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, MEDIA_PLAYBACK_REQUEST_SEEK = 10, -}; \ No newline at end of file +}; diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.h b/src/app/clusters/target-navigator-server/target-navigator-server.h index 99c4635bebe536..8c34a24f98c103 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.h +++ b/src/app/clusters/target-navigator-server/target-navigator-server.h @@ -42,4 +42,4 @@ typedef struct _TargetNavigatorResponse { uint8_t status; uint8_t * data; -} TargetNavigatorResponse; \ No newline at end of file +} TargetNavigatorResponse; diff --git a/src/app/clusters/tv-channel-server/tv-channel-server.cpp b/src/app/clusters/tv-channel-server/tv-channel-server.cpp index 9b06b43892de56..652aba27bc3c9f 100644 --- a/src/app/clusters/tv-channel-server/tv-channel-server.cpp +++ b/src/app/clusters/tv-channel-server/tv-channel-server.cpp @@ -57,7 +57,7 @@ void sendResponse(chip::app::Command * command, EmberAfTvChannelInfo channelInfo chip::TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = command->PrepareCommand(cmdParams)); VerifyOrExit((writer = command->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // TODO: Struct as param is not supported. Getting an error + // TODO: Enable this once struct as param is supported // SuccessOrExit(err = writer->Put(chip::TLV::ContextTag(0), channelInfo)); // EmberAfTvChannelErrorType. errorType // SuccessOrExit(err = writer->Put(chip::TLV::ContextTag(1), errorType)); @@ -72,8 +72,10 @@ void sendResponse(chip::app::Command * command, EmberAfTvChannelInfo channelInfo bool emberAfTvChannelClusterChangeChannelCallback(chip::app::Command * command, uint8_t * match) { std::string matchString(reinterpret_cast(match)); - EmberAfTvChannelInfo channelInfo = tvChannelClusterChangeChannel(matchString); - sendResponse(command, channelInfo); + // TODO: Enable this once struct as param is supported + // EmberAfTvChannelInfo channelInfo = tvChannelClusterChangeChannel(matchString); + // sendResponse(command, channelInfo); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); return true; } diff --git a/src/app/common/gen/client-command-macro.h b/src/app/common/gen/client-command-macro.h index 0895f61e045526..2343aca59ee272 100644 --- a/src/app/common/gen/client-command-macro.h +++ b/src/app/common/gen/client-command-macro.h @@ -4316,26 +4316,26 @@ \ ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID, "u", mediaPlaybackStatus); -/** @brief Command description for MediaSkipSeek +/** @brief Command description for MediaSeek * - * Command: MediaSkipSeek + * Command: MediaSeek * @param position INT64U */ #define emberAfFillCommandMedia \ - PlaybackClusterMediaSkipSeek(position) emberAfFillExternalBuffer(mask, \ + PlaybackClusterMediaSeek(position) emberAfFillExternalBuffer(mask, \ \ - ZCL_MEDIA_SKIP_SEEK_COMMAND_ID, "u", position); + ZCL_MEDIA_SEEK_COMMAND_ID, "u", position); -/** @brief Command description for MediaSkipSeekResponse +/** @brief Command description for MediaSeekResponse * - * Command: MediaSkipSeekResponse + * Command: MediaSeekResponse * @param mediaPlaybackStatus MediaPlaybackStatus */ #define emberAfFillCommandMedia \ - PlaybackClusterMediaSkipSeekResponse(mediaPlaybackStatus) \ + PlaybackClusterMediaSeekResponse(mediaPlaybackStatus) \ emberAfFillExternalBuffer(mask, \ \ - ZCL_MEDIA_SKIP_SEEK_RESPONSE_COMMAND_ID, "u", mediaPlaybackStatus); + ZCL_MEDIA_SEEK_RESPONSE_COMMAND_ID, "u", mediaPlaybackStatus); /** @brief Command description for SelectInput * diff --git a/src/app/common/gen/command-id.h b/src/app/common/gen/command-id.h index a8eaee2d563a44..764e29ea5d75f8 100644 --- a/src/app/common/gen/command-id.h +++ b/src/app/common/gen/command-id.h @@ -399,8 +399,8 @@ #define ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID (0x08) #define ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID (0x09) #define ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID (0x09) -#define ZCL_MEDIA_SKIP_SEEK_COMMAND_ID (0x0A) -#define ZCL_MEDIA_SKIP_SEEK_RESPONSE_COMMAND_ID (0x0B) +#define ZCL_MEDIA_SEEK_COMMAND_ID (0x0A) +#define ZCL_MEDIA_SEEK_RESPONSE_COMMAND_ID (0x0B) // Commands for cluster: Media Input #define ZCL_SELECT_INPUT_COMMAND_ID (0x00) diff --git a/src/app/common/gen/ids/Attributes.h b/src/app/common/gen/ids/Attributes.h index af543b5843d8e7..5128e72197590c 100644 --- a/src/app/common/gen/ids/Attributes.h +++ b/src/app/common/gen/ids/Attributes.h @@ -1318,13 +1318,13 @@ static constexpr AttributeId ApplicationId = 0x0002; namespace ApplicationBasic { namespace Attributes { namespace Ids { -static constexpr AttributeId VendorName = 0x0000; -static constexpr AttributeId VendorId = 0x0001; -static constexpr AttributeId ApplicationName = 0x0002; -static constexpr AttributeId ProductId = 0x0003; -static constexpr AttributeId ApplicationId = 0x0005; -static constexpr AttributeId CatalogVendorId = 0x0006; -static constexpr AttributeId ApplicationSatus = 0x0007; +static constexpr AttributeId VendorName = 0x0000; +static constexpr AttributeId VendorId = 0x0001; +static constexpr AttributeId ApplicationName = 0x0002; +static constexpr AttributeId ProductId = 0x0003; +static constexpr AttributeId ApplicationId = 0x0005; +static constexpr AttributeId CatalogVendorId = 0x0006; +static constexpr AttributeId ApplicationStatus = 0x0007; } // namespace Ids } // namespace Attributes } // namespace ApplicationBasic diff --git a/src/app/common/gen/ids/Commands.h b/src/app/common/gen/ids/Commands.h index 358ab71870c228..f5156f22826dd8 100644 --- a/src/app/common/gen/ids/Commands.h +++ b/src/app/common/gen/ids/Commands.h @@ -566,8 +566,8 @@ static constexpr CommandId MediaSkipForward = 0x08; static constexpr CommandId MediaSkipForwardResponse = 0x08; static constexpr CommandId MediaSkipBackward = 0x09; static constexpr CommandId MediaSkipBackwardResponse = 0x09; -static constexpr CommandId MediaSkipSeek = 0x0A; -static constexpr CommandId MediaSkipSeekResponse = 0x0A; +static constexpr CommandId MediaSeek = 0x0A; +static constexpr CommandId MediaSeekResponse = 0x0B; } // namespace Ids } // namespace Commands } // namespace MediaPlayback diff --git a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml index b22a04cff09f5b..c5326f1008820b 100644 --- a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml +++ b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml @@ -57,8 +57,8 @@ tests: - name: "deltaPositionMilliseconds" value: 100 - - label: "Media Playback Skip Seek Command" - command: "MediaSkipSeek" + - label: "Media Playback Seek Command" + command: "MediaSeek" arguments: values: - name: "position" diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index 14cccbd5f0a13d..69431a2aad3cad 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -79,7 +79,7 @@ limitations under the License. - + Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: @@ -134,7 +134,7 @@ limitations under the License. - + Upon receipt, this SHALL change the playback position in the media to the given position using data as follows: diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index ed2c89915b00ad..b4f4307006ba94 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -7464,7 +7464,7 @@ "outgoing": 1 }, { - "name": "MediaSkipSeek", + "name": "MediaSeek", "code": 10, "mfgCode": null, "source": "client", @@ -7579,7 +7579,7 @@ "outgoing": 0 }, { - "name": "MediaSkipSeekResponse", + "name": "MediaSeekResponse", "code": 11, "mfgCode": null, "source": "server", diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index f141142e5bf7ac..f7bef97ef6e019 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -2470,6 +2470,19 @@ bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(chip::app::Command * return true; } +bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus) +{ + ChipLogProgress(Zcl, "MediaSeekResponse:"); + ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSeekResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, mediaPlaybackStatus); + return true; +} + bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus) { ChipLogProgress(Zcl, "MediaSkipBackwardResponse:"); @@ -2496,19 +2509,6 @@ bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(chip::app::Comm return true; } -bool emberAfMediaPlaybackClusterMediaSkipSeekResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaSkipSeekResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipSeekResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus) { ChipLogProgress(Zcl, "MediaStartOverResponse:"); diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.h b/src/controller/data_model/gen/CHIPClientCallbacks.h index f6736eba27e35c..2146f9207f3320 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.h +++ b/src/controller/data_model/gen/CHIPClientCallbacks.h @@ -137,9 +137,9 @@ typedef void (*MediaPlaybackClusterMediaPauseResponseCallback)(void * context, u typedef void (*MediaPlaybackClusterMediaPlayResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaPreviousResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaRewindResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterMediaSeekResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaSkipBackwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaSkipForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaSkipSeekResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaStartOverResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*MediaPlaybackClusterMediaStopResponseCallback)(void * context, uint8_t mediaPlaybackStatus); typedef void (*NetworkCommissioningClusterAddThreadNetworkResponseCallback)(void * context, uint8_t errorCode, uint8_t * debugText); diff --git a/src/controller/data_model/gen/CHIPClusters.cpp b/src/controller/data_model/gen/CHIPClusters.cpp index df6b164fa104eb..34a96fa27acd92 100644 --- a/src/controller/data_model/gen/CHIPClusters.cpp +++ b/src/controller/data_model/gen/CHIPClusters.cpp @@ -5970,8 +5970,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaRewind(Callback::Cancelable * onSuccessCal return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +CHIP_ERROR MediaPlaybackCluster::MediaSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t position) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -5984,7 +5984,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSkipBackwardCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSeekCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); @@ -5992,8 +5992,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // deltaPositionMilliseconds: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); + // position: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), position)); SuccessOrExit(err = sender->FinishCommand()); @@ -6011,8 +6011,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -6025,7 +6025,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSucce VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSkipForwardCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSkipBackwardCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); @@ -6052,8 +6052,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSucce return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSkipSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint64_t position) +CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -6066,7 +6066,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipSeek(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSkipSeekCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kMediaSkipForwardCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; SuccessOrExit(err = chip::app::InteractionModelEngine::GetInstance()->NewCommandSender(&sender)); @@ -6074,8 +6074,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipSeek(Callback::Cancelable * onSuccessC SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataElementTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // position: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), position)); + // deltaPositionMilliseconds: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); SuccessOrExit(err = sender->FinishCommand()); diff --git a/src/controller/data_model/gen/CHIPClusters.h b/src/controller/data_model/gen/CHIPClusters.h index e5d578c03da691..6a6068e6626226 100644 --- a/src/controller/data_model/gen/CHIPClusters.h +++ b/src/controller/data_model/gen/CHIPClusters.h @@ -869,11 +869,11 @@ class DLL_EXPORT MediaPlaybackCluster : public ClusterBase CHIP_ERROR MediaPlay(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR MediaPrevious(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR MediaRewind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR MediaSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t position); CHIP_ERROR MediaSkipBackward(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds); CHIP_ERROR MediaSkipForward(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds); - CHIP_ERROR MediaSkipSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t position); CHIP_ERROR MediaStartOver(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR MediaStop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); @@ -888,9 +888,9 @@ class DLL_EXPORT MediaPlaybackCluster : public ClusterBase static constexpr CommandId kMediaPlayCommandId = 0x00; static constexpr CommandId kMediaPreviousCommandId = 0x04; static constexpr CommandId kMediaRewindCommandId = 0x06; + static constexpr CommandId kMediaSeekCommandId = 0x0A; static constexpr CommandId kMediaSkipBackwardCommandId = 0x09; static constexpr CommandId kMediaSkipForwardCommandId = 0x08; - static constexpr CommandId kMediaSkipSeekCommandId = 0x0A; static constexpr CommandId kMediaStartOverCommandId = 0x03; static constexpr CommandId kMediaStopCommandId = 0x02; }; diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp index d59ae6ad32bc48..8e874aa7b911b6 100644 --- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp +++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp @@ -3110,7 +3110,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID: { + case ZCL_MEDIA_SEEK_RESPONSE_COMMAND_ID: { expectArgumentCount = 1; uint8_t mediaPlaybackStatus; bool argExists[1]; @@ -3165,11 +3165,11 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSeekResponseCallback(apCommandObj, mediaPlaybackStatus); } break; } - case ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID: { + case ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID: { expectArgumentCount = 1; uint8_t mediaPlaybackStatus; bool argExists[1]; @@ -3224,11 +3224,11 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(apCommandObj, mediaPlaybackStatus); } break; } - case ZCL_MEDIA_SKIP_SEEK_RESPONSE_COMMAND_ID: { + case ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID: { expectArgumentCount = 1; uint8_t mediaPlaybackStatus; bool argExists[1]; @@ -3283,7 +3283,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfMediaPlaybackClusterMediaSkipSeekResponseCallback(apCommandObj, mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(apCommandObj, mediaPlaybackStatus); } break; } diff --git a/src/controller/data_model/gen/callback.h b/src/controller/data_model/gen/callback.h index 63a34a4fd7b393..c46de79cef8c98 100644 --- a/src/controller/data_model/gen/callback.h +++ b/src/controller/data_model/gen/callback.h @@ -3906,22 +3906,22 @@ bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(chip::app::Command bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); /** - * @brief Media Playback Cluster MediaSkipBackwardResponse Command callback + * @brief Media Playback Cluster MediaSeekResponse Command callback */ -bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); +bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); /** - * @brief Media Playback Cluster MediaSkipForwardResponse Command callback + * @brief Media Playback Cluster MediaSkipBackwardResponse Command callback */ -bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); +bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); /** - * @brief Media Playback Cluster MediaSkipSeekResponse Command callback + * @brief Media Playback Cluster MediaSkipForwardResponse Command callback */ -bool emberAfMediaPlaybackClusterMediaSkipSeekResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); +bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(chip::app::Command * commandObj, uint8_t mediaPlaybackStatus); /** * @brief Media Playback Cluster MediaStartOverResponse Command callback diff --git a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h index 81eebc4b4ac26e..629583856f08f1 100644 --- a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h +++ b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h @@ -1976,9 +1976,9 @@ chip::System::PacketBufferHandle encodeMediaInputClusterReadClusterRevisionAttri | * MediaPlay | 0x00 | | * MediaPrevious | 0x04 | | * MediaRewind | 0x06 | +| * MediaSeek | 0x0A | | * MediaSkipBackward | 0x09 | | * MediaSkipForward | 0x08 | -| * MediaSkipSeek | 0x0A | | * MediaStartOver | 0x03 | | * MediaStop | 0x02 | |------------------------------------------------------------------------------| diff --git a/src/controller/data_model/gen/encoder.cpp b/src/controller/data_model/gen/encoder.cpp index da0d9a662064a3..a948b409464f76 100644 --- a/src/controller/data_model/gen/encoder.cpp +++ b/src/controller/data_model/gen/encoder.cpp @@ -258,8 +258,11 @@ PacketBufferHandle encodeApplicationBasicClusterReadCatalogVendorIdAttribute(uin */ PacketBufferHandle encodeApplicationBasicClusterReadApplicationStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadApplicationBasicApplicationStatus", APPLICATION_BASIC_CLUSTER_ID); - buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put32(0x0007); + COMMAND_HEADER("ReadApplicationBasicApplicationStatus", ApplicationBasic::Id); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put32(Globals::Commands::Ids::ReadAttributes) + .Put32(ApplicationBasic::Attributes::Ids::ApplicationStatus); COMMAND_FOOTER(); } @@ -3154,9 +3157,9 @@ PacketBufferHandle encodeMediaInputClusterReadClusterRevisionAttribute(uint8_t s | * MediaPlay | 0x00 | | * MediaPrevious | 0x04 | | * MediaRewind | 0x06 | +| * MediaSeek | 0x0A | | * MediaSkipBackward | 0x09 | | * MediaSkipForward | 0x08 | -| * MediaSkipSeek | 0x0A | | * MediaStartOver | 0x03 | | * MediaStop | 0x02 | |------------------------------------------------------------------------------| diff --git a/src/controller/data_model/gen/endpoint_config.h b/src/controller/data_model/gen/endpoint_config.h index 2986a1876a6ee7..64b7f3d586b4a6 100644 --- a/src/controller/data_model/gen/endpoint_config.h +++ b/src/controller/data_model/gen/endpoint_config.h @@ -654,8 +654,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, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSkipSeekResponse */ \ + { 0x0506, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MediaSeek */ \ + { 0x0506, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* MediaSeekResponse */ \ \ /* Endpoint: 1, Cluster: Media Input (client) */ \ { 0x0507, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SelectInput */ \ diff --git a/src/controller/java/gen/CHIPClusters-JNI.cpp b/src/controller/java/gen/CHIPClusters-JNI.cpp index 82f6d4d55ab2f4..1fa2b2fa70a7f4 100644 --- a/src/controller/java/gen/CHIPClusters-JNI.cpp +++ b/src/controller/java/gen/CHIPClusters-JNI.cpp @@ -3137,12 +3137,11 @@ class CHIPMediaPlaybackClusterMediaRewindResponseCallback jobject javaCallbackRef; }; -class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback - : public Callback::Callback +class CHIPMediaPlaybackClusterMediaSeekResponseCallback : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3157,7 +3156,7 @@ class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback ChipLogError(Zcl, "Could not create global reference for Java callback"); } } - ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback() + ~CHIPMediaPlaybackClusterMediaSeekResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3175,11 +3174,11 @@ class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); jobject javaCallbackRef; jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback * cppCallback = nullptr; + CHIPMediaPlaybackClusterMediaSeekResponseCallback * cppCallback = nullptr; VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - cppCallback = reinterpret_cast(context); + cppCallback = reinterpret_cast(context); VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3206,12 +3205,12 @@ class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback jobject javaCallbackRef; }; -class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback - : public Callback::Callback +class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3226,7 +3225,7 @@ class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback ChipLogError(Zcl, "Could not create global reference for Java callback"); } } - ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback() + ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3244,11 +3243,11 @@ class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); jobject javaCallbackRef; jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback * cppCallback = nullptr; + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback * cppCallback = nullptr; VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - cppCallback = reinterpret_cast(context); + cppCallback = reinterpret_cast(context); VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3275,12 +3274,12 @@ class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback jobject javaCallbackRef; }; -class CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback - : public Callback::Callback +class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3295,7 +3294,7 @@ class CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback ChipLogError(Zcl, "Could not create global reference for Java callback"); } } - ~CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback() + ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3313,11 +3312,11 @@ class CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); jobject javaCallbackRef; jmethodID javaMethod; - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback * cppCallback = nullptr; + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback * cppCallback = nullptr; VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - cppCallback = reinterpret_cast(context); + cppCallback = reinterpret_cast(context); VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); javaCallbackRef = cppCallback->javaCallbackRef; @@ -9219,25 +9218,24 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaRewind)(JNIEnv * env, jobject self, env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(void, MediaPlaybackCluster, mediaSkipBackward) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong deltaPositionMilliseconds) +JNI_METHOD(void, MediaPlaybackCluster, mediaSeek)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong position) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback * onSuccess; + CHIPMediaPlaybackClusterMediaSeekResponseCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - onSuccess = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(callback); + onSuccess = new CHIPMediaPlaybackClusterMediaSeekResponseCallback(callback); VerifyOrExit(onSuccess != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onFailure = new CHIPDefaultFailureCallback(callback); VerifyOrExit(onFailure != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - err = cppCluster->MediaSkipBackward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); + err = cppCluster->MediaSeek(onSuccess->Cancel(), onFailure->Cancel(), position); SuccessOrExit(err); exit: @@ -9265,25 +9263,25 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaSkipBackward) env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(void, MediaPlaybackCluster, mediaSkipForward) +JNI_METHOD(void, MediaPlaybackCluster, mediaSkipBackward) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong deltaPositionMilliseconds) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback * onSuccess; + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - onSuccess = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(callback); + onSuccess = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(callback); VerifyOrExit(onSuccess != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onFailure = new CHIPDefaultFailureCallback(callback); VerifyOrExit(onFailure != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - err = cppCluster->MediaSkipForward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); + err = cppCluster->MediaSkipBackward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); SuccessOrExit(err); exit: @@ -9311,25 +9309,25 @@ JNI_METHOD(void, MediaPlaybackCluster, mediaSkipForward) env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(void, MediaPlaybackCluster, mediaSkipSeek) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong position) +JNI_METHOD(void, MediaPlaybackCluster, mediaSkipForward) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong deltaPositionMilliseconds) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; MediaPlaybackCluster * cppCluster; - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback * onSuccess; + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - onSuccess = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallback(callback); + onSuccess = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(callback); VerifyOrExit(onSuccess != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onFailure = new CHIPDefaultFailureCallback(callback); VerifyOrExit(onFailure != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - err = cppCluster->MediaSkipSeek(onSuccess->Cancel(), onFailure->Cancel(), position); + err = cppCluster->MediaSkipForward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); SuccessOrExit(err); exit: diff --git a/src/controller/java/gen/ChipClusters.java b/src/controller/java/gen/ChipClusters.java index 7f195c1d13f847..025dabc0911a7b 100644 --- a/src/controller/java/gen/ChipClusters.java +++ b/src/controller/java/gen/ChipClusters.java @@ -1450,6 +1450,10 @@ public void mediaRewind(MediaRewindResponseCallback callback) { mediaRewind(chipClusterPtr, callback); } + public void mediaSeek(MediaSeekResponseCallback callback, long position) { + mediaSeek(chipClusterPtr, callback, position); + } + public void mediaSkipBackward( MediaSkipBackwardResponseCallback callback, long deltaPositionMilliseconds) { mediaSkipBackward(chipClusterPtr, callback, deltaPositionMilliseconds); @@ -1460,10 +1464,6 @@ public void mediaSkipForward( mediaSkipForward(chipClusterPtr, callback, deltaPositionMilliseconds); } - public void mediaSkipSeek(MediaSkipSeekResponseCallback callback, long position) { - mediaSkipSeek(chipClusterPtr, callback, position); - } - public void mediaStartOver(MediaStartOverResponseCallback callback) { mediaStartOver(chipClusterPtr, callback); } @@ -1485,6 +1485,9 @@ private native void mediaFastForward( private native void mediaRewind(long chipClusterPtr, MediaRewindResponseCallback callback); + private native void mediaSeek( + long chipClusterPtr, MediaSeekResponseCallback callback, long position); + private native void mediaSkipBackward( long chipClusterPtr, MediaSkipBackwardResponseCallback callback, @@ -1495,9 +1498,6 @@ private native void mediaSkipForward( MediaSkipForwardResponseCallback callback, long deltaPositionMilliseconds); - private native void mediaSkipSeek( - long chipClusterPtr, MediaSkipSeekResponseCallback callback, long position); - private native void mediaStartOver( long chipClusterPtr, MediaStartOverResponseCallback callback); @@ -1539,19 +1539,19 @@ public interface MediaRewindResponseCallback { void onError(Exception error); } - public interface MediaSkipBackwardResponseCallback { + public interface MediaSeekResponseCallback { void onSuccess(int mediaPlaybackStatus); void onError(Exception error); } - public interface MediaSkipForwardResponseCallback { + public interface MediaSkipBackwardResponseCallback { void onSuccess(int mediaPlaybackStatus); void onError(Exception error); } - public interface MediaSkipSeekResponseCallback { + public interface MediaSkipForwardResponseCallback { void onSuccess(int mediaPlaybackStatus); void onError(Exception error); diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 6211f7ee9e6f2a..455532a8f165dc 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -2804,6 +2804,14 @@ CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaRewind(chip::Controller::De cluster.Associate(device, ZCLendpointId); return cluster.MediaRewind(nullptr, nullptr); } +CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSeek(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint64_t position) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.MediaSeek(nullptr, nullptr, position); +} CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSkipBackward(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, uint64_t deltaPositionMilliseconds) { @@ -2820,14 +2828,6 @@ CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSkipForward(chip::Controlle cluster.Associate(device, ZCLendpointId); return cluster.MediaSkipForward(nullptr, nullptr, deltaPositionMilliseconds); } -CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSkipSeek(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, - chip::GroupId, uint64_t position) -{ - VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, ZCLendpointId); - return cluster.MediaSkipSeek(nullptr, nullptr, position); -} CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaStartOver(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId) { diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 331e3222338692..ade7cf9e90568f 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -435,15 +435,15 @@ def ListClusterCommands(self): }, "MediaRewind": { }, + "MediaSeek": { + "position": "int", + }, "MediaSkipBackward": { "deltaPositionMilliseconds": "int", }, "MediaSkipForward": { "deltaPositionMilliseconds": "int", }, - "MediaSkipSeek": { - "position": "int", - }, "MediaStartOver": { }, "MediaStop": { @@ -2497,6 +2497,10 @@ def ClusterMediaPlayback_CommandMediaRewind(self, device: ctypes.c_void_p, ZCLen return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaRewind( device, ZCLendpoint, ZCLgroupid ) + def ClusterMediaPlayback_CommandMediaSeek(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, position: int): + return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSeek( + device, ZCLendpoint, ZCLgroupid, position + ) def ClusterMediaPlayback_CommandMediaSkipBackward(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, deltaPositionMilliseconds: int): return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipBackward( device, ZCLendpoint, ZCLgroupid, deltaPositionMilliseconds @@ -2505,10 +2509,6 @@ def ClusterMediaPlayback_CommandMediaSkipForward(self, device: ctypes.c_void_p, return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipForward( device, ZCLendpoint, ZCLgroupid, deltaPositionMilliseconds ) - def ClusterMediaPlayback_CommandMediaSkipSeek(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, position: int): - return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipSeek( - device, ZCLendpoint, ZCLgroupid, position - ) def ClusterMediaPlayback_CommandMediaStartOver(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaStartOver( device, ZCLendpoint, ZCLgroupid @@ -4341,15 +4341,15 @@ def InitLib(self, chipLib): # Cluster MediaPlayback Command MediaRewind self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaRewind.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaRewind.restype = ctypes.c_uint32 + # Cluster MediaPlayback Command MediaSeek + self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSeek.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] + self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSeek.restype = ctypes.c_uint32 # Cluster MediaPlayback Command MediaSkipBackward self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipBackward.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipBackward.restype = ctypes.c_uint32 # Cluster MediaPlayback Command MediaSkipForward self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipForward.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipForward.restype = ctypes.c_uint32 - # Cluster MediaPlayback Command MediaSkipSeek - self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipSeek.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] - self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaSkipSeek.restype = ctypes.c_uint32 # Cluster MediaPlayback Command MediaStartOver self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaStartOver.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_AppendCommand_MediaPlayback_MediaStartOver.restype = ctypes.c_uint32 diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index 8811eb2d32a892..0e843aed564d3a 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -722,9 +722,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)mediaPlay:(ResponseHandler)responseHandler; - (void)mediaPrevious:(ResponseHandler)responseHandler; - (void)mediaRewind:(ResponseHandler)responseHandler; +- (void)mediaSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler; - (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; - (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; -- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler; - (void)mediaStartOver:(ResponseHandler)responseHandler; - (void)mediaStop:(ResponseHandler)responseHandler; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index ec0f2b11c3cd0e..0d275b9b2ce9cd 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -1753,22 +1753,22 @@ static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) dispatch_queue_t mQueue; }; -class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge - : public Callback::Callback { +class CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge() {}; + ~CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) { - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -1785,22 +1785,22 @@ static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) dispatch_queue_t mQueue; }; -class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge - : public Callback::Callback { +class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge() {}; + ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) { - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -1817,22 +1817,22 @@ static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) dispatch_queue_t mQueue; }; -class CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge - : public Callback::Callback { +class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge() {}; + ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t mediaPlaybackStatus) { - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -11512,10 +11512,10 @@ - (void)mediaRewind:(ResponseHandler)responseHandler responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler +- (void)mediaSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler { - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge * onSuccess + = new CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -11530,7 +11530,7 @@ - (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(R __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.MediaSkipBackward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); + err = self.cppCluster.MediaSeek(onSuccess->Cancel(), onFailure->Cancel(), position); }); if (err != CHIP_NO_ERROR) { @@ -11539,10 +11539,10 @@ - (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(R responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler +- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * onSuccess + = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -11557,7 +11557,7 @@ - (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(Re __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.MediaSkipForward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); + err = self.cppCluster.MediaSkipBackward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); }); if (err != CHIP_NO_ERROR) { @@ -11566,10 +11566,10 @@ - (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(Re responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler +- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { - CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * onSuccess + = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -11584,7 +11584,7 @@ - (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)respon __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.MediaSkipSeek(onSuccess->Cancel(), onFailure->Cancel(), position); + err = self.cppCluster.MediaSkipForward(onSuccess->Cancel(), onFailure->Cancel(), deltaPositionMilliseconds); }); if (err != CHIP_NO_ERROR) {