Commit 90f68dd6 authored by Kishen Maloor's avatar Kishen Maloor

Update cloud client/server command-line args

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 369098e9
......@@ -54,10 +54,17 @@ static const char *device_name = "CloudDevice";
static const char *manufacturer = "ocfcloud.com";
#ifdef OC_SECURITY
static const char *cis;
static const char *auth_code;
static const char *sid;
static const char *apn;
#else /* OC_SECURITY */
static const char *cis = "coap+tcp://127.0.0.1:5683";
static const char *auth_code = "test";
static const char *sid = "00000000-0000-0000-0000-000000000001";
static const char *apn = "test";
#endif /* OC_SECURITY */
#define SCANF(...) \
do { \
......@@ -334,7 +341,9 @@ ocf_event_thread(LPVOID lpParam)
oc_cloud_context_t *ctx = oc_cloud_get_context(0);
if (ctx) {
oc_cloud_manager_start(ctx, cloud_status_handler, NULL);
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
if (cis) {
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
}
}
oc_clock_time_t next_event;
while (quit != 1) {
......@@ -376,7 +385,9 @@ ocf_event_thread(void *data)
oc_cloud_context_t *ctx = oc_cloud_get_context(0);
if (ctx) {
oc_cloud_manager_start(ctx, cloud_status_handler, NULL);
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
if (cis) {
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
}
}
oc_clock_time_t next_event;
while (quit != 1) {
......@@ -402,9 +413,6 @@ ocf_event_thread(void *data)
int
main(int argc, char *argv[])
{
PRINT("Default parameters: device_name: %s, auth_code: %s, cis: %s, sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
if (argc == 1) {
PRINT("./cloud_client <device-name-without-spaces> <auth-code> <cis> <sid> "
"<apn>\n"
......@@ -431,6 +439,10 @@ main(int argc, char *argv[])
PRINT("apn: %s\n", argv[5]);
}
PRINT("device_name: %s, auth_code: %s, cis: %s, sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
#if defined(_WIN32)
InitializeCriticalSection(&cs);
InitializeConditionVariable(&cv);
......
......@@ -142,10 +142,18 @@ static const char *device_rt = "oic.d.cloudDevice";
static const char *device_name = "Cloud Device";
static const char *manufacturer = "ocfcloud.com";
#ifdef OC_SECURITY
static const char *cis;
static const char *auth_code;
static const char *sid;
static const char *apn;
#else /* OC_SECURITY */
static const char *cis = "coap+tcp://127.0.0.1:5683";
static const char *auth_code = "test";
static const char *sid = "00000000-0000-0000-0000-000000000001";
static const char *apn = "test";
#endif /* OC_SECURITY */
oc_resource_t *res1;
oc_resource_t *res2;
......@@ -370,7 +378,9 @@ main(int argc, char *argv[])
oc_cloud_context_t *ctx = oc_cloud_get_context(0);
if (ctx) {
oc_cloud_manager_start(ctx, cloud_status_handler, NULL);
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
if (cis) {
oc_cloud_provision_conf_resource(ctx, cis, auth_code, sid, apn);
}
}
run();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment