Skip to content

Commit

Permalink
In emberAfEndpointConfigure() change endpoint ID to a uint16_t (#22998)
Browse files Browse the repository at this point in the history
* Test added march 8 (#15957)

* Added new manual scripts

* Added Auto generated File

* [OTA] Fix OTARequestorDriverImpl inclusion (#15981)

* Regen to fix CI failures (#15990)

* [ota] Store Default OTA Providers in flash (#15970)

* [ota] Store Default OTA Providers in flash

Store Default OTA Providers in flash each time the attribute
is modified and load it back on the application startup.

* Restyled by clang-format

* Fix build and reduce flash usage

Co-authored-by: Restyled.io <commits@restyled.io>

* Remove merge artifacts

* Cast boolean to uint8_t as setOnOffValue expects, fixes GCC 8.3 error

* Make endpoint id a uint16_t as per spec

* Restyled by clang-format

* Update the signature of OnOffServer::setOnOffValue() to avoid casts

* Fix printf argument and formatting

Co-authored-by: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com>
Co-authored-by: Carol Yang <clyang@apple.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Damian Królik <66667989+Damian-Nordic@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
6 people authored Oct 3, 2022
1 parent 4325527 commit be8567b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/clusters/on-off-server/on-off-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ EmberAfStatus OnOffServer::getOnOffValue(chip::EndpointId endpoint, bool * curre
* @param command Ver.: always
* @param initiatedByLevelChange Ver.: always
*/
EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t command, bool initiatedByLevelChange)
EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange)
{
EmberAfStatus status;
bool currentValue, newValue;

emberAfOnOffClusterPrintln("On/Off set value: %x %x", endpoint, command);
emberAfOnOffClusterPrintln("On/Off set value: %x %x", endpoint, static_cast<uint8_t>(command));

// read current on/off value
status = Attributes::OnOff::Get(endpoint, &currentValue);
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/on-off-server/on-off-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class OnOffServer
const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData);
void updateOnOffTimeCommand(chip::EndpointId endpoint);
EmberAfStatus getOnOffValue(chip::EndpointId endpoint, bool * currentOnOffValue);
EmberAfStatus setOnOffValue(chip::EndpointId endpoint, uint8_t command, bool initiatedByLevelChange);
EmberAfStatus setOnOffValue(chip::EndpointId endpoint, chip::CommandId command, bool initiatedByLevelChange);
EmberAfStatus getOnOffValueForStartUp(chip::EndpointId endpoint, bool & onOffValueForStartUp);

bool HasFeature(chip::EndpointId endpoint, OnOffFeature feature);
Expand Down
2 changes: 1 addition & 1 deletion src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static uint16_t findClusterEndpointIndex(EndpointId endpoint, ClusterId clusterI
// Initial configuration
void emberAfEndpointConfigure(void)
{
uint8_t ep;
uint16_t ep;

#if !defined(EMBER_SCRIPTED_TEST)
uint16_t fixedEndpoints[] = FIXED_ENDPOINT_ARRAY;
Expand Down

0 comments on commit be8567b

Please sign in to comment.