Skip to content

Commit

Permalink
Disabled the Identify, Groups and Scenes clusters, since they cause c…
Browse files Browse the repository at this point in the history
…ompile error (#6722)
  • Loading branch information
tlykkeberg-grundfos authored May 12, 2021
1 parent d65d411 commit 88152db
Show file tree
Hide file tree
Showing 13 changed files with 262 additions and 3,879 deletions.
979 changes: 0 additions & 979 deletions examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions examples/pump-app/pump-common/gen/CHIPClientCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,4 @@

// THIS FILE IS GENERATED BY ZAP

#pragma once

#include <app/Command.h>
#include <app/util/af-enums.h>
#include <gen/af-structs.h>
#include <inttypes.h>
#include <lib/support/Span.h>

// Note: The IMDefaultResponseCallback is a bridge to the old CallbackMgr before IM is landed, so it still accepts EmberAfStatus
// instead of IM status code.
// #6308 should handle IM error code on the application side, either modify this function or remove this.
bool IMDefaultResponseCallback(const chip::app::Command * commandObj, EmberAfStatus status);

// Global Response Callbacks
typedef void (*DefaultSuccessCallback)(void * context);
typedef void (*DefaultFailureCallback)(void * context, uint8_t status);
typedef void (*BooleanAttributeCallback)(void * context, bool value);
typedef void (*Int8uAttributeCallback)(void * context, uint8_t value);
typedef void (*Int8sAttributeCallback)(void * context, int8_t value);
typedef void (*Int16uAttributeCallback)(void * context, uint16_t value);
typedef void (*Int16sAttributeCallback)(void * context, int16_t value);
typedef void (*Int32uAttributeCallback)(void * context, uint32_t value);
typedef void (*Int32sAttributeCallback)(void * context, int32_t value);
typedef void (*Int64uAttributeCallback)(void * context, uint64_t value);
typedef void (*Int64sAttributeCallback)(void * context, int64_t value);
typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value);
typedef void (*ReadReportingConfigurationReportedCallback)(void * context, uint16_t minInterval, uint16_t maxInterval);
typedef void (*ReadReportingConfigurationReceivedCallback)(void * context, uint16_t timeout);

// Cluster Specific Response Callbacks

// List specific responses
76 changes: 0 additions & 76 deletions examples/pump-app/pump-common/gen/CHIPClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,81 +30,5 @@ namespace Controller {
// TODO(#4503): length should be passed to commands when byte string is in argument list.
// TODO(#4503): Commands should take group id as an argument.

// Identify Cluster Commands
CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
uint16_t identifyTime)
{
VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE);

app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kIdentifyCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
app::Command * ZCLcommand = mDevice->GetCommandSender();

ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams));

TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter();
uint8_t argSeqNumber = 0;
// identifyTime: int16u
ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), identifyTime));

ReturnErrorOnFailure(ZCLcommand->FinishCommand());

// #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate.
mDevice->AddIMResponseHandler(onSuccessCallback, onFailureCallback);

return mDevice->SendCommands();
}

CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback)
{
VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE);

app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kIdentifyQueryCommandId,
(chip::app::CommandPathFlags::kEndpointIdValid) };
app::Command * ZCLcommand = mDevice->GetCommandSender();

ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams));

// Command takes no arguments.

ReturnErrorOnFailure(ZCLcommand->FinishCommand());

// #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate.
mDevice->AddIMResponseHandler(onSuccessCallback, onFailureCallback);

return mDevice->SendCommands();
}

// Identify Cluster Attributes
CHIP_ERROR IdentifyCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback)
{
uint8_t seqNum = mDevice->GetNextSequenceNumber();
System::PacketBufferHandle encodedCommand = encodeIdentifyClusterDiscoverAttributes(seqNum, mEndpoint);
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}
CHIP_ERROR IdentifyCluster::ReadAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
uint8_t seqNum = mDevice->GetNextSequenceNumber();
System::PacketBufferHandle encodedCommand = encodeIdentifyClusterReadIdentifyTimeAttribute(seqNum, mEndpoint);
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}

CHIP_ERROR IdentifyCluster::WriteAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback, uint16_t value)
{
uint8_t seqNum = mDevice->GetNextSequenceNumber();
System::PacketBufferHandle encodedCommand = encodeIdentifyClusterWriteIdentifyTimeAttribute(seqNum, mEndpoint, value);
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}

CHIP_ERROR IdentifyCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback,
Callback::Cancelable * onFailureCallback)
{
uint8_t seqNum = mDevice->GetNextSequenceNumber();
System::PacketBufferHandle encodedCommand = encodeIdentifyClusterReadClusterRevisionAttribute(seqNum, mEndpoint);
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}

} // namespace Controller
} // namespace chip
37 changes: 0 additions & 37 deletions examples/pump-app/pump-common/gen/CHIPClusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,3 @@
*/

// THIS FILE IS GENERATED BY ZAP

// Prevent multiple inclusion
#pragma once

#include <controller/CHIPCluster.h>
#include <core/CHIPCallback.h>
#include <lib/support/Span.h>

namespace chip {
namespace Controller {

constexpr ClusterId kIdentifyClusterId = 0x0003;

class DLL_EXPORT IdentifyCluster : public ClusterBase
{
public:
IdentifyCluster() : ClusterBase(kIdentifyClusterId) {}
~IdentifyCluster() {}

// Cluster Commands
CHIP_ERROR Identify(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t identifyTime);
CHIP_ERROR IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);

// Cluster Attributes
CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
CHIP_ERROR WriteAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
uint16_t value);

private:
static constexpr CommandId kIdentifyCommandId = 0x00;
static constexpr CommandId kIdentifyQueryCommandId = 0x01;
};

} // namespace Controller
} // namespace chip
44 changes: 0 additions & 44 deletions examples/pump-app/pump-common/gen/CHIPClustersObjc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,3 @@
*/

// THIS FILE IS GENERATED BY ZAP

#ifndef CHIP_CLUSTERS_H
#define CHIP_CLUSTERS_H

#import <Foundation/Foundation.h>

@class CHIPDevice;

typedef void (^ResponseHandler)(NSError * _Nullable error, NSDictionary * _Nullable values);

NS_ASSUME_NONNULL_BEGIN

/**
* CHIPCluster
* This is the base class for clusters.
*/
@interface CHIPCluster : NSObject

- (nullable instancetype)initWithDevice:(CHIPDevice *)device
endpoint:(uint8_t)endpoint
queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

@end

/**
* Cluster Identify
*
*/
@interface CHIPIdentify : CHIPCluster

- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler;
- (void)identifyQuery:(ResponseHandler)responseHandler;

- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler;
- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler;
- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler;

@end

NS_ASSUME_NONNULL_END

#endif /* CHIP_CLUSTERS_H */
Loading

0 comments on commit 88152db

Please sign in to comment.