Example #1
0
//------------------------------------------------------------------------------
// Globals

void setPolicy(void);

#if defined(EMBER_AF_PLUGIN_OTA_SERVER_POLICY)

static const PGM_P queryArguments[] = {
  "Policy enoumeration",
  NULL,
};

#ifndef EMBER_AF_GENERATE_CLI
static EmberCommandEntry policyCommands[] = {
  emberCommandEntryAction("print",        emAfOtaServerPolicyPrint, "", 
                          "Print the OTA Server's policies"),
  emberCommandEntryActionWithDetails("query",        setPolicy, "v", 
                                     "Set the OTA Server's query policy",
                                     queryArguments),
  emberCommandEntryAction("blockRequest", setPolicy, "v", "" ),
  emberCommandEntryAction("upgrade",      setPolicy, "v", "" ),
  emberCommandEntryAction("page-req-miss", setPolicy, "v", "" ),
  emberCommandEntryAction("page-req-sup",  setPolicy, "v", "" ),
  emberCommandEntryAction("image-req-min-period", setPolicy, "v", "" ),
  emberCommandEntryTerminator(),
};
#define POLICY_COMMANDS emberCommandEntryAction("policy", NULL, (PGM_P)policyCommands, ""),
#endif

#if defined(EMBER_TEST)
#define LOAD_FILE_COMMAND emberCommandEntryAction("load-file", emAfOtaLoadFileCommand, "b", "" ),
Example #2
0
// *******************************************************************
// * scenes-cli.c
// *
// *
// * Copyright 2012 by Ember Corporation. All rights reserved.              *80*
// *******************************************************************

#include "app/framework/include/af.h"
#include "app/util/serial/command-interpreter2.h"
#include "scenes.h"

void emAfPluginScenesServerClear(void);

#if !defined(EMBER_AF_GENERATE_CLI)
EmberCommandEntry emberAfPluginScenesCommands[] = {
  emberCommandEntryAction("print", emAfPluginScenesServerPrintInfo, "", "Print the scenes table."),
  emberCommandEntryAction("clear", emAfPluginScenesServerClear, "", "Clear the scenes table on every endpoint."),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

void emAfPluginScenesServerClear(void)
{
  emberAfCorePrintln("Clearing all scenes.");
  emberAfScenesClusterClearSceneTableCallback(EMBER_BROADCAST_ENDPOINT);
}
#include "app/util/source-route-common.h"

// *****************************************************************************
// Forward Declarations

void emberAfPluginConcentratorStatus(void);
void emberAfPluginConcentratorStartDiscovery(void);
void emberAfPluginConcentratorAggregationCommand(void);
void emberAfPluginConcentratorPrintSourceRouteTable(void);
void emberAfGetSourceRoute(void);
// *****************************************************************************
// Globals
 
#if !defined(EMBER_AF_GENERATE_CLI)
EmberCommandEntry emberAfPluginConcentratorCommands[] = {
  emberCommandEntryAction("status", emberAfPluginConcentratorStatus, "",
                          "Prints current status and configured parameters of the concentrator"),
  emberCommandEntryAction("start",  emberAfPluginConcentratorStartDiscovery, "",
                          "Starts the periodic broadcast of MTORRs"),
  emberCommandEntryAction("stop",   emberAfPluginConcentratorStopDiscovery, "",
                          "Stops the periodic broadcast of MTORRs"),
  emberCommandEntryAction("agg", emberAfPluginConcentratorAggregationCommand, "", 
                          "Sends an MTORR broadcast now."),
  emberCommandEntryAction("print-table", 
                          emberAfPluginConcentratorPrintSourceRouteTable, 
                          "",
                          "Prints the source route table."),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

// *****************************************************************************
// * messaging-client-cli.c
// *
// *
// * Copyright 2012 by Ember Corporation. All rights reserved.              *80*
// *******************************************************************

#include "app/framework/include/af.h"
#include "app/util/serial/command-interpreter2.h"
#include "app/framework/plugin/messaging-client/messaging-client.h"

void emAfMessagingClientCliConfirm(void);
void emAfMessagingClientCliPrint(void);

#if !defined(EMBER_AF_GENERATE_CLI)
EmberCommandEntry emberAfPluginMessagingClientCommands[] = {
  emberCommandEntryAction("confirm",  emAfMessagingClientCliConfirm, "u", ""),
  emberCommandEntryAction("print", emAfMessagingClientCliPrint, "u", ""),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

// plugin messaging-client confirm <endpoint:1>
void emAfMessagingClientCliConfirm(void)
{
  uint8_t endpoint = (uint8_t)emberUnsignedCommandArgument(0);
  EmberAfStatus status = emberAfPluginMessagingClientConfirmMessage(endpoint);
  emberAfMessagingClusterPrintln("%p 0x%x", "confirm", status);
}

// plugin messaging-client print <endpoint:1>
void emAfMessagingClientCliPrint(void)
// *
// * Copyright 2013 Silicon Laboratories, Inc.                              *80*
// *******************************************************************

#include "app/framework/include/af.h"
#include "app/util/serial/command-interpreter2.h"
#include "app/framework/plugin/poll-control-client/poll-control-client.h"

void mode(void);
void timeout(void);
void respond(void);
void print(void);

#ifndef EMBER_AF_GENERATE_CLI
EmberCommandEntry emberAfPluginPollControlClientCommands[] = {
  emberCommandEntryAction("mode",  mode, "u", ""),
  emberCommandEntryAction("timeout", timeout, "v", ""),
  emberCommandEntryAction("respond",  respond, "u", ""),
  emberCommandEntryAction("print", print, "", ""),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

// plugin poll-control-client mode <mode:1>
void mode(void)
{
  uint8_t mode = (uint8_t)emberUnsignedCommandArgument(0);
  emAfSetFastPollingMode(mode);
  emberAfPollControlClusterPrintln("%p 0x%x", "mode", mode);
}
Example #6
0
void printOffCommand(void)
{
  uint16_t area = (uint16_t)emberUnsignedCommandArgument(0);
  emberAfPrintOff(area);
}

#ifndef EMBER_AF_GENERATE_CLI

static PGM_P debugPrintOnOffCommandArguments[] = {
  "Number of the specified print area.",
  NULL,
};

static EmberCommandEntry debugPrintCommands[] = {
  emberCommandEntryAction("status", 
                          emberAfPrintStatus,
                          "",
                          "Print the status of all the debug print areas."),
  emberCommandEntryAction("all_on",
                          emberAfPrintAllOn, 
                          "",
                          "Turn all debug print areas on."),

  emberCommandEntryAction("all_off",
                          emberAfPrintAllOff, 
                          "",
                          "Turn all debug print areas off."),

  emberCommandEntryActionWithDetails("on",
                                     printOnCommand, 
                                     "v",
                                     "Turn on the printing for the specified area.",
Example #7
0
// This file is generated by Ember Desktop.  Please do not edit manually.
//
//

// This file contains the mapping for the command line configuration

#include PLATFORM_HEADER
#include CONFIGURATION_HEADER
#include "stack/include/ember.h"
#include EMBER_AF_API_COMMAND_INTERPRETER2

void emberResetNetworkState(void);
EmberCommandEntry emberCommandTable[] = {
  emberCommandEntryAction("leave", emberResetNetworkState, "", ""),
  emberCommandEntryTerminator(),
};
#include "app/util/serial/command-interpreter2.h"

//------------------------------------------------------------------------------
// Forward Declarations

void printChildTable(void);
void printNeighborTable(void);
void printRouteTable(void);
void printInfo(void);

//------------------------------------------------------------------------------
// Globals

#ifndef EMBER_AF_GENERATE_CLI
EmberCommandEntry emberAfPluginStackDiagnosticsCommands[] = {
  emberCommandEntryAction("info",           printInfo,          "", "Print general stack info"),            
  emberCommandEntryAction("child-table",    printChildTable,    "", "Print the child table"),
  emberCommandEntryAction("neighbor-table", printNeighborTable, "", "Print the neighbor table"),
  emberCommandEntryAction("route-table",    printRouteTable,    "", "Print the route table"),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

#define UNKNOWN_LEAVE_REASON_INDEX     5
#define APP_EVENT_1_LEAVE_REASON_INDEX 6
static PGM_NO_CONST PGM_P leaveReasonStrings[] = {
  "-",                 // None
  "NWK Leave message",
  "APS Remove message",
  "ZDO Leave message",
  "ZLL Touchlink",
// * This code provides support for managing the address table.
// *
// * Copyright 2012 by Ember Corporation. All rights reserved.              *80*
// *****************************************************************************

#include "app/framework/include/af.h"
#include "app/util/serial/command-interpreter2.h"
#include "address-table.h"

void emberAfPluginAddressTableAddCommand(void);
void emberAfPluginAddressTableRemoveCommand(void);
void emberAfPluginAddressTableLookupCommand(void);

#if !defined(EMBER_AF_GENERATE_CLI)
EmberCommandEntry emberAfPluginAddressTableCommands[] = {
  emberCommandEntryAction("add", emberAfPluginAddressTableAddCommand,  "b", "Add an entry to the address table."),
  emberCommandEntryAction("remove", emberAfPluginAddressTableRemoveCommand,  "b", "Remove an entry from the address table."),
  emberCommandEntryAction("lookup", emberAfPluginAddressTableLookupCommand,  "b", "Search for an entry in the address table."),
  emberCommandEntryTerminator(),
};
#endif // EMBER_AF_GENERATE_CLI

void emberAfPluginAddressTableAddCommand(void)
{
  uint8_t index;
  EmberEUI64 entry;
  emberCopyEui64Argument(0, entry);

  index = emberAfPluginAddressTableAddEntry(entry);

  if (index == EMBER_NULL_ADDRESS_TABLE_INDEX) {
// Forward Declarations

void emberAfPluginGatewaySupportTimeSyncLocal(void);

//------------------------------------------------------------------------------
// Globals

// The difference in seconds between the ZigBee Epoch: January 1st, 2000
// and the Unix Epoch: January 1st 1970.
#define UNIX_ZIGBEE_EPOCH_DELTA (uint32_t)946684800UL

#if !defined(EMBER_AF_GENERATE_CLI)

EmberCommandEntry emberAfPluginGatewayCommands[] = {
  emberCommandEntryAction("time-sync-local", 
                          emberAfPluginGatewaySupportTimeSyncLocal, 
                          "",
                          "This command retrieves the local unix time and syncs the Time Server attribute to it."),
  emberCommandEntryTerminator(),
};

#endif

//------------------------------------------------------------------------------
// Functions

void emberAfPluginGatewaySupportTimeSyncLocal(void)
{
  time_t unixTime = time(NULL);
  unixTime -= UNIX_ZIGBEE_EPOCH_DELTA;
  emberAfSetTime(unixTime);
  emberAfPrintTime(emberAfGetCurrentTime());