//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/// @file ThingsDiagnostics.h
-
-/// @brief This file contains the declaration of classes and its members related to
-/// ThingsDiagnostics.
+/**
+ * @file
+ *
+ * This file contains the declaration of classes and its members related to
+ * ThingsDiagnostics.
+ */
#ifndef __OC_THINGSDIAGNOSTICS__
#define __OC_THINGSDIAGNOSTICS__
using namespace OC;
namespace OIC
{
-
/// Declearation of Diagnostics Callback funtion type
typedef std::function<
void(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
{
public:
DiagnosticsRequestEntry(std::string ID, DiagnosticsCallback callback,
- std::shared_ptr< OCResource > resource, std::string updateVal) :
- m_ID(ID), m_callback(callback), m_resource(resource), m_updateVal(updateVal)
- {
- }
- ;
+ std::shared_ptr< OCResource > resource, std::string updateVal);
// Diagnostics Name (used in key value in std::map structure)
// e.g., reboot and factoryset
class DiagnosticsUnitInfo
{
public:
- DiagnosticsUnitInfo(std::string name, std::string description, std::string uri,
- std::string attribute) :
- m_name(name), m_description(description), m_uri(uri), m_attribute(attribute)
- {
- }
- ;
-
std::string m_name;
- std::string m_description;
- std::string m_uri;
std::string m_attribute;
+ std::string m_uri;
- // If a developer wants to know a list of diagnostics names, gives it in JSON format.
- std::string getJSON()
- {
- std::string res;
-
- res = "{\"name\":\"" + m_name + "\",\"description\":\"" + m_description + "\"}";
+ DiagnosticsUnitInfo(std::string name, std::string attribute, std::string uri);
- return res;
- }
+ // If a developer wants to know a list of configuration names, gives it in JSON format.
+ std::string getJSON();
};
#define NUMDIAGUNIT 3
/**
* Constructor for ThingsDiagnostics. Constructs a new ThingsDiagnostics
*/
- ThingsDiagnostics(void)
- {
- DiagnosticsUnitInfo unit[] =
- {
- { "reboot", "reboot", "/oic/diag/0/reboot", "value" },
- { "value",
- "Collecting any device statistics",
- "/oic/diag/0/startCollection", "value" },
- { "factoryreset", "restore all configuration values to default values",
- "/oic/diag/0/factoryReset", "value" } };
-
- for (int i = 0; i < NUMDIAGUNIT; i++)
- DiagnosticsUnitTable.push_back(unit[i]);
- }
- ;
+ ThingsDiagnostics(void);
/**
* Virtual destructor
*/
- ~ThingsDiagnostics(void)
- {
- }
- ;
+ ~ThingsDiagnostics(void);
static ThingsDiagnostics *thingsDiagnosticsInstance;
static ThingsDiagnostics* getInstance();
void deleteInstance();
- void setGroupManager(GroupManager *groupmanager)
- {
- g_groupmanager = groupmanager;
- }
- ;
+ void setGroupManager(GroupManager *groupmanager);
/**
* API to make things reboot
void onExecuteForGroupAction(const HeaderOptions& headerOptions,
const OCRepresentation& rep, const int eCode, std::string conf);
+ void onDeleteGroupAction(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep, const int eCode, std::string conf);
void onGetChildInfoForUpdate(const HeaderOptions& headerOptions,
const OCRepresentation& rep, const int eCode, std::string conf);
void onCreateActionSet(const HeaderOptions& headerOptions, const OCRepresentation& rep,