1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 #include "samsung/sc_easysetup.h"
24 #include "oic_malloc.h"
28 #include "ocpayload.h"
29 #include "oic_string.h"
30 #include "oic_malloc.h"
32 #include "resourcehandler.h"
35 * @var SC_ENROLLEE_TAG
36 * @brief Logging tag for module name.
38 #define SC_ENROLLEE_TAG "ES_SC_ENROLLEE"
40 EasySetupResource g_ESEasySetupResource;
41 WiFiConfResource g_ESWiFiConfResource;
42 CoapCloudConfResource g_ESCoapCloudConfResource;
43 DevConfResource g_ESDevConfResource;
45 SCProperties g_SCProperties;
47 static void ReadAccountData(OCRepPayload* payload,void** userdata);
48 static void ReadTnCdata(OCRepPayload* payload,void** userdata);
49 static void WriteTnCdata(OCRepPayload* payload, char* resourceType);
50 static void WriteWifiData(OCRepPayload* payload, char* resourceType);
52 ESResult SetSCProperties(const SCProperties *prop)
54 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCProperties IN");
57 memcpy(&g_SCProperties, prop, sizeof(SCProperties));
58 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCProperties OUT");
61 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCProperties OUT");
65 static void ReadAccountData(OCRepPayload* payload,void** userdata)
67 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadAccountData IN");
71 if(OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_ACCOUNT, &account))
75 *userdata = (void*)OICMalloc(sizeof(SCDevConfProperties));
76 if( *userdata == NULL )
78 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCDevConfProperties is failed");
84 SCDevConfProperties *pDevConfProp = (SCDevConfProperties*)(*userdata);
85 OICStrcpy(pDevConfProp->account, MAXLEN_STRING, account);
86 OICStrcpy(g_SCProperties.account, MAXLEN_STRING, account);
88 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
89 SC_RSRVD_ES_VENDOR_ACCOUNT, pDevConfProp->account);
93 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadAccountData OUT");
97 ESResult SetSCTncInfo(SCTncInfo *tncInfo)
103 g_SCProperties.tncInfo = *tncInfo;
107 ESResult SetSCTncStatus(int status)
109 g_SCProperties.tncStatus = status;
113 ESResult SetSCNetConnectionState(NETCONNECTION_STATE netConnectionState)
115 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCNetConnectionState IN");
117 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "SetSCNetConnectionState: %d", netConnectionState);
118 g_SCProperties.netConnectionState = netConnectionState;
120 if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS))
122 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "provResource doesn't have any observers.");
125 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCNetConnectionState OUT");
129 static void ReadTnCdata(OCRepPayload* payload,void** userdata)
131 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadTnCdata IN");
133 char* tncResult = NULL;
135 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_RESULT, &tncResult))
137 if(*userdata == NULL)
139 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
140 if( *userdata == NULL )
142 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
147 SCCoapCloudServerConfProperties *pProp = (SCCoapCloudServerConfProperties*)(*userdata);
148 OICStrcpy(pProp->tncResult, MAXLEN_STRING, tncResult);
149 OICStrcpy(g_SCProperties.tncResult, MAXLEN_STRING, tncResult);
151 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
152 SC_RSRVD_ES_VENDOR_TNC_RESULT, pProp->tncResult);
155 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadTnCdata OUT");
158 void WriteTnCdata(OCRepPayload* payload, char* resourceType)
160 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteTnCdata IN");
162 if(payload == NULL || resourceType == NULL)
164 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "Invalid Params payload or resourceType is NULL");
165 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "WriteTnCdata OUT");
168 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_EASYSETUP))
170 OCRepPayloadSetPropInt(payload, SC_RSRVD_ES_VENDOR_TNC_STATUS, g_SCProperties.tncStatus);
172 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
174 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_HEADER,
175 g_SCProperties.tncInfo.header);
176 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_VERSION,
177 g_SCProperties.tncInfo.version);
179 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
181 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_RESULT,
182 g_SCProperties.tncResult);
184 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteTnCdata OUT");
187 void WriteWifiData(OCRepPayload* payload, char* resourceType)
189 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteWifiData IN");
191 if(payload == NULL || resourceType == NULL)
193 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "Invalid Params payload or resourceType is NULL");
194 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "WriteWifiData OUT");
198 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_WIFICONF))
200 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_BSSID,
201 g_SCProperties.bssid);
203 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteWifiData OUT");
206 ESResult SetRegisterSetDevice(const char *regSetDevice)
208 if(regSetDevice != NULL)
210 OICStrcpy(g_SCProperties.regSetDev, sizeof(g_SCProperties.regSetDev), regSetDevice);
216 ESResult SetNetworkProvInfo(const char *nwProvInfo)
218 if(nwProvInfo != NULL)
220 OICStrcpy(g_SCProperties.nwProvInfo, sizeof(g_SCProperties.nwProvInfo), nwProvInfo);
226 ESResult SetSCPnPPin(const char *pnp)
230 OICStrcpy(g_SCProperties.pnpPin, sizeof(g_SCProperties.pnpPin), pnp);
236 ESResult SetESVersionInfo(const char *esProtocolVersion)
238 if(esProtocolVersion != NULL)
240 OICStrcpy(g_SCProperties.esProtocolVersion, sizeof(g_SCProperties.esProtocolVersion), esProtocolVersion);
246 void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata)
248 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadUserdataCb IN");
252 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_WIFICONF))
254 int64_t channel = -1;
256 if (OCRepPayloadGetPropInt(payload, SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, &channel))
258 if(*userdata == NULL)
260 *userdata = (void*)OICMalloc(sizeof(SCWiFiConfProperties));
261 if( *userdata == NULL )
263 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCWiFiConfProperties is failed");
266 memset(*userdata, 0, sizeof(SCWiFiConfProperties));
268 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : [%" PRId64 "]",
269 SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, channel);
270 ((SCWiFiConfProperties*)(*userdata))->discoveryChannel = (int) channel;
271 g_SCProperties.discoveryChannel = channel;
273 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_BSSID, &bssid))
275 if(*userdata == NULL)
277 *userdata = (void*) OICMalloc(sizeof(SCWiFiConfProperties));
278 if( *userdata == NULL )
280 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCWiFiConfProperties is failed");
283 memset(*userdata, 0, sizeof(SCWiFiConfProperties));
285 if (*userdata != NULL)
287 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
288 SC_RSRVD_ES_VENDOR_BSSID, bssid);
289 SCWiFiConfProperties* pWifiConfProp = (SCWiFiConfProperties*)(*userdata);
290 OICStrcpy(pWifiConfProp->bssid, sizeof(pWifiConfProp->bssid), bssid);
291 OICStrcpy(g_SCProperties.bssid, sizeof(g_SCProperties.bssid), bssid);
296 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
298 if(*userdata == NULL)
300 *userdata = (void*)OICMalloc(sizeof(SCDevConfProperties));
301 if( *userdata == NULL )
303 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCDevConfProperties is failed");
306 memset(*userdata, 0, sizeof(SCDevConfProperties));
309 SCDevConfProperties *pDevConfProp = (SCDevConfProperties*)(*userdata);
311 char**locationList = NULL;
312 size_t dimensions[MAX_REP_ARRAY_DEPTH] = {0};
313 if(OCRepPayloadGetStringArray(payload, SC_RSRVD_ES_VENDOR_LOCATION, &locationList, dimensions))
315 for(size_t idx = 0; idx < dimensions[0]; idx++)
317 OICStrcpy(pDevConfProp->location[idx], strlen(locationList[idx])+1, locationList[idx]);
318 OICStrcpy(g_SCProperties.location[idx], strlen(locationList[idx])+1, locationList[idx]);
320 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
321 SC_RSRVD_ES_VENDOR_LOCATION, pDevConfProp->location[idx]);
324 ((SCDevConfProperties*)(*userdata))->numLocation = (int)dimensions[0];
325 g_SCProperties.numLocation = (int)dimensions[0];
328 ReadAccountData(payload,userdata);
330 char *regMobileDev = NULL;
331 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, ®MobileDev))
333 OICStrcpy(pDevConfProp->regMobileDev, strlen(regMobileDev)+1, regMobileDev);
334 OICStrcpy(g_SCProperties.regMobileDev, strlen(regMobileDev)+1, regMobileDev);
335 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regMobileDev %s", g_SCProperties.regMobileDev);
338 char *country = NULL;
339 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, &country))
341 OICStrcpy(pDevConfProp->country, strlen(country)+1, country);
342 OICStrcpy(g_SCProperties.country, strlen(country)+1, country);
343 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.country %s", g_SCProperties.country);
346 char *language = NULL;
347 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, &language))
349 OICStrcpy(pDevConfProp->language, strlen(language)+1, language);
350 OICStrcpy(g_SCProperties.language, strlen(language)+1, language);
351 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.language %s", g_SCProperties.language);
354 char *gpsLocation = NULL;
355 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, &gpsLocation))
357 OICStrcpy(pDevConfProp->gpsLocation, strlen(gpsLocation)+1, gpsLocation);
358 OICStrcpy(g_SCProperties.gpsLocation, strlen(gpsLocation)+1, gpsLocation);
359 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.gpsLocation %s", g_SCProperties.gpsLocation);
362 char *utcDateTime = NULL;
363 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, &utcDateTime))
365 OICStrcpy(pDevConfProp->utcDateTime, strlen(utcDateTime)+1, utcDateTime);
366 OICStrcpy(g_SCProperties.utcDateTime, strlen(utcDateTime)+1, utcDateTime);
367 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.utcDateTime %s", g_SCProperties.utcDateTime);
370 char *regionalDateTime = NULL;
371 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, ®ionalDateTime))
373 OICStrcpy(pDevConfProp->regionalDateTime, strlen(regionalDateTime)+1, regionalDateTime);
374 OICStrcpy(g_SCProperties.regionalDateTime, strlen(regionalDateTime)+1, regionalDateTime);
375 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regionalDateTime %s", g_SCProperties.regionalDateTime);
378 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
380 char* clientID = NULL;
381 if(OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_CLIENTID, &clientID))
383 if(*userdata == NULL)
385 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
386 if( *userdata == NULL )
388 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
391 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
394 SCCoapCloudServerConfProperties *pCloudProp =
395 (SCCoapCloudServerConfProperties*)(*userdata);
397 OICStrcpy(pCloudProp->clientID, strlen(clientID)+1, clientID);
398 OICStrcpy(g_SCProperties.clientID, strlen(clientID)+1, clientID);
400 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
401 SC_RSRVD_ES_VENDOR_CLIENTID, pCloudProp->clientID);
404 //SC_RSRVD_ES_VENDOR_AAC
406 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_AAC, &aac))
408 if(*userdata == NULL)
410 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
411 if( *userdata == NULL )
413 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
416 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
419 if (*userdata != NULL)
421 SCCoapCloudServerConfProperties *pCloudProp =
422 (SCCoapCloudServerConfProperties*) (*userdata);
423 pCloudProp->aac[0] = '\0';
425 OICStrcpy(pCloudProp->aac, MAXLEN_STRING, aac);
426 OICStrcpy(g_SCProperties.aac, MAXLEN_STRING, aac);
429 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
430 SC_RSRVD_ES_VENDOR_AAC, pCloudProp->aac);
434 //SC_RSRVD_ES_VENDOR_UID
436 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_UID, &uid))
438 if(*userdata == NULL)
440 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
441 if( *userdata == NULL )
443 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
446 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
449 if (*userdata != NULL)
451 SCCoapCloudServerConfProperties *pCloudProp =
452 (SCCoapCloudServerConfProperties*) (*userdata);
453 pCloudProp->uid[0] = '\0';
455 OICStrcpy(pCloudProp->uid, MAXLEN_STRING, uid);
456 OICStrcpy(g_SCProperties.uid, MAXLEN_STRING, uid);
459 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
460 SC_RSRVD_ES_VENDOR_UID, pCloudProp->uid);
464 //SC_RSRVD_ES_VENDOR_REFRESH_TOKEN
465 char *refreshToken = NULL;
466 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, &refreshToken))
468 if(*userdata == NULL)
470 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
471 if( *userdata == NULL )
473 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
476 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
479 if (*userdata != NULL)
481 SCCoapCloudServerConfProperties *pCloudProp =
482 (SCCoapCloudServerConfProperties*) (*userdata);
483 pCloudProp->refreshToken[0] = '\0';
485 OICStrcpy(pCloudProp->refreshToken, MAXLEN_STRING, refreshToken);
486 OICStrcpy(g_SCProperties.refreshToken, MAXLEN_STRING, refreshToken);
487 OICFree(refreshToken);
489 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
490 SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, pCloudProp->refreshToken);
494 ReadTnCdata(payload,userdata);
498 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadUserdataCb OUT");
501 void WriteUserdataCb(OCRepPayload* payload, char* resourceType)
503 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteUserdataCb IN");
507 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_EASYSETUP))
509 OCRepPayloadSetPropInt(payload, SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE, (int) g_SCProperties.netConnectionState);
512 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
515 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_TYPE, g_SCProperties.deviceType);
516 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE, g_SCProperties.deviceSubType);
517 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV, g_SCProperties.regSetDev);
518 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, g_SCProperties.regMobileDev);
519 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
520 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
521 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_MODEL_NUMBER, g_SCProperties.modelNumber);
522 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, g_SCProperties.country);
523 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, g_SCProperties.language);
524 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, g_SCProperties.gpsLocation);
525 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, g_SCProperties.utcDateTime);
526 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, g_SCProperties.regionalDateTime);
527 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
529 if(g_SCProperties.deviceType != NULL)
531 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_TYPE, g_SCProperties.deviceType);
533 if(g_SCProperties.deviceSubType != NULL)
535 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE, g_SCProperties.deviceSubType);
537 if(g_SCProperties.regSetDev != NULL)
539 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV, g_SCProperties.regSetDev);
541 if(g_SCProperties.regMobileDev != NULL)
543 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, g_SCProperties.regMobileDev);
545 if(g_SCProperties.nwProvInfo!= NULL)
547 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
549 if(g_SCProperties.pnpPin != NULL)
551 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
553 if(g_SCProperties.modelNumber != NULL)
555 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_MODEL_NUMBER, g_SCProperties.modelNumber);
557 if(g_SCProperties.country != NULL)
559 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, g_SCProperties.country);
561 if(g_SCProperties.language != NULL)
563 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, g_SCProperties.language);
565 if(g_SCProperties.gpsLocation != NULL)
567 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, g_SCProperties.gpsLocation);
569 if(g_SCProperties.esProtocolVersion != NULL)
571 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
577 WriteTnCdata(payload, resourceType);
578 WriteWifiData(payload, resourceType);
580 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteUserdataCb OUT");