static const char* SVR_DB_FILE_NAME = "oic_svr_db_subowner_client.dat";
// '_' for separaing from the same constant variable in |srmresourcestrings.c|
static const char* PRVN_DB_FILE_NAME = "oic_pdm_subowner.db";
+/*
static const OicSecPrm_t SUPPORTED_PRMS[1] =
{
PRM_PRE_CONFIGURED,
};
+*/
// |g_ctx| means provision manager application context and
// the following, includes |un/own_list|, could be variables, which |g_ctx| has,
// for accessing all function(s) for these, they are declared on global domain
-static const char* g_ctx = "SubOwner Client Application Context";
+static char *g_ctx = "SubOwner Client Application Context";
static char* g_svr_fname;
static char* g_prvn_fname;
static OCProvisionDev_t* g_own_list;
static OCProvisionDev_t* g_unown_list;
static OCProvisionDev_t* g_motdev_list;
static OCProvisionDev_t* g_mowned_list;
-static int g_own_cnt;
-static int g_unown_cnt;
+//static int g_own_cnt;
+//static int g_unown_cnt;
static int g_motdev_cnt;
static int g_mowned_cnt;
static bool g_doneCB;
// function declaration(s) for calling them before implementing
static OCProvisionDev_t* getDevInst(const OCProvisionDev_t*, const int);
static int printDevList(const OCProvisionDev_t*);
-static size_t printUuidList(const OCUuidList_t*);
+//static size_t printUuidList(const OCUuidList_t*);
static int printResultList(const OCProvisionResult_t*, const int);
static void printUuid(const OicUuid_t*);
static FILE* fopen_prvnMng(const char*, const char*);
static int waitCallbackRet(void);
-static int selectTwoDiffNum(int*, int*, const int, const char*);
+//static int selectTwoDiffNum(int*, int*, const int, const char*);
// callback function(s) for provisioning client using C-level provisioning API
static void multipleOwnershipTransferCB(void* ctx, int nOfRes, OCProvisionResult_t* arr, bool hasError)
g_doneCB = true;
}
+#if 0
// callback function(s) for provisioning client using C-level provisioning API
static void ownershipTransferCB(void* ctx, int nOfRes, OCProvisionResult_t* arr, bool hasError)
{
}
g_doneCB = true;
}
+#endif
static void provisionAclCB(void* ctx, int nOfRes, OCProvisionResult_t* arr, bool hasError)
{
}
// response handler for LED requests.
-static void LedCB(void *ctx, OCDoHandle UNUSED,
- OCClientResponse *clientResponse)
+static OCStackApplicationResult LedCB(void *ctx, OCDoHandle UNUSED,
+ OCClientResponse *clientResponse)
{
if(clientResponse)
{
printf("Received OC_STACK_OK from server\n");
if(clientResponse->payload)
{
- printf("Response ===================> %s\n", clientResponse->payload);
+ printf("Response ===================> %d\n",
+ clientResponse->payload->type);
}
}
else if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
}
g_doneCB = true;
+
+ return OC_STACK_DELETE_TRANSACTION;
}
static void inputPinCB(char* pin, size_t len)
for( ; 0x20<=getchar(); ); // for removing overflow garbages
// '0x20<=code' is character region
}
- if(0<dev_num && g_mowned_list>=dev_num)
+ if(0 < dev_num && g_mowned_cnt >= dev_num)
{
break;
}
return -1;
}
+#if 0
static int provisionCred()
{
// check |unown_list| for registering devices
PVPWS_ERROR:
return -1;
}
+#endif
static OCProvisionDev_t* getDevInst(const OCProvisionDev_t* dev_lst, const int dev_num)
{
return lst_cnt;
}
+#if 0
static size_t printUuidList(const OCUuidList_t* uid_lst)
{
if(!uid_lst)
return lst_cnt;
}
+#endif
static int printResultList(const OCProvisionResult_t* rslt_lst, const int rslt_cnt)
{
// with its own |SVR_DB_FILE_NAME|
char data_dir[MAX_FILE_PATH_LEN] = {0,};
- snprintf(data_dir, MAX_FILE_PATH_LEN, "%s/network/%s",
+ snprintf(data_dir, MAX_FILE_PATH_LEN, "%s/network/%s",
tzplatform_getenv(TZ_SYS_GLOBALUSER_DATA), SVR_DB_FILE_NAME);
(void)path; // unused |path| parameter
return 0;
}
+#if 0
static int selectTwoDiffNum(int* a, int* b, const int max, const char* str)
{
if(!a || !b || 2>max || !str)
return -1;
}
+#endif
static void printMenu(void)
{
// main loop for provisioning manager
int mnNum = 0;
- int selDevNum = 0;
for( ; ; )
{
printf("\n");