void ModuleManagerWithDebug::executeDebugCommand(const std::string& command, 
                                    const std::map<std::string,std::string>& arguments, 
                                    std::ostream& outstream)
{
  if (command == commandModulesList) {
    modulesList(outstream);
  } else if( command == commandModulesStore ) {
    modulesStore(outstream);
  } else if (command == commandModulesSet) {
    modulesSet(outstream, arguments);
  } else if (command == commandRepresentationList) {
    representationList(outstream);
  } else if (command == commandRepresentationGet)
  {
    std::map<std::string, std::string>::const_iterator iter;
    for (iter = arguments.begin(); iter != arguments.end(); ++iter)
    {
      printRepresentation(outstream, iter->first, false);
    }
  }
  else if (command == commandRepresentationGetbinary)
  {
    std::map<std::string, std::string>::const_iterator iter;
    for (iter = arguments.begin(); iter != arguments.end(); ++iter)
    {
      printRepresentation(outstream, iter->first, true);
    }
  }
}//end executeDebugCommand
Beispiel #2
0
OCStackApplicationResult CloudLoginoutCallback(void *ctx,
        OCDoHandle handle, OCClientResponse *clientResponse)
{
    if (ctx != (void *)DEFAULT_CONTEXT_VALUE)
    {
        printf("Invalid Cloud Login/out callback received\n");
    }

    printf("Login/out response received: %d\n", clientResponse->result);

    if (clientResponse->payload != NULL &&
            clientResponse->payload->type == PAYLOAD_TYPE_REPRESENTATION)
    {
        printf("PAYLOAD_TYPE_REPRESENTATION received\n");

        OCRepPayloadValue *val = ((OCRepPayload *)clientResponse->payload)->values;

        printf("Get payload values\n");
        printRepresentation(val);

        if(clientResponse->result < 5)
        {
            isCloudLoggedin = true;
        }
    }

    return OC_STACK_KEEP_TRANSACTION;
}
Beispiel #3
0
// callback for sign-up and sign-in
OCStackApplicationResult CloudSignupCallback(void *ctx,
        OCDoHandle handle, OCClientResponse *clientResponse)
{
    if (ctx != (void *)DEFAULT_CONTEXT_VALUE)
    {
        printf("Invalid Cloud Login/out callback received\n");
    }

    printf("Signup response received: %d\n", clientResponse->result);

    if (clientResponse->payload != NULL &&
            clientResponse->payload->type == PAYLOAD_TYPE_REPRESENTATION)
    {
        printf("PAYLOAD_TYPE_REPRESENTATION received\n");
        printf("Sign-in using retrieved accesstoken when disconnected or reboot\n");

        OCRepPayloadValue *val = ((OCRepPayload *)clientResponse->payload)->values;

        printf("Get payload values\n");
        printRepresentation(val);
    }
    return OC_STACK_KEEP_TRANSACTION;
}