#include "timer.h"
-#include <ThingsManager.h>
+#include <GroupManager.h>
using namespace std;
using namespace OC;
shared_ptr<OCResource> g_resource;
vector<string> lights;
-ThingsManager *thingsMgr = new ThingsManager();
+GroupManager *groupMgr = new GroupManager();
void onGet(const HeaderOptions& opt, const OCRepresentation &rep,
const int eCode);
}
}
-void onGet(const HeaderOptions& opt, const OCRepresentation &rep,
+void onGet(const HeaderOptions& /*opt*/, const OCRepresentation &/*rep*/,
const int eCode)
{
cout << "\nonGet" << endl;
cout << "\tInvalid parameter." << endl;
}
-void onPut(const HeaderOptions& headerOptions, const OCRepresentation& rep,
+void onPut(const HeaderOptions& /*opt*/, const OCRepresentation &/*rep*/,
const int eCode)
{
cout << "\nonPut" << endl;
cout << "\tInvalid parameter." << endl;
}
-void onPost(const HeaderOptions& headerOptions, const OCRepresentation& rep,
- const int eCode)
+void onPost(const HeaderOptions& /*opt*/, const OCRepresentation &rep,
+ const int /*eCode*/)
{
printf("\nonPost\n");
if (rep.getValue("ActionSet", plainText))
{
- ActionSet *actionset = thingsMgr->getActionSetfromString(plainText);
+ ActionSet *actionset = groupMgr->getActionSetfromString(plainText);
if (actionset != NULL)
{
cout << endl << "\tACTIONSET NAME :: "
void Scheduled_AllbulbOff()
{
- thingsMgr->executeActionSet(g_resource, "AllBulbOffScheduledCall", &onPost);
+ groupMgr->executeActionSet(g_resource, "AllBulbOffScheduledCall", &onPost);
}
void Scheduled_AllbulbOffEx()
{
- thingsMgr->executeActionSet(g_resource, "AllBulbOffScheduledCall", 10, &onPost);
+ groupMgr->executeActionSet(g_resource, "AllBulbOffScheduledCall", 10, &onPost);
}
void CancelScheduled_AllBulbOff()
{
- thingsMgr->cancelActionSet(g_resource, "AllBulbOffScheduledCall", &onPost);
+ groupMgr->cancelActionSet(g_resource, "AllBulbOffScheduledCall", &onPost);
}
void Recursive_allBulbOn()
{
- thingsMgr->executeActionSet(g_resource, "AllBulbOnRecursiveCall", &onPost);
+ groupMgr->executeActionSet(g_resource, "AllBulbOnRecursiveCall", &onPost);
}
void Recursive_allBulbOnEx()
{
- thingsMgr->executeActionSet(g_resource, "AllBulbOnRecursiveCall", 10, &onPost);
+ groupMgr->executeActionSet(g_resource, "AllBulbOnRecursiveCall", 10, &onPost);
}
void CancelRecursive_allBulbOn()
{
- thingsMgr->cancelActionSet(g_resource, "AllBulbOnRecursiveCall", &onPost);
+ groupMgr->cancelActionSet(g_resource, "AllBulbOnRecursiveCall", &onPost);
}
-void onObserve(const HeaderOptions headerOptions, const OCRepresentation& rep,
+void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& rep,
const int& eCode, const int& sequenceNumber)
{
if (eCode == OC_STACK_OK)
}
if (g_resource)
{
- thingsMgr->addActionSet(g_resource, allBulbOff, onPut);
+ groupMgr->addActionSet(g_resource, allBulbOff, onPut);
}
delete allBulbOff;
}
if (g_resource)
{
- thingsMgr->addActionSet(g_resource, allBulbOff, onPut);
+ groupMgr->addActionSet(g_resource, allBulbOff, onPut);
}
delete allBulbOff;
}
if (g_resource)
{
- thingsMgr->addActionSet(g_resource, allBulbOff, onPut);
+ groupMgr->addActionSet(g_resource, allBulbOff, onPut);
}
delete allBulbOff;
}
if (g_resource)
{
- thingsMgr->addActionSet(g_resource, allBulbOn, onPut);
+ groupMgr->addActionSet(g_resource, allBulbOn, onPut);
}
delete allBulbOn;
// Find lights for group creation.
vector<string> types;
types.push_back("core.light");
- thingsMgr->findCandidateResources(types, &foundResources, 5);
+ groupMgr->findCandidateResources(types, &foundResources, 5);
OCStackResult res = OCPlatform::registerResource(resourceHandle, resourceURI,
resourceTypeName, resourceInterface, NULL, OC_DISCOVERABLE);
}
else if (n == 6)
{
- thingsMgr->getActionSet(g_resource, "AllBulbOff", onPost);
+ groupMgr->getActionSet(g_resource, "AllBulbOff", onPost);
}
else if (n == 7)
{
- thingsMgr->deleteActionSet(g_resource, "AllBulbOff", onPut);
+ groupMgr->deleteActionSet(g_resource, "AllBulbOff", onPut);
}
else if (n == 8)
{