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

Updating TV example app to add support for on-off level control commands #6417

Conversation

lazarkov
Copy link
Contributor

@lazarkov lazarkov commented May 3, 2021

Problem

TV example app does not support on and off commands
TV example app does not support level control commands

Summary of Changes

  • Added attribute change callback so that developper can detect on-off attribute change and implement logic for TV
  • Added LevelControl.cpp file so that developper can use it and change current level-control.h file. We do not need all the logic from the current level-control cluster. Handeling step command is enough.

Note

Everything which is not supported by the CHIP framework currently is noted with TODO comment.

Test

  • Tested locally using chip-tool client and newly created tv-server
  • Used the ./scripts/tools/zap_regen_all.py and ./gn_build.sh to verify the building is successful

@todo
Copy link

todo bot commented May 3, 2021

Insert your code here to send power toggle command

// TODO: Insert your code here to send power toggle command
break;
case MuteToggle:
// TODO: Insert your code here to send mute toggle command
break;
default:
break;
}
}


This comment was generated by todo based on a TODO comment in 549a3dd in #6417. cc @lazarkov.

@todo
Copy link

todo bot commented May 3, 2021

Insert your code here to send mute toggle command

// TODO: Insert your code here to send mute toggle command
break;
default:
break;
}
}
void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
{


This comment was generated by todo based on a TODO comment in 549a3dd in #6417. cc @lazarkov.

@todo
Copy link

todo bot commented May 3, 2021

Insert your code here to send volume up command

// TODO: Insert your code here to send volume up command
}
else
{
ChipLogProgress(Zcl, "Volume DOWN");
// TODO: Insert your code here to send volume down command
}
}
status = emberAfWriteServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID,
(uint8_t *) &currentLevel, ZCL_INT8U_ATTRIBUTE_TYPE);
state->storedLevel = currentLevel;


This comment was generated by todo based on a TODO comment in 549a3dd in #6417. cc @lazarkov.

@todo
Copy link

todo bot commented May 3, 2021

Insert your code here to send volume down command

// TODO: Insert your code here to send volume down command
}
}
status = emberAfWriteServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID,
(uint8_t *) &currentLevel, ZCL_INT8U_ATTRIBUTE_TYPE);
state->storedLevel = currentLevel;
ChipLogProgress(Zcl, "Setting volume to new level %d", state->storedLevel);
}
send_default_response:
if (emberAfCurrentCommand()->apsFrame->clusterId == ZCL_LEVEL_CONTROL_CLUSTER_ID)


This comment was generated by todo based on a TODO comment in 549a3dd in #6417. cc @lazarkov.

@lazarkov lazarkov force-pushed the feature/update-on-off-level-control-tv-example-app branch 2 times, most recently from 7ecd738 to 6f4648b Compare May 3, 2021 11:42
Problem
TV example app does not support on and off commands
TV example app does not support level control commands

Summary of Changes
- Added attribute change callback so that developper can detect on-off attribute change and implement logic for TV
- Added LevelControl.cpp file so that developper can use it and change current level-control.h file. We do not need all the logic from the current level-control cluster. Handeling step command is enough.

Test
- Tested locally using chip-tool client and newly created tv-server
- Used the zap_regen_all.py and gn_build.sh to verify the building is successful
@woody-apple
Copy link
Contributor

@saurabhst @msandstedt ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants