Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match Keypad Input Cluster to spec #30316

Merged
merged 6 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3420,7 +3420,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -3444,7 +3444,7 @@ server cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

command SendKey(SendKeyRequest): SendKeyResponse = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -1415,7 +1415,7 @@ server cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

command SendKey(SendKeyRequest): SendKeyResponse = 0;
Expand Down
6 changes: 3 additions & 3 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5866,7 +5866,7 @@ client cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -5890,7 +5890,7 @@ client cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

/** Upon receipt, this SHALL process a keycode as input to the media device. */
Expand Down Expand Up @@ -5988,7 +5988,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand Down
6 changes: 3 additions & 3 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5825,7 +5825,7 @@ client cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -5849,7 +5849,7 @@ client cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

/** Upon receipt, this SHALL process a keycode as input to the media device. */
Expand Down Expand Up @@ -5947,7 +5947,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/android/java/KeypadInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ void KeypadInputManager::HandleSendKey(CommandResponseHelper<SendKeyResponseType
exit:
if (err != CHIP_NO_ERROR)
{
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kInvalidKeyInCurrentState;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kInvalidKeyInCurrentState;
}
else
{
response.status = static_cast<chip::app::Clusters::KeypadInput::KeypadInputStatusEnum>(ret);
response.status = static_cast<chip::app::Clusters::KeypadInput::StatusEnum>(ret);
}
helper.Success(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,67 +31,67 @@ void KeypadInputManager::HandleSendKey(CommandResponseHelper<SendKeyResponseType
switch (keycCode)
{
case CecKeyCodeType::kUp:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kDown:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kLeft:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kRight:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kSelect:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kBackward:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kExit:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kRootMenu:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kSetupMenu:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kEnter:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumber0OrNumber10:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers1:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers2:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers3:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers4:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers5:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers6:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers7:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers8:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
case CecKeyCodeType::kNumbers9:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kSuccess;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess;
break;
default:
response.status = chip::app::Clusters::KeypadInput::KeypadInputStatusEnum::kUnsupportedKey;
response.status = chip::app::Clusters::KeypadInput::StatusEnum::kUnsupportedKey;
}

helper.Success(response);
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -2188,7 +2188,7 @@ server cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

command SendKey(SendKeyRequest): SendKeyResponse = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ client cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -1728,7 +1728,7 @@ client cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

/** Upon receipt, this SHALL process a keycode as input to the media device. */
Expand Down
5 changes: 5 additions & 0 deletions src/app/CompatEnumNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ namespace ApplicationLauncher {
using ApplicationLauncherStatusEnum = StatusEnum;
} // namespace ApplicationLauncher

namespace KeypadInput {
// https://github.com/project-chip/connectedhomeip/pull/30316 renamed this
using KeypadInputStatusEnum = StatusEnum;
} // namespace KeypadInput

namespace Channel {
using ChannelStatusEnum = StatusEnum;
} // namespace Channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ limitations under the License.

<command source="server" code="0x01" name="SendKeyResponse" optional="false">
<description>This command SHALL be generated in response to a SendKey Request command.</description>
<arg name="Status" type="KeypadInputStatusEnum"/>
<arg name="Status" type="StatusEnum"/>
</command>

</cluster>

<enum name="KeypadInputStatusEnum" type="enum8">
<enum name="StatusEnum" type="enum8">
<cluster code="0x0509"/>
<item name="Success" value="0x00"/>
<item name="UnsupportedKey" value="0x01"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ limitations under the License.
<server init="false" tick="false">true</server>

<description>This cluster provides an interface for controlling the Input Selector on a media device such as a TV.</description>

<attribute side="server" code="0x0000" define="MEDIA_INPUT_LIST" type="ARRAY" entryType="InputInfoStruct" length="254" writable="false" optional="false">InputList</attribute>
<attribute side="server" code="0x0001" define="MEDIA_INPUT_CURRENT_INPUT" type="int8u" default="0x00" min="0x00" max="0xFF" writable="false" optional="false">CurrentInput</attribute>

Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -6216,7 +6216,7 @@ client cluster KeypadInput = 1289 {
kData = 118;
}

enum KeypadInputStatusEnum : enum8 {
enum StatusEnum : enum8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand All @@ -6240,7 +6240,7 @@ client cluster KeypadInput = 1289 {
}

response struct SendKeyResponse = 1 {
KeypadInputStatusEnum status = 0;
StatusEnum status = 0;
}

/** Upon receipt, this SHALL process a keycode as input to the media device. */
Expand Down
6 changes: 3 additions & 3 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ def test_tv_ctrl(device, controller):
err, res = send_zcl_command(devCtrl, "KeypadInput", "SendKey", nodeId, endpoint,
dict(keyCode=keyCode), requestTimeoutMs=1000)
assert err == 0
assert res.status == KeypadInput.Enums.KeypadInputStatusEnum.kSuccess
assert res.status == KeypadInput.Enums.StatusEnum.kSuccess

err, res = send_zcl_command(devCtrl, "KeypadInput", "SendKey", nodeId, endpoint,
dict(keyCode=TV_CTRL_TEST_KEY_PAD_UNSUPPORTED_KEY),
requestTimeoutMs=1000)
assert err == 0
assert res.status == KeypadInput.Enums.KeypadInputStatusEnum.kUnsupportedKey
assert res.status == KeypadInput.Enums.StatusEnum.kUnsupportedKey

# TargetNavigator
err, res = read_zcl_attribute(devCtrl, "TargetNavigator", "TargetList", nodeId, endpoint)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading