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");
83 SCDevConfProperties *pDevConfProp = (SCDevConfProperties*)(*userdata);
84 OICStrcpy(pDevConfProp->account, MAXLEN_STRING, account);
85 OICStrcpy(g_SCProperties.account, MAXLEN_STRING, account);
87 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
88 SC_RSRVD_ES_VENDOR_ACCOUNT, pDevConfProp->account);
91 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadAccountData OUT");
95 ESResult SetSCTncInfo(SCTncInfo *tncInfo)
101 g_SCProperties.tncInfo = *tncInfo;
105 ESResult SetSCTncStatus(int status)
107 g_SCProperties.tncStatus = status;
111 ESResult SetSCNetConnectionState(NETCONNECTION_STATE netConnectionState)
113 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCNetConnectionState IN");
115 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "SetSCNetConnectionState: %d", netConnectionState);
116 g_SCProperties.netConnectionState = netConnectionState;
118 if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS))
120 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "provResource doesn't have any observers.");
123 OIC_LOG(INFO, SC_ENROLLEE_TAG, "SetSCNetConnectionState OUT");
127 static void ReadTnCdata(OCRepPayload* payload,void** userdata)
129 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadTnCdata IN");
131 char* tncResult = NULL;
133 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_RESULT, &tncResult))
135 if(*userdata == NULL)
137 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
138 if( *userdata == NULL )
140 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
145 SCCoapCloudServerConfProperties *pProp = (SCCoapCloudServerConfProperties*)(*userdata);
146 OICStrcpy(pProp->tncResult, MAXLEN_STRING, tncResult);
147 OICStrcpy(g_SCProperties.tncResult, MAXLEN_STRING, tncResult);
149 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
150 SC_RSRVD_ES_VENDOR_TNC_RESULT, pProp->tncResult);
153 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadTnCdata OUT");
156 void WriteTnCdata(OCRepPayload* payload, char* resourceType)
158 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteTnCdata IN");
160 if(payload == NULL || resourceType == NULL)
162 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "Invalid Params payload or resourceType is NULL");
163 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "WriteTnCdata OUT");
166 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_EASYSETUP))
168 OCRepPayloadSetPropInt(payload, SC_RSRVD_ES_VENDOR_TNC_STATUS, g_SCProperties.tncStatus);
170 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
172 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_HEADER,
173 g_SCProperties.tncInfo.header);
174 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_VERSION,
175 g_SCProperties.tncInfo.version);
177 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
179 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_TNC_RESULT,
180 g_SCProperties.tncResult);
182 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteTnCdata OUT");
185 void WriteWifiData(OCRepPayload* payload, char* resourceType)
187 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteWifiData IN");
189 if(payload == NULL || resourceType == NULL)
191 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "Invalid Params payload or resourceType is NULL");
192 OIC_LOG(DEBUG, SC_ENROLLEE_TAG, "WriteWifiData OUT");
196 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_WIFICONF))
198 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_BSSID,
199 g_SCProperties.bssid);
201 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteWifiData OUT");
204 ESResult SetRegisterSetDevice(const char *regSetDevice)
206 if(regSetDevice != NULL)
208 OICStrcpy(g_SCProperties.regSetDev, sizeof(g_SCProperties.regSetDev), regSetDevice);
214 ESResult SetNetworkProvInfo(const char *nwProvInfo)
216 if(nwProvInfo != NULL)
218 OICStrcpy(g_SCProperties.nwProvInfo, sizeof(g_SCProperties.nwProvInfo), nwProvInfo);
224 ESResult SetSCPnPPin(const char *pnp)
228 OICStrcpy(g_SCProperties.pnpPin, sizeof(g_SCProperties.pnpPin), pnp);
234 ESResult SetESVersionInfo(const char *esProtocolVersion)
236 if(esProtocolVersion != NULL)
238 OICStrcpy(g_SCProperties.esProtocolVersion, sizeof(g_SCProperties.esProtocolVersion), esProtocolVersion);
244 void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata)
246 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadUserdataCb IN");
250 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_WIFICONF))
252 int64_t channel = -1;
254 if (OCRepPayloadGetPropInt(payload, SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, &channel))
256 if(*userdata == NULL)
258 *userdata = (void*)OICMalloc(sizeof(SCWiFiConfProperties));
259 if( *userdata == NULL )
261 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCWiFiConfProperties is failed");
264 memset(*userdata, 0, sizeof(SCWiFiConfProperties));
266 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : [%" PRId64 "]",
267 SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, channel);
268 ((SCWiFiConfProperties*)(*userdata))->discoveryChannel = (int) channel;
269 g_SCProperties.discoveryChannel = channel;
271 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_BSSID, &bssid))
273 if(*userdata == NULL)
275 *userdata = (void*) OICMalloc(sizeof(SCWiFiConfProperties));
276 if( *userdata == NULL )
278 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCWiFiConfProperties is failed");
281 memset(*userdata, 0, sizeof(SCWiFiConfProperties));
283 if (*userdata != NULL)
285 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
286 SC_RSRVD_ES_VENDOR_BSSID, bssid);
287 SCWiFiConfProperties* pWifiConfProp = (SCWiFiConfProperties*)(*userdata);
288 OICStrcpy(pWifiConfProp->bssid, sizeof(pWifiConfProp->bssid), bssid);
289 OICStrcpy(g_SCProperties.bssid, sizeof(g_SCProperties.bssid), bssid);
294 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
296 if(*userdata == NULL)
298 *userdata = (void*)OICMalloc(sizeof(SCDevConfProperties));
299 if( *userdata == NULL )
301 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCDevConfProperties is failed");
304 memset(*userdata, 0, sizeof(SCDevConfProperties));
307 SCDevConfProperties *pDevConfProp = (SCDevConfProperties*)(*userdata);
309 char**locationList = NULL;
310 size_t dimensions[MAX_REP_ARRAY_DEPTH] = {0};
311 if(OCRepPayloadGetStringArray(payload, SC_RSRVD_ES_VENDOR_LOCATION, &locationList, dimensions))
313 for(size_t idx = 0; idx < dimensions[0]; idx++)
315 OICStrcpy(pDevConfProp->location[idx], strlen(locationList[idx])+1, locationList[idx]);
316 OICStrcpy(g_SCProperties.location[idx], strlen(locationList[idx])+1, locationList[idx]);
318 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
319 SC_RSRVD_ES_VENDOR_LOCATION, pDevConfProp->location[idx]);
322 ((SCDevConfProperties*)(*userdata))->numLocation = (int)dimensions[0];
323 g_SCProperties.numLocation = (int)dimensions[0];
326 ReadAccountData(payload,userdata);
328 char *regMobileDev = NULL;
329 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, ®MobileDev))
331 OICStrcpy(pDevConfProp->regMobileDev, strlen(regMobileDev)+1, regMobileDev);
332 OICStrcpy(g_SCProperties.regMobileDev, strlen(regMobileDev)+1, regMobileDev);
333 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regMobileDev %s", g_SCProperties.regMobileDev);
336 char *country = NULL;
337 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, &country))
339 OICStrcpy(pDevConfProp->country, strlen(country)+1, country);
340 OICStrcpy(g_SCProperties.country, strlen(country)+1, country);
341 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.country %s", g_SCProperties.country);
344 char *language = NULL;
345 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, &language))
347 OICStrcpy(pDevConfProp->language, strlen(language)+1, language);
348 OICStrcpy(g_SCProperties.language, strlen(language)+1, language);
349 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.language %s", g_SCProperties.language);
352 char *gpsLocation = NULL;
353 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, &gpsLocation))
355 OICStrcpy(pDevConfProp->gpsLocation, strlen(gpsLocation)+1, gpsLocation);
356 OICStrcpy(g_SCProperties.gpsLocation, strlen(gpsLocation)+1, gpsLocation);
357 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.gpsLocation %s", g_SCProperties.gpsLocation);
360 char *utcDateTime = NULL;
361 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, &utcDateTime))
363 OICStrcpy(pDevConfProp->utcDateTime, strlen(utcDateTime)+1, utcDateTime);
364 OICStrcpy(g_SCProperties.utcDateTime, strlen(utcDateTime)+1, utcDateTime);
365 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.utcDateTime %s", g_SCProperties.utcDateTime);
368 char *regionalDateTime = NULL;
369 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, ®ionalDateTime))
371 OICStrcpy(pDevConfProp->regionalDateTime, strlen(regionalDateTime)+1, regionalDateTime);
372 OICStrcpy(g_SCProperties.regionalDateTime, strlen(regionalDateTime)+1, regionalDateTime);
373 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regionalDateTime %s", g_SCProperties.regionalDateTime);
376 else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
378 char* clientID = NULL;
379 if(OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_CLIENTID, &clientID))
381 if(*userdata == NULL)
383 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
384 if( *userdata == NULL )
386 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
389 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
392 SCCoapCloudServerConfProperties *pCloudProp =
393 (SCCoapCloudServerConfProperties*)(*userdata);
395 OICStrcpy(pCloudProp->clientID, strlen(clientID)+1, clientID);
396 OICStrcpy(g_SCProperties.clientID, strlen(clientID)+1, clientID);
398 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
399 SC_RSRVD_ES_VENDOR_CLIENTID, pCloudProp->clientID);
402 //SC_RSRVD_ES_VENDOR_AAC
404 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_AAC, &aac))
406 if(*userdata == NULL)
408 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
409 if( *userdata == NULL )
411 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
414 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
417 if (*userdata != NULL)
419 SCCoapCloudServerConfProperties *pCloudProp =
420 (SCCoapCloudServerConfProperties*) (*userdata);
421 pCloudProp->aac[0] = '\0';
423 OICStrcpy(pCloudProp->aac, MAXLEN_STRING, aac);
424 OICStrcpy(g_SCProperties.aac, MAXLEN_STRING, aac);
427 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
428 SC_RSRVD_ES_VENDOR_AAC, pCloudProp->aac);
432 //SC_RSRVD_ES_VENDOR_UID
434 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_UID, &uid))
436 if(*userdata == NULL)
438 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
439 if( *userdata == NULL )
441 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
444 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
447 if (*userdata != NULL)
449 SCCoapCloudServerConfProperties *pCloudProp =
450 (SCCoapCloudServerConfProperties*) (*userdata);
451 pCloudProp->uid[0] = '\0';
453 OICStrcpy(pCloudProp->uid, MAXLEN_STRING, uid);
454 OICStrcpy(g_SCProperties.uid, MAXLEN_STRING, uid);
457 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
458 SC_RSRVD_ES_VENDOR_UID, pCloudProp->uid);
462 //SC_RSRVD_ES_VENDOR_REFRESH_TOKEN
463 char *refreshToken = NULL;
464 if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, &refreshToken))
466 if(*userdata == NULL)
468 *userdata = (void*)OICMalloc(sizeof(SCCoapCloudServerConfProperties));
469 if( *userdata == NULL )
471 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCCoapCloudServerConfProperties is failed");
474 memset(*userdata, 0, sizeof(SCCoapCloudServerConfProperties));
477 if (*userdata != NULL)
479 SCCoapCloudServerConfProperties *pCloudProp =
480 (SCCoapCloudServerConfProperties*) (*userdata);
481 pCloudProp->refreshToken[0] = '\0';
483 OICStrcpy(pCloudProp->refreshToken, MAXLEN_STRING, refreshToken);
484 OICStrcpy(g_SCProperties.refreshToken, MAXLEN_STRING, refreshToken);
485 OICFree(refreshToken);
487 OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
488 SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, pCloudProp->refreshToken);
492 ReadTnCdata(payload,userdata);
496 OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadUserdataCb OUT");
499 void WriteUserdataCb(OCRepPayload* payload, char* resourceType)
501 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteUserdataCb IN");
505 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_EASYSETUP))
507 OCRepPayloadSetPropInt(payload, SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE, (int) g_SCProperties.netConnectionState);
510 if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
513 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_TYPE, g_SCProperties.deviceType);
514 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE, g_SCProperties.deviceSubType);
515 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV, g_SCProperties.regSetDev);
516 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, g_SCProperties.regMobileDev);
517 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
518 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
519 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_MODEL_NUMBER, g_SCProperties.modelNumber);
520 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, g_SCProperties.country);
521 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, g_SCProperties.language);
522 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, g_SCProperties.gpsLocation);
523 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, g_SCProperties.utcDateTime);
524 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, g_SCProperties.regionalDateTime);
525 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
527 if(g_SCProperties.deviceType != NULL)
529 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_TYPE, g_SCProperties.deviceType);
531 if(g_SCProperties.deviceSubType != NULL)
533 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE, g_SCProperties.deviceSubType);
535 if(g_SCProperties.regSetDev != NULL)
537 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV, g_SCProperties.regSetDev);
539 if(g_SCProperties.regMobileDev != NULL)
541 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, g_SCProperties.regMobileDev);
543 if(g_SCProperties.nwProvInfo!= NULL)
545 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
547 if(g_SCProperties.pnpPin != NULL)
549 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
551 if(g_SCProperties.modelNumber != NULL)
553 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_MODEL_NUMBER, g_SCProperties.modelNumber);
555 if(g_SCProperties.country != NULL)
557 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, g_SCProperties.country);
559 if(g_SCProperties.language != NULL)
561 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_LANGUAGE, g_SCProperties.language);
563 if(g_SCProperties.gpsLocation != NULL)
565 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_GPSLOCATION, g_SCProperties.gpsLocation);
567 if(g_SCProperties.esProtocolVersion != NULL)
569 OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
575 WriteTnCdata(payload, resourceType);
576 WriteWifiData(payload, resourceType);
578 OIC_LOG(INFO, SC_ENROLLEE_TAG, "WriteUserdataCb OUT");