// This file is generated by Simplicity Studio.  Please do not edit manually.
//
//

#include PLATFORM_HEADER
#include CONFIGURATION_HEADER
#include "af.h"

// Init function declarations.
void emberAfInit(void);
void emberAfMainInitCallback(void);
void emberAfPluginGatewayInitCallback(void);
void emberAfPluginNetworkCreatorSecurityInitCallback(void);

void emAfInit(void)
{
	emberAfInit();  //mqtt init is here
  emberAfMainInitCallback();
  emberAfPluginGatewayInitCallback();
	emberAfPluginNetworkCreatorSecurityInitCallback();
}

// Tick function declarations.
void emberAfMainTickCallback(void);
void emberAfOtaServerTick(void);
void emberAfPluginGatewayTickCallback(void);
void emberAfPluginHeartbeatTickCallback(void);
void emberAfTick(void);

void emAfTick(void)
{
  emberAfMainTickCallback();
  emberAfOtaServerTick();
  //emberAfPluginGatewayTickCallback();
  emberAfPluginHeartbeatTickCallback();
  emberAfTick();
}

void emAfResetAttributes(uint8_t endpointId)
{
}

// PreCommandReceived function declarations.
bool emAfPluginCommandRelayPreCommandReceivedCallback(EmberAfClusterCommand* cmd);
bool emAfPluginDeviceTablePreCommandReceivedCallback(EmberAfClusterCommand* cmd);
//bool emberAfPluginGatewayRelayMqttPreCommandReceivedCallback(EmberAfClusterCommand* cmd);
bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand* cmd);
void rpc_PreCommandReceivedCallback(EmberAfClusterCommand* cmd);

bool emAfPreCommandReceived(EmberAfClusterCommand* cmd)
{
	rpc_PreCommandReceivedCallback(cmd);
  return (emAfPluginCommandRelayPreCommandReceivedCallback(cmd)
          || emAfPluginDeviceTablePreCommandReceivedCallback(cmd)
          || emberAfPreCommandReceivedCallback(cmd));
}

// PreZDOMessageReceived function declarations.
bool emAfPluginDeviceTablePreZDOMessageReceived(EmberNodeId emberNodeId,EmberApsFrame* apsFrame,uint8_t* message,uint16_t length);
//bool emberAfPluginGatewayRelayMqttPreZDOMessageReceivedCallback(EmberNodeId emberNodeId,EmberApsFrame* apsFrame,uint8_t* message,uint16_t length);
bool emberAfPreZDOMessageReceivedCallback(EmberNodeId emberNodeId,EmberApsFrame* apsFrame,uint8_t* message,uint16_t length);

bool emAfPreZDOMessageReceived(EmberNodeId emberNodeId,EmberApsFrame* apsFrame,uint8_t* message,uint16_t length)
{
  return (emAfPluginDeviceTablePreZDOMessageReceived(emberNodeId, apsFrame, message, length)
          || emberAfPreZDOMessageReceivedCallback(emberNodeId, apsFrame, message, length));
}

// RetrieveAttributeAndCraftResponse function declarations.
bool emAfPluginGreenPowerClientRetrieveAttributeAndCraftResponse(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attrId, uint8_t mask, uint16_t maunfacturerCode, uint16_t readLength);

bool emAfRetrieveAttributeAndCraftResponse(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attrId, uint8_t mask, uint16_t maunfacturerCode, uint16_t readLength)
{
  return emAfPluginGreenPowerClientRetrieveAttributeAndCraftResponse(endpoint, clusterId, attrId, mask, maunfacturerCode, readLength);
}

// ZigbeeKeyEstablishment function declarations.
void emberAfPluginNetworkCreatorSecurityZigbeeKeyEstablishmentCallback(EmberEUI64 partner, EmberKeyStatus status);
void emberAfZigbeeKeyEstablishmentCallback(EmberEUI64 partner, EmberKeyStatus status);

void emAfZigbeeKeyEstablishment(EmberEUI64 partner, EmberKeyStatus status)
{
  emberAfPluginNetworkCreatorSecurityZigbeeKeyEstablishmentCallback(partner, status);
  emberAfZigbeeKeyEstablishmentCallback(partner, status);
}

// ReadAttributesResponse function declarations.
//bool emberAfReadAttributesResponseCallback(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen);



// ReportAttributes function declarations.
bool emberAfReportAttributesCallback(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
bool kk_ReportAttributesCallback(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
bool kk_ReadAttributesResponseCallback(EmberAfClusterId clusterId,uint8_t *buffer,uint16_t bufLen);
														
														

bool emAfReportAttributes(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen)
{
	return kk_ReportAttributesCallback(clusterId, buffer, bufLen);
}
bool emAfReadAttributesResponse(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen)
{
	return kk_ReadAttributesResponseCallback(clusterId, buffer, bufLen);
}


// PluginDeviceTableDeviceLeft function declarations.
void emAfPluginCommandRelayRemoveDeviceByEui64(EmberEUI64 newNodeEui64);
void emberAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64);

void emAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64)
{
	//emAfPluginCommandRelayRemoveDeviceByEui64(newNodeEui64);
	emberAfPluginDeviceTableDeviceLeftCallback(newNodeEui64);
}
