Commit 400197f8 authored by whmaizmy's avatar whmaizmy

【修改内容】增加zigbee相关

【提交人】陈伟灿
parent fc5ec9a9

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

...@@ -18,6 +18,9 @@ SUBDIRS += common/api ...@@ -18,6 +18,9 @@ SUBDIRS += common/api
SUBDIRS += common/nanomsg SUBDIRS += common/nanomsg
SUBDIRS += common/ev SUBDIRS += common/ev
SUBDIRS += common/sqlite SUBDIRS += common/sqlite
SUBDIRS += platform/zigbee
#SUBDIRS += example/json
$(call Append_Conditional, SUBDIRS) $(call Append_Conditional, SUBDIRS)
include $(RULE_DIR)/rules.mk include $(RULE_DIR)/rules.mk
......
build/afv2-bookkeeping.d: afv2-bookkeeping.c \
../../../platform/base/hal/micro/unix/compiler/gcc.h \
../../../platform/base/hal/../hal/micro/generic/compiler/platform-common.h \
../../../protocol/zigbee/app/framework/util/config.h \
../../../app/builder/Z3GatewayHost/./Z3GatewayHost.h \
../../../app/builder/Z3GatewayHost/./Z3GatewayHost_endpoint_config.h \
../../../protocol/zigbee/app/framework/../../app/framework/security/security-config.h \
../../../protocol/zigbee/app/framework/include/af.h \
../../../protocol/zigbee/app/framework/../../stack/../../../platform/base/hal/micro/unix/compiler/gcc.h \
../../../protocol/zigbee/app/framework/../../stack/../../../protocol/zigbee/app/framework/util/config.h \
../../../protocol/zigbee/app/framework/../../stack/include/error.h \
../../../protocol/zigbee/app/framework/../../stack/include/error-def.h \
../../../protocol/zigbee/app/framework/../../stack/include/ember-types.h \
../../../protocol/zigbee/app/framework/../../stack/config/ember-configuration-defaults.h \
../../../protocol/zigbee/app/framework/../../stack/include/ember-static-struct.h \
../../../protocol/zigbee/app/framework/../../stack/include/zll-types.h \
../../../protocol/zigbee/app/framework/../../stack/include/gp-types.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-protocol.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-enum.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/secure-ezsp-protocol.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/secure-ezsp-types.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-enum.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/rename-ezsp-functions.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/command-prototypes.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-utils.h \
../../../protocol/zigbee/app/framework/../../app/util/ezsp/serial-interface.h \
../../../platform/base/hal/../hal/hal.h \
../../../platform/base/hal/../hal/micro/micro.h \
../../../platform/base/hal/../hal/micro/generic/em2xx-reset-defs.h \
../../../platform/base/hal/../hal/micro/micro-types.h \
../../../platform/base/hal/../hal/micro/micro-common.h \
../../../platform/base/hal/../hal/micro/unix/host/micro.h \
../../../app/builder/Z3GatewayHost/Z3GatewayHost_board.h \
../../../platform/base/hal/../hal/plugin/antenna/antenna.h \
../../../platform/base/hal/../hal/plugin/adc/adc.h \
../../../platform/base/hal/../hal/micro/button.h \
../../../platform/base/hal/../hal/plugin/buzzer/buzzer.h \
../../../platform/base/hal/../hal/micro/crc.h \
../../../platform/base/hal/../hal/micro/endian.h \
../../../platform/base/hal/../hal/micro/led.h \
../../../platform/base/hal/../hal/micro/random.h \
../../../platform/base/hal/../hal/micro/serial.h \
../../../platform/base/hal/../hal/micro/spi.h \
../../../platform/base/hal/../hal/micro/system-timer.h \
../../../platform/base/hal/../hal/micro/bootloader-eeprom.h \
../../../platform/base/hal/plugin/serial/serial.h \
../../../protocol/zigbee/app/framework/../../stack/include/event.h \
../../../protocol/zigbee/app/framework/include/af-types.h \
../../../app/builder/Z3GatewayHost/enums.h \
../../../protocol/zigbee/app/framework/../../app/framework/util/print.h \
../../../app/builder/Z3GatewayHost/debug-printing.h \
../../../app/builder/Z3GatewayHost/debug-util.h \
../../../protocol/zigbee/app/framework/../../app/framework/util/time-util.h \
../../../app/builder/Z3GatewayHost/af-structs.h \
../../../app/builder/Z3GatewayHost/attribute-id.h \
../../../app/builder/Z3GatewayHost/att-storage.h \
../../../app/builder/Z3GatewayHost/attribute-type.h \
../../../app/builder/Z3GatewayHost/call-command-handler.h \
../../../app/builder/Z3GatewayHost/callback.h \
../../../protocol/zigbee/app/framework/../../app/framework/include/af-types.h \
../../../protocol/zigbee/app/framework/../../app/framework/util/util.h \
../../../protocol/zigbee/app/framework/../../app/framework/util/../include/af.h \
../../../app/builder/Z3GatewayHost/../../../platform/base/hal/micro/unix/compiler/gcc.h \
../../../protocol/zigbee/app/framework/../../app/framework/plugin/ota-server-policy/ota-server-policy.h \
../../../app/builder/Z3GatewayHost/../../../protocol/zigbee/app/framework/util/config.h \
../../../util/plugin/plugin-common/transport-mqtt/transport-mqtt.h \
../../../app/builder/Z3GatewayHost/client-command-macro.h \
../../../app/builder/Z3GatewayHost/cluster-id.h \
../../../app/builder/Z3GatewayHost/command-id.h \
../../../app/builder/Z3GatewayHost/print-cluster.h \
../../../protocol/zigbee/app/framework/../../app/framework/util/client-api.h \
../../../protocol/zigbee/app/framework/../../app/util/serial/command-interpreter2.h \
../../../protocol/zigbee/app/framework/../../app/framework/cli/zcl-cli.h
../../../platform/base/hal/micro/unix/compiler/gcc.h:
../../../platform/base/hal/../hal/micro/generic/compiler/platform-common.h:
../../../protocol/zigbee/app/framework/util/config.h:
../../../app/builder/Z3GatewayHost/./Z3GatewayHost.h:
../../../app/builder/Z3GatewayHost/./Z3GatewayHost_endpoint_config.h:
../../../protocol/zigbee/app/framework/../../app/framework/security/security-config.h:
../../../protocol/zigbee/app/framework/include/af.h:
../../../protocol/zigbee/app/framework/../../stack/../../../platform/base/hal/micro/unix/compiler/gcc.h:
../../../protocol/zigbee/app/framework/../../stack/../../../protocol/zigbee/app/framework/util/config.h:
../../../protocol/zigbee/app/framework/../../stack/include/error.h:
../../../protocol/zigbee/app/framework/../../stack/include/error-def.h:
../../../protocol/zigbee/app/framework/../../stack/include/ember-types.h:
../../../protocol/zigbee/app/framework/../../stack/config/ember-configuration-defaults.h:
../../../protocol/zigbee/app/framework/../../stack/include/ember-static-struct.h:
../../../protocol/zigbee/app/framework/../../stack/include/zll-types.h:
../../../protocol/zigbee/app/framework/../../stack/include/gp-types.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-protocol.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-enum.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/secure-ezsp-protocol.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/secure-ezsp-types.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-enum.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/rename-ezsp-functions.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/command-prototypes.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/ezsp-utils.h:
../../../protocol/zigbee/app/framework/../../app/util/ezsp/serial-interface.h:
../../../platform/base/hal/../hal/hal.h:
../../../platform/base/hal/../hal/micro/micro.h:
../../../platform/base/hal/../hal/micro/generic/em2xx-reset-defs.h:
../../../platform/base/hal/../hal/micro/micro-types.h:
../../../platform/base/hal/../hal/micro/micro-common.h:
../../../platform/base/hal/../hal/micro/unix/host/micro.h:
../../../app/builder/Z3GatewayHost/Z3GatewayHost_board.h:
../../../platform/base/hal/../hal/plugin/antenna/antenna.h:
../../../platform/base/hal/../hal/plugin/adc/adc.h:
../../../platform/base/hal/../hal/micro/button.h:
../../../platform/base/hal/../hal/plugin/buzzer/buzzer.h:
../../../platform/base/hal/../hal/micro/crc.h:
../../../platform/base/hal/../hal/micro/endian.h:
../../../platform/base/hal/../hal/micro/led.h:
../../../platform/base/hal/../hal/micro/random.h:
../../../platform/base/hal/../hal/micro/serial.h:
../../../platform/base/hal/../hal/micro/spi.h:
../../../platform/base/hal/../hal/micro/system-timer.h:
../../../platform/base/hal/../hal/micro/bootloader-eeprom.h:
../../../platform/base/hal/plugin/serial/serial.h:
../../../protocol/zigbee/app/framework/../../stack/include/event.h:
../../../protocol/zigbee/app/framework/include/af-types.h:
../../../app/builder/Z3GatewayHost/enums.h:
../../../protocol/zigbee/app/framework/../../app/framework/util/print.h:
../../../app/builder/Z3GatewayHost/debug-printing.h:
../../../app/builder/Z3GatewayHost/debug-util.h:
../../../protocol/zigbee/app/framework/../../app/framework/util/time-util.h:
../../../app/builder/Z3GatewayHost/af-structs.h:
../../../app/builder/Z3GatewayHost/attribute-id.h:
../../../app/builder/Z3GatewayHost/att-storage.h:
../../../app/builder/Z3GatewayHost/attribute-type.h:
../../../app/builder/Z3GatewayHost/call-command-handler.h:
../../../app/builder/Z3GatewayHost/callback.h:
../../../protocol/zigbee/app/framework/../../app/framework/include/af-types.h:
../../../protocol/zigbee/app/framework/../../app/framework/util/util.h:
../../../protocol/zigbee/app/framework/../../app/framework/util/../include/af.h:
../../../app/builder/Z3GatewayHost/../../../platform/base/hal/micro/unix/compiler/gcc.h:
../../../protocol/zigbee/app/framework/../../app/framework/plugin/ota-server-policy/ota-server-policy.h:
../../../app/builder/Z3GatewayHost/../../../protocol/zigbee/app/framework/util/config.h:
../../../util/plugin/plugin-common/transport-mqtt/transport-mqtt.h:
../../../app/builder/Z3GatewayHost/client-command-macro.h:
../../../app/builder/Z3GatewayHost/cluster-id.h:
../../../app/builder/Z3GatewayHost/command-id.h:
../../../app/builder/Z3GatewayHost/print-cluster.h:
../../../protocol/zigbee/app/framework/../../app/framework/util/client-api.h:
../../../protocol/zigbee/app/framework/../../app/util/serial/command-interpreter2.h:
../../../protocol/zigbee/app/framework/../../app/framework/cli/zcl-cli.h:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
all:
@echo 'No Toolchain to build with.'
@echo ' Go to Project > Properties > C/C++ Build > Manage Configurations... > New'
@echo ' Then select a configuration from your preferred toolchain'
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/** @file host.h
* @brief Sample API functions.
*
* See also @ref board.
*
* <!-- Author(s): Lee Taylor, lee@ember.com -->
* <!-- Copyright 2005 by Ember Corporation. All rights reserved. *80*-->
*/
/** @addtogroup board
*
* See host.h for source code.
*@{
*/
#define halInternalInitBoard() \
do { \
/*halInternalInitLed(); not currently simulated */ \
} while (0)
#define halInternalPowerDownBoard() \
do { \
/*halInternalInitLed(); not currently simulated */ \
} while (0)
#define halInternalPowerUpBoard() \
do { \
} while (0)
enum HalBoardLedPins {
BOARDLED0 = 0,
BOARDLED1 = 1,
BOARDLED2 = 2,
BOARDLED3 = 3,
BOARDLED4 = 4,
BOARDLED5 = 5,
BOARD_ACTIVITY_LED = BOARDLED0,
BOARD_HEARTBEAT_LED = BOARDLED1
};
#define BUTTON0 0
#define BUTTON1 1
#define TEMP_SENSOR_ADC_CHANNEL 0
#define TEMP_SENSOR_SCALE_FACTOR 3
/** @} END addtogroup */
// Copyright 2016 Silicon Laboratories, Inc. *80*
// This callback file is created for your convenience. You may add application
// code to this file. If you regenerate this file over a previous version, the
// previous version will be overwritten and any code you have added will be
// lost.
#include "af.h"
#include "app/framework/util/af-main.h"
#include "app/framework/util/util.h"
#include "app/framework/plugin/concentrator/source-route-common.h"
#include "app/util/zigbee-framework/zigbee-device-common.h"
#include "stack/include/trust-center.h"
#include <stdlib.h>
// the number of tokens that can be written using ezspSetToken and read
// using ezspGetToken
#define MFGSAMP_NUM_EZSP_TOKENS 8
// the size of the tokens that can be written using ezspSetToken and
// read using ezspGetToken
#define MFGSAMP_EZSP_TOKEN_SIZE 8
// the number of manufacturing tokens
#define MFGSAMP_NUM_EZSP_MFG_TOKENS 11
// the size of the largest EZSP Mfg token, EZSP_MFG_CBKE_DATA
// please refer to app/util/ezsp/ezsp-enum.h
#define MFGSAMP_EZSP_TOKEN_MFG_MAXSIZE 92
EmberStatus emberAfTrustCenterStartNetworkKeyUpdate(void);
// Forward declarations of custom cli command functions
static void printSourceRouteTable(void);
static void mfgappTokenDump(void);
static void changeNwkKeyCommand(void);
static void printNextKeyCommand(void);
static void versionCommand(void);
static void setTxPowerCommand(void);
EmberCommandEntry emberAfCustomCommands[] = {
emberCommandEntryAction("print_srt", printSourceRouteTable, "", ""),
emberCommandEntryAction("tokdump", mfgappTokenDump, "", ""),
emberCommandEntryAction("changeNwkKey", changeNwkKeyCommand, "", ""),
emberCommandEntryAction("printNextKey", printNextKeyCommand, "", ""),
emberCommandEntryAction("version", versionCommand, "", ""),
emberCommandEntryAction("txPower", setTxPowerCommand, "s", ""),
emberCommandEntryTerminator()
};
//// ******* test of token dump code
// the manufacturing tokens are enumerated in app/util/ezsp/ezsp-protocol.h
// the names are enumerated here to make it easier for the user
PGM_NO_CONST PGM_P ezspMfgTokenNames[] =
{
"EZSP_MFG_CUSTOM_VERSION...",
"EZSP_MFG_STRING...........",
"EZSP_MFG_BOARD_NAME.......",
"EZSP_MFG_MANUF_ID.........",
"EZSP_MFG_PHY_CONFIG.......",
"EZSP_MFG_BOOTLOAD_AES_KEY.",
"EZSP_MFG_ASH_CONFIG.......",
"EZSP_MFG_EZSP_STORAGE.....",
"EZSP_STACK_CAL_DATA.......",
"EZSP_MFG_CBKE_DATA........",
"EZSP_MFG_INSTALLATION_CODE"
};
// IAS ACE Server side callbacks
bool emberAfIasAceClusterArmCallback(uint8_t armMode,
uint8_t* armDisarmCode,
uint8_t zoneId)
{
uint16_t armDisarmCodeLength = emberAfStringLength(armDisarmCode);
EmberNodeId sender = emberGetSender();
uint16_t i;
emberAfAppPrint("IAS ACE Arm Received %x", armMode);
// Start i at 1 to skip over leading character in the byte array as it is the
// length byte
for (i = 1; i < armDisarmCodeLength; i++) {
emberAfAppPrint("%c", armDisarmCode[i]);
}
emberAfAppPrintln(" %x", zoneId);
emberAfFillCommandIasAceClusterArmResponse(armMode);
emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, sender);
return true;
}
bool emberAfIasAceClusterBypassCallback(uint8_t numberOfZones,
uint8_t* zoneIds,
uint8_t* armDisarmCode)
{
EmberNodeId sender = emberGetSender();
uint8_t i;
emberAfAppPrint("IAS ACE Cluster Bypass for zones ");
for (i = 0; i < numberOfZones; i++) {
emberAfAppPrint("%d ", zoneIds[i]);
}
emberAfAppPrintln("");
emberAfFillCommandIasAceClusterBypassResponse(numberOfZones,
zoneIds,
numberOfZones);
emberAfSendCommandUnicast(EMBER_OUTGOING_DIRECT, sender);
return true;
}
// code to print out the source route table
static void printSourceRouteTable(void)
{
uint8_t i;
for (i = 0; i < sourceRouteTableSize; i++) {
if (sourceRouteTable[i].destination != 0x0000) {
emberAfCorePrintln("[ind]%x[dest]%2x[closer]%x[older]%x",
i,
sourceRouteTable[i].destination,
sourceRouteTable[i].closerIndex,
sourceRouteTable[i].olderIndex);
}
emberSerialWaitSend(APP_SERIAL);
}
emberAfCorePrintln("<print srt>");
emberSerialWaitSend(APP_SERIAL);
}
// Called to dump all of the tokens. This dumps the indices, the names,
// and the values using ezspGetToken and ezspGetMfgToken. The indices
// are used for read and write functions below.
static void mfgappTokenDump(void)
{
EmberStatus status;
uint8_t tokenData[MFGSAMP_EZSP_TOKEN_MFG_MAXSIZE];
uint8_t index, i, tokenLength;
// first go through the tokens accessed using ezspGetToken
emberAfCorePrintln("(data shown little endian)");
emberAfCorePrintln("Tokens:");
emberAfCorePrintln("idx value:");
for (index = 0; index < MFGSAMP_NUM_EZSP_TOKENS; index++) {
// get the token data here
status = ezspGetToken(index, tokenData);
emberAfCorePrint("[%d]", index);
if (status == EMBER_SUCCESS) {
// Print out the token data
for (i = 0; i < MFGSAMP_EZSP_TOKEN_SIZE; i++) {
emberAfCorePrint(" %X", tokenData[i]);
}
emberSerialWaitSend(APP_SERIAL);
emberAfCorePrintln("");
} else {
// handle when ezspGetToken returns an error
emberAfCorePrintln(" ... error 0x%x ...",
status);
}
}
// now go through the tokens accessed using ezspGetMfgToken
// the manufacturing tokens are enumerated in app/util/ezsp/ezsp-protocol.h
// this file contains an array (ezspMfgTokenNames) representing the names.
emberAfCorePrintln("Manufacturing Tokens:");
emberAfCorePrintln("idx token name len value");
for (index = 0; index < MFGSAMP_NUM_EZSP_MFG_TOKENS; index++) {
// ezspGetMfgToken returns a length, be careful to only access
// valid token indices.
tokenLength = ezspGetMfgToken(index, tokenData);
emberAfCorePrintln("[%x] %p: 0x%x:", index,
ezspMfgTokenNames[index], tokenLength);
// Print out the token data
for (i = 0; i < tokenLength; i++) {
if ((i != 0) && ((i % 8) == 0)) {
emberAfCorePrintln("");
emberAfCorePrint(" :");
emberSerialWaitSend(APP_SERIAL);
}
emberAfCorePrint(" %X", tokenData[i]);
}
emberSerialWaitSend(APP_SERIAL);
emberAfCorePrintln("");
}
emberAfCorePrintln("");
}
static void changeNwkKeyCommand(void)
{
EmberStatus status = emberAfTrustCenterStartNetworkKeyUpdate();
if (status != EMBER_SUCCESS) {
emberAfCorePrintln("Change Key Error %x", status);
} else {
emberAfCorePrintln("Change Key Success");
}
}
static void dcPrintKey(uint8_t label, uint8_t *key)
{
uint8_t i;
emberAfCorePrintln("key %x: ", label);
for (i = 0; i < EMBER_ENCRYPTION_KEY_SIZE; i++) {
emberAfCorePrint("%x", key[i]);
}
emberAfCorePrintln("");
}
static void printNextKeyCommand(void)
{
EmberKeyStruct nextNwkKey;
EmberStatus status;
status = emberGetKey(EMBER_NEXT_NETWORK_KEY,
&nextNwkKey);
if (status != EMBER_SUCCESS) {
emberAfCorePrintln("Error getting key");
} else {
dcPrintKey(1, nextNwkKey.key.contents);
}
}
static void versionCommand(void)
{
emberAfCorePrintln("Version: 0.1 Alpha");
emberAfCorePrintln(" %s", __DATE__);
emberAfCorePrintln(" %s", __TIME__);
emberAfCorePrintln("");
}
static void setTxPowerCommand(void)
{
int8_t dBm = (int8_t)emberSignedCommandArgument(0);
if(emberSetRadioPower(dBm)==EMBER_SUCCESS){
emberAfCorePrintln("set tx power suc,%d dbm",dBm);
}else{
emberAfCorePrintln("out of range,%d dbm",dBm);
}
emberAfCorePrintln("");
}
This diff is collapsed.
// 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)
|| emberAfPluginGatewayRelayMqttPreCommandReceivedCallback(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)
|| emberAfPluginGatewayRelayMqttPreZDOMessageReceivedCallback(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);
bool emAfReadAttributesResponse(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen)
{
return emberAfReadAttributesResponseCallback(clusterId, buffer, bufLen);
}
// ReportAttributes function declarations.
bool emberAfReportAttributesCallback(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
bool emAfReportAttributes(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen)
{
return emberAfReportAttributesCallback(clusterId, buffer, bufLen);
}
// PluginDeviceTableDeviceLeft function declarations.
void emAfPluginCommandRelayRemoveDeviceByEui64(EmberEUI64 newNodeEui64);
void emberAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64);
void emAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64)
{
emAfPluginCommandRelayRemoveDeviceByEui64(newNodeEui64);
emberAfPluginDeviceTableDeviceLeftCallback(newNodeEui64);
}
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_AFV2_BOOKKEEPING_H
#define SILABS_AFV2_BOOKKEEPING_H
#include PLATFORM_HEADER
#include CONFIGURATION_HEADER
#include "af.h"
void emAfInit(void);
void emAfTick(void);
void emAfResetAttributes(uint8_t endpointId);
bool emAfPreCommandReceived(EmberAfClusterCommand* cmd);
bool emAfPreZDOMessageReceived(EmberNodeId emberNodeId,EmberApsFrame* apsFrame,uint8_t* message,uint16_t length);
bool emAfRetrieveAttributeAndCraftResponse(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attrId, uint8_t mask, uint16_t maunfacturerCode, uint16_t readLength);
void emAfZigbeeKeyEstablishment(EmberEUI64 partner, EmberKeyStatus status);
bool emAfReadAttributesResponse(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen);
bool emAfReportAttributes(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
void emAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64);
#endif // SILABS_AFV2_BOOKKEEPING_H
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_ATTRIBUTE_STORAGE_GEN
#define SILABS_ATTRIBUTE_STORAGE_GEN
// Attribute masks modify how attributes are used by the framework
// Attribute that has this mask is NOT read-only
#define ATTRIBUTE_MASK_WRITABLE (0x01)
// Attribute that has this mask is saved to a token
#define ATTRIBUTE_MASK_TOKENIZE (0x02)
// Attribute that has this mask has a min/max values
#define ATTRIBUTE_MASK_MIN_MAX (0x04)
// Manufacturer specific attribute
#define ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC (0x08)
// Attribute deferred to external storage
#define ATTRIBUTE_MASK_EXTERNAL_STORAGE (0x10)
// Attribute is singleton
#define ATTRIBUTE_MASK_SINGLETON (0x20)
// Attribute is a client attribute
#define ATTRIBUTE_MASK_CLIENT (0x40)
// Cluster masks modify how clusters are used by the framework
// Does this cluster have init function?
#define CLUSTER_MASK_INIT_FUNCTION (0x01)
// Does this cluster have attribute changed function?
#define CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION (0x02)
// Does this cluster have default response function?
#define CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION (0x04)
// Does this cluster have message sent function?
#define CLUSTER_MASK_MESSAGE_SENT_FUNCTION (0x08)
// Does this cluster have manufacturer specific attribute changed funciton?
#define CLUSTER_MASK_MANUFACTURER_SPECIFIC_ATTRIBUTE_CHANGED_FUNCTION (0x10)
// Does this cluster have pre-attribute changed function?
#define CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION (0x20)
// Cluster is a server
#define CLUSTER_MASK_SERVER (0x40)
// Cluster is a client
#define CLUSTER_MASK_CLIENT (0x80)
// Command masks modify meanings of commands
// Is sending of this client command supported
#define COMMAND_MASK_OUTGOING_CLIENT (0x01)
// Is sending of this server command supported
#define COMMAND_MASK_OUTGOING_SERVER (0x02)
// Is receiving of this client command supported
#define COMMAND_MASK_INCOMING_CLIENT (0x04)
// Is receiving of this server command supported
#define COMMAND_MASK_INCOMING_SERVER (0x08)
// Is this command manufacturer specific?
#define COMMAND_MASK_MANUFACTURER_SPECIFIC (0x10)
#endif // SILABS_ATTRIBUTE_STORAGE_GEN
This diff is collapsed.
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_ATTRIBUTE_SIZE
#define SILABS_ATTRIBUTE_SIZE
// Used ZCL attribute type sizes
ZCL_BITMAP16_ATTRIBUTE_TYPE, 2,
ZCL_BITMAP24_ATTRIBUTE_TYPE, 3,
ZCL_BITMAP32_ATTRIBUTE_TYPE, 4,
ZCL_BITMAP48_ATTRIBUTE_TYPE, 6,
ZCL_BITMAP64_ATTRIBUTE_TYPE, 8,
ZCL_BITMAP8_ATTRIBUTE_TYPE, 1,
ZCL_BOOLEAN_ATTRIBUTE_TYPE, 1,
ZCL_DATA8_ATTRIBUTE_TYPE, 1,
ZCL_ENUM16_ATTRIBUTE_TYPE, 2,
ZCL_ENUM8_ATTRIBUTE_TYPE, 1,
ZCL_FLOAT_SINGLE_ATTRIBUTE_TYPE, 4,
ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8,
ZCL_INT16S_ATTRIBUTE_TYPE, 2,
ZCL_INT16U_ATTRIBUTE_TYPE, 2,
ZCL_INT24S_ATTRIBUTE_TYPE, 3,
ZCL_INT24U_ATTRIBUTE_TYPE, 3,
ZCL_INT32S_ATTRIBUTE_TYPE, 4,
ZCL_INT32U_ATTRIBUTE_TYPE, 4,
ZCL_INT48U_ATTRIBUTE_TYPE, 6,
ZCL_INT56U_ATTRIBUTE_TYPE, 7,
ZCL_INT8S_ATTRIBUTE_TYPE, 1,
ZCL_INT8U_ATTRIBUTE_TYPE, 1,
ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4,
#endif // SILABS_ATTRIBUTE_SIZE
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_EMBER_AF_ATTRIBUTE_TYPES
#define SILABS_EMBER_AF_ATTRIBUTE_TYPES
// ZCL attribute types
enum {
ZCL_NO_DATA_ATTRIBUTE_TYPE = 0x00, // No data
ZCL_DATA8_ATTRIBUTE_TYPE = 0x08, // 8-bit data
ZCL_DATA16_ATTRIBUTE_TYPE = 0x09, // 16-bit data
ZCL_DATA24_ATTRIBUTE_TYPE = 0x0A, // 24-bit data
ZCL_DATA32_ATTRIBUTE_TYPE = 0x0B, // 32-bit data
ZCL_DATA40_ATTRIBUTE_TYPE = 0x0C, // 40-bit data
ZCL_DATA48_ATTRIBUTE_TYPE = 0x0D, // 48-bit data
ZCL_DATA56_ATTRIBUTE_TYPE = 0x0E, // 56-bit data
ZCL_DATA64_ATTRIBUTE_TYPE = 0x0F, // 64-bit data
ZCL_BOOLEAN_ATTRIBUTE_TYPE = 0x10, // Boolean
ZCL_BITMAP8_ATTRIBUTE_TYPE = 0x18, // 8-bit bitmap
ZCL_BITMAP16_ATTRIBUTE_TYPE = 0x19, // 16-bit bitmap
ZCL_BITMAP24_ATTRIBUTE_TYPE = 0x1A, // 24-bit bitmap
ZCL_BITMAP32_ATTRIBUTE_TYPE = 0x1B, // 32-bit bitmap
ZCL_BITMAP40_ATTRIBUTE_TYPE = 0x1C, // 40-bit bitmap
ZCL_BITMAP48_ATTRIBUTE_TYPE = 0x1D, // 48-bit bitmap
ZCL_BITMAP56_ATTRIBUTE_TYPE = 0x1E, // 56-bit bitmap
ZCL_BITMAP64_ATTRIBUTE_TYPE = 0x1F, // 64-bit bitmap
ZCL_INT8U_ATTRIBUTE_TYPE = 0x20, // Unsigned 8-bit integer
ZCL_INT16U_ATTRIBUTE_TYPE = 0x21, // Unsigned 16-bit integer
ZCL_INT24U_ATTRIBUTE_TYPE = 0x22, // Unsigned 24-bit integer
ZCL_INT32U_ATTRIBUTE_TYPE = 0x23, // Unsigned 32-bit integer
ZCL_INT40U_ATTRIBUTE_TYPE = 0x24, // Unsigned 40-bit integer
ZCL_INT48U_ATTRIBUTE_TYPE = 0x25, // Unsigned 48-bit integer
ZCL_INT56U_ATTRIBUTE_TYPE = 0x26, // Unsigned 56-bit integer
ZCL_INT64U_ATTRIBUTE_TYPE = 0x27, // Unsigned 64-bit integer
ZCL_INT8S_ATTRIBUTE_TYPE = 0x28, // Signed 8-bit integer
ZCL_INT16S_ATTRIBUTE_TYPE = 0x29, // Signed 16-bit integer
ZCL_INT24S_ATTRIBUTE_TYPE = 0x2A, // Signed 24-bit integer
ZCL_INT32S_ATTRIBUTE_TYPE = 0x2B, // Signed 32-bit integer
ZCL_INT40S_ATTRIBUTE_TYPE = 0x2C, // Signed 40-bit integer
ZCL_INT48S_ATTRIBUTE_TYPE = 0x2D, // Signed 48-bit integer
ZCL_INT56S_ATTRIBUTE_TYPE = 0x2E, // Signed 56-bit integer
ZCL_INT64S_ATTRIBUTE_TYPE = 0x2F, // Signed 64-bit integer
ZCL_ENUM8_ATTRIBUTE_TYPE = 0x30, // 8-bit enumeration
ZCL_ENUM16_ATTRIBUTE_TYPE = 0x31, // 16-bit enumeration
ZCL_FLOAT_SEMI_ATTRIBUTE_TYPE = 0x38, // Semi-precision
ZCL_FLOAT_SINGLE_ATTRIBUTE_TYPE = 0x39, // Single precision
ZCL_FLOAT_DOUBLE_ATTRIBUTE_TYPE = 0x3A, // Double precision
ZCL_OCTET_STRING_ATTRIBUTE_TYPE = 0x41, // Octet string
ZCL_CHAR_STRING_ATTRIBUTE_TYPE = 0x42, // Character string
ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE = 0x43, // Long octet string
ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE = 0x44, // Long character string
ZCL_ARRAY_ATTRIBUTE_TYPE = 0x48, // Array
ZCL_STRUCT_ATTRIBUTE_TYPE = 0x4C, // Structure
ZCL_SET_ATTRIBUTE_TYPE = 0x50, // Set
ZCL_BAG_ATTRIBUTE_TYPE = 0x51, // Bag
ZCL_TIME_OF_DAY_ATTRIBUTE_TYPE = 0xE0, // Time of day
ZCL_DATE_ATTRIBUTE_TYPE = 0xE1, // Date
ZCL_UTC_TIME_ATTRIBUTE_TYPE = 0xE2, // UTC Time
ZCL_CLUSTER_ID_ATTRIBUTE_TYPE = 0xE8, // Cluster ID
ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE = 0xE9, // Attribute ID
ZCL_BACNET_OID_ATTRIBUTE_TYPE = 0xEA, // BACnet OID
ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE = 0xF0, // IEEE address
ZCL_SECURITY_KEY_ATTRIBUTE_TYPE = 0xF1, // 128-bit security key
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF // Unknown
};
#endif // SILABS_EMBER_AF_ATTRIBUTE_TYPES
This diff is collapsed.
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished.
* end_ptr will point to 1 past the end of the JSON object */
extern cJSON *cJSON_Parse_Stream(const char *value, char **end_ptr);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
extern char *cJSON_Print_pure(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull();
extern cJSON *cJSON_CreateTrue();
extern cJSON *cJSON_CreateFalse();
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray();
extern cJSON *cJSON_CreateObject();
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_EMBER_AF_COMMAND_PARSE_HEADER
#define SILABS_EMBER_AF_COMMAND_PARSE_HEADER
// This is a set of generated prototype for functions that parse the
// the incomming message, and call appropriate command handler.
// Cluster: Basic, server
EmberAfStatus emberAfBasicClusterServerCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Identify, client
EmberAfStatus emberAfIdentifyClusterClientCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Identify, server
EmberAfStatus emberAfIdentifyClusterServerCommandParse(EmberAfClusterCommand *cmd);
// Cluster: On/off, server
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Level Control, server
EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Poll Control, client
EmberAfStatus emberAfPollControlClusterClientCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Green Power, client
EmberAfStatus emberAfGreenPowerClusterClientCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Color Control, server
EmberAfStatus emberAfColorControlClusterServerCommandParse(EmberAfClusterCommand *cmd);
// Cluster: IAS Zone, client
EmberAfStatus emberAfIasZoneClusterClientCommandParse(EmberAfClusterCommand *cmd);
// Cluster: Simple Metering, client
EmberAfStatus emberAfSimpleMeteringClusterClientCommandParse(EmberAfClusterCommand *cmd);
#endif // SILABS_EMBER_AF_COMMAND_PARSE_HEADER
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Enclosing macro to prevent multiple inclusion
#ifndef SILABS_EMBER_AF_CLUSTER_ID
#define SILABS_EMBER_AF_CLUSTER_ID
// Cluster domain specification levels:
// * General: zcl-7.0-07-5123-07
// * Lighting & Occupancy: l&o-1.0-15-0014-04
// * HA: ha-1.2.1-05-3520-30
// * Closures: zcl-6.0-15-02018-001
// * HVAC: zcl-6.0-15-02018-001
// * Lighting: zcl6-errata-14-0129-15
// * Measurement & Sensing: zcl-6.0-15-02018-001
// * Security & Safety: zcl-6.0-15-02018-001
// * Home Automation: UNKNOWN
// * CBA: cba-1.0-05-3516-12
// * SE: se-1.2b-15-0131-02
// * ZLL: zll-1.0-11-0037-10
// * Telecom Applications: ta-1.0-07-5307-07
// * Protocol Interfaces: ta-1.0-07-5307-07
// * Telecommunication: ta-1.0-07-5307-07
// * Financial: ta-1.0-07-5307-07
// * Ember: UNKNOWN
// * HC: hc-1.0-07-5360-15
// * GP: gp-1.0a-09-5499-26
// * LO: UNKNOWN
// * Works With All Hubs: UNKNOWN
// * WWAH: UNKNOWN
#define ZCL_BASIC_CLUSTER_ID 0x0000
#define ZCL_POWER_CONFIG_CLUSTER_ID 0x0001
#define ZCL_DEVICE_TEMP_CLUSTER_ID 0x0002
#define ZCL_IDENTIFY_CLUSTER_ID 0x0003
#define ZCL_GROUPS_CLUSTER_ID 0x0004
#define ZCL_SCENES_CLUSTER_ID 0x0005
#define ZCL_ON_OFF_CLUSTER_ID 0x0006
#define ZCL_ON_OFF_SWITCH_CONFIG_CLUSTER_ID 0x0007
#define ZCL_LEVEL_CONTROL_CLUSTER_ID 0x0008
#define ZCL_ALARM_CLUSTER_ID 0x0009
#define ZCL_TIME_CLUSTER_ID 0x000A
#define ZCL_RSSI_LOCATION_CLUSTER_ID 0x000B
#define ZCL_BINARY_INPUT_BASIC_CLUSTER_ID 0x000F
#define ZCL_COMMISSIONING_CLUSTER_ID 0x0015
#define ZCL_PARTITION_CLUSTER_ID 0x0016
#define ZCL_OTA_BOOTLOAD_CLUSTER_ID 0x0019
#define ZCL_POWER_PROFILE_CLUSTER_ID 0x001A
#define ZCL_APPLIANCE_CONTROL_CLUSTER_ID 0x001B
#define ZCL_POLL_CONTROL_CLUSTER_ID 0x0020
#define ZCL_GREEN_POWER_CLUSTER_ID 0x0021
#define ZCL_KEEPALIVE_CLUSTER_ID 0x0025
#define ZCL_SHADE_CONFIG_CLUSTER_ID 0x0100
#define ZCL_DOOR_LOCK_CLUSTER_ID 0x0101
#define ZCL_WINDOW_COVERING_CLUSTER_ID 0x0102
#define ZCL_BARRIER_CONTROL_CLUSTER_ID 0x0103
#define ZCL_PUMP_CONFIG_CONTROL_CLUSTER_ID 0x0200
#define ZCL_THERMOSTAT_CLUSTER_ID 0x0201
#define ZCL_FAN_CONTROL_CLUSTER_ID 0x0202
#define ZCL_DEHUMID_CONTROL_CLUSTER_ID 0x0203
#define ZCL_THERMOSTAT_UI_CONFIG_CLUSTER_ID 0x0204
#define ZCL_COLOR_CONTROL_CLUSTER_ID 0x0300
#define ZCL_BALLAST_CONFIGURATION_CLUSTER_ID 0x0301
#define ZCL_ILLUM_MEASUREMENT_CLUSTER_ID 0x0400
#define ZCL_ILLUM_LEVEL_SENSING_CLUSTER_ID 0x0401
#define ZCL_TEMP_MEASUREMENT_CLUSTER_ID 0x0402
#define ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID 0x0403
#define ZCL_FLOW_MEASUREMENT_CLUSTER_ID 0x0404
#define ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID 0x0405
#define ZCL_OCCUPANCY_SENSING_CLUSTER_ID 0x0406
#define ZCL_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x040C
#define ZCL_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x040D
#define ZCL_ETHYLENE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x040E
#define ZCL_ETHYLENE_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x040F
#define ZCL_HYDROGEN_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0410
#define ZCL_HYDROGEN_SULPHIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0411
#define ZCL_NITRIC_OXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0412
#define ZCL_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0413
#define ZCL_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0414
#define ZCL_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0415
#define ZCL_SULFUR_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0416
#define ZCL_DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0417
#define ZCL_BROMATE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0418
#define ZCL_CHLORAMINES_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0419
#define ZCL_CHLORINE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041A
#define ZCL_FECAL_COLIFORM_AND_E_COLI_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041B
#define ZCL_FLUORIDE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041C
#define ZCL_HALOACETIC_ACIDS_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041D
#define ZCL_TOTAL_TRIHALOMETHANES_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041E
#define ZCL_TOTAL_COLIFORM_BACTERIA_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x041F
#define ZCL_TURBIDITY_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0420
#define ZCL_COPPER_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0421
#define ZCL_LEAD_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0422
#define ZCL_MANGANESE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0423
#define ZCL_SULFATE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0424
#define ZCL_BROMODICHLOROMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0425
#define ZCL_BROMOFORM_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0426
#define ZCL_CHLORODIBROMOMETHANE_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0427
#define ZCL_CHLOROFORM_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0428
#define ZCL_SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER_ID 0x0429
#define ZCL_IAS_ZONE_CLUSTER_ID 0x0500
#define ZCL_IAS_ACE_CLUSTER_ID 0x0501
#define ZCL_IAS_WD_CLUSTER_ID 0x0502
#define ZCL_GENERIC_TUNNEL_CLUSTER_ID 0x0600
#define ZCL_BACNET_PROTOCOL_TUNNEL_CLUSTER_ID 0x0601
#define ZCL_11073_PROTOCOL_TUNNEL_CLUSTER_ID 0x0614
#define ZCL_ISO7816_PROTOCOL_TUNNEL_CLUSTER_ID 0x0615
#define ZCL_PRICE_CLUSTER_ID 0x0700
#define ZCL_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_ID 0x0701
#define ZCL_SIMPLE_METERING_CLUSTER_ID 0x0702
#define ZCL_MESSAGING_CLUSTER_ID 0x0703
#define ZCL_TUNNELING_CLUSTER_ID 0x0704
#define ZCL_PREPAYMENT_CLUSTER_ID 0x0705
#define ZCL_ENERGY_MANAGEMENT_CLUSTER_ID 0x0706
#define ZCL_CALENDAR_CLUSTER_ID 0x0707
#define ZCL_DEVICE_MANAGEMENT_CLUSTER_ID 0x0708
#define ZCL_EVENTS_CLUSTER_ID 0x0709
#define ZCL_MDU_PAIRING_CLUSTER_ID 0x070A
#define ZCL_SUB_GHZ_CLUSTER_ID 0x070B
#define ZCL_KEY_ESTABLISHMENT_CLUSTER_ID 0x0800
#define ZCL_INFORMATION_CLUSTER_ID 0x0900
#define ZCL_DATA_SHARING_CLUSTER_ID 0x0901
#define ZCL_GAMING_CLUSTER_ID 0x0902
#define ZCL_DATA_RATE_CONTROL_CLUSTER_ID 0x0903
#define ZCL_VOICE_OVER_ZIGBEE_CLUSTER_ID 0x0904
#define ZCL_CHATTING_CLUSTER_ID 0x0905
#define ZCL_PAYMENT_CLUSTER_ID 0x0A01
#define ZCL_BILLING_CLUSTER_ID 0x0A02
#define ZCL_APPLIANCE_IDENTIFICATION_CLUSTER_ID 0x0B00
#define ZCL_METER_IDENTIFICATION_CLUSTER_ID 0x0B01
#define ZCL_APPLIANCE_EVENTS_AND_ALERT_CLUSTER_ID 0x0B02
#define ZCL_APPLIANCE_STATISTICS_CLUSTER_ID 0x0B03
#define ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID 0x0B04
#define ZCL_DIAGNOSTICS_CLUSTER_ID 0x0B05
#define ZCL_ZLL_COMMISSIONING_CLUSTER_ID 0x1000
#define ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID 0xFC00
#define ZCL_OTA_CONFIGURATION_CLUSTER_ID 0xFC01
#define ZCL_MFGLIB_CLUSTER_ID 0xFC02
#define ZCL_SL_WWAH_CLUSTER_ID 0xFC57
#endif // SILABS_EMBER_AF_CLUSTER_ID
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef __DEBUG_UTIL_H__
#define __DEBUG_UTIL_H__
#include <syslog.h>
#include <time.h>
#include <sys/time.h>
#include <sys/syscall.h>
#ifdef __cplusplus
extern "C" {
#endif
#define COLOR_DISPLAY 1
#define gettid() syscall(__NR_gettid)
#define DBG_LEVEL_EMERG LOG_EMERG
#define DBG_LEVEL_ALERT LOG_ALERT
#define DBG_LEVEL_CRIT LOG_CRIT
#define DBG_LEVEL_ERR LOG_ERR
#define DBG_LEVEL_WARNING LOG_WARNING
#define DBG_LEVEL_NOTICE LOG_NOTICE
#define DBG_LEVEL_INFO LOG_INFO
#define DBG_LEVEL_DEBUG LOG_DEBUG
#ifdef COLOR_DISPLAY
//"\033[0;32;31m<EMERG>" //red
//"\033[0;32;31m<ALERT>" //red
//"\033[0;32;31m<CRIT>" //red
//"\033[0;32;31m<ERR>" //red
//"\033[1;31m<WARN>" //light red
//"\033[1;37m<NOTICE>" //white
//"\033[1;33m<INFO>" //yellow
//"\033[m<NONE>"//none
//"\033[0;32;32m<DEBUG>" green
#define LOG_STRING(level) ((level == LOG_EMERG) ? "\033[0;32;31m<EMERG>" : \
(level == LOG_ALERT) ? "\033[0;32;31m<ALERT>" : \
(level == LOG_CRIT) ? "\033[0;32;31m<CRIT>" : \
(level == LOG_ERR) ? "\033[0;32;31m<ERR>" : \
(level == LOG_WARNING) ? "\033[1;31m<WARN>" : \
(level == LOG_NOTICE) ? "\033[1;37m<NOTICE>" : \
(level == LOG_INFO) ? "\033[1;33m<INFO>" : \
(level == LOG_DEBUG) ? "\033[0;32;32m<DEBUG>" : "\033[m<NONE>")
#else
#define LOG_STRING(level) ((level == LOG_EMERG) ? "EMERG" : \
(level == LOG_ALERT) ? "ALERT" : \
(level == LOG_CRIT) ? "CRIT" : \
(level == LOG_ERR) ? "ERR" : \
(level == LOG_WARNING) ? "WARNING" : \
(level == LOG_NOTICE) ? "NOTICE" : \
(level == LOG_INFO) ? "INFO" : \
(level == LOG_DEBUG) ? "DEBUG" : "NONE")
#endif
#define LOG(level, fmt, args...) \
do \
{ \
if (level <= DBG_LEVEL_DEBUG) \
{ \
time_t tp; \
struct tm * timeinfo; \
struct timeval tv; \
static char time_buf[32]; \
static char sprintf_buf[2048] = {0}; \
time(&tp); \
timeinfo = localtime(&tp); \
strftime(time_buf, 32, "%Y-%m-%d %H:%M:%S", timeinfo); \
gettimeofday(&tv, NULL); \
memset(sprintf_buf, 0, sizeof(sprintf_buf)); \
snprintf(sprintf_buf, sizeof(sprintf_buf), "%s %ld %s.%ld %s:%ld# "fmt"\033[m", \
LOG_STRING(level), \
(long int)gettid(), \
time_buf, \
(long int)tv.tv_usec, \
__FILE__, \
(long int)__LINE__, \
##args); \
syslog(level, "%s", sprintf_buf); \
printf("%s", sprintf_buf); \
} \
} while(0)
#define UTIL_LOG_DBG(fmt, args...) LOG(DBG_LEVEL_DEBUG, fmt, ##args)
#define UTIL_LOG_INFO(fmt, args...) LOG(DBG_LEVEL_INFO, fmt, ##args)
#define UTIL_LOG_WARNING(fmt, args...) LOG(DBG_LEVEL_WARNING, fmt, ##args)
#define UTIL_LOG_ERR(fmt, args...) LOG(DBG_LEVEL_ERR, fmt, ##args)
#define DEBUG_LOG_OPENLOG(ident) openlog(ident, LOG_CONS | LOG_PID, LOG_USER) //call:DEBUG_LOG_OPENLOG("host");
#define DEBUG_LOG_CLOSELOG() closelog()
#ifdef __cplusplus
}
#endif
#endif /* __DEBUG_UTIL_H__ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* jsonrpc-c.h
*
* Created on: Oct 11, 2012
* Author: hmng
*/
#ifndef JSONRPCC_H_
#define JSONRPCC_H_
#include "rpccJSON.h"
#include "ev.h"
/*
*
* http://www.jsonrpc.org/specification
*
* code message meaning
* -32700 Parse error Invalid JSON was received by the server.
* An error occurred on the server while parsing the JSON text.
* -32600 Invalid Request The JSON sent is not a valid Request object.
* -32601 Method not found The method does not exist / is not available.
* -32602 Invalid params Invalid method parameter(s).
* -32603 Internal error Internal JSON-RPC error.
* -32000 to -32099 Server error Reserved for implementation-defined server-errors.
*/
#define JRPC_PARSE_ERROR -32700
#define JRPC_INVALID_REQUEST -32600
#define JRPC_METHOD_NOT_FOUND -32601
#define JRPC_INVALID_PARAMS -32603
#define JRPC_INTERNAL_ERROR -32693
typedef struct {
void *data;
int error_code;
char * error_message;
} jrpc_context;
typedef cJSON* (*jrpc_function)(jrpc_context *context, cJSON *params, cJSON* id);
struct jrpc_procedure {
char * name;
jrpc_function function;
void *data;
};
struct jrpc_server {
int port_number;
struct ev_loop *loop;
ev_io listen_watcher;
int procedure_count;
struct jrpc_procedure *procedures;
int debug_level;
};
struct jrpc_connection {
struct ev_io io;
int fd;
int pos;
unsigned int buffer_size;
char * buffer;
int debug_level;
};
int jrpc_server_init(struct jrpc_server *server, int port_number);
int jrpc_server_init_with_ev_loop(struct jrpc_server *server,
int port_number, struct ev_loop *loop);
void jrpc_server_run(struct jrpc_server *server);
int jrpc_server_stop(struct jrpc_server *server);
void jrpc_server_destroy(struct jrpc_server *server);
int jrpc_register_procedure(struct jrpc_server *server,
jrpc_function function_pointer, char *name, void *data);
int jrpc_deregister_procedure(struct jrpc_server *server, char *name);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
TOP_DIR_ZIGBEE ?= $(CURDIR)
ZIGBEE_MAKEFILE_PATH ?= $(TOP_DIR_ZIGBEE)/app/builder/Z3GatewayHost/
all:
@cd $(ZIGBEE_MAKEFILE_PATH) && $(MAKE);
\ No newline at end of file
This diff is collapsed.
# XML file describing Studio Project Modules related to HAL config
prop.file.modulesFile=./modules.xml
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment