From a01c15576ed53b49a4a70135aa978b06ab9bef8c Mon Sep 17 00:00:00 2001 From: "pooja.k@partner.samsung.com" Date: Fri, 21 Dec 2018 16:14:04 +0530 Subject: [PATCH] Modified additional field changed Samsung specific x.com.samsung.candidateaps value's key names. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/375 (cherry picked from commit c786ccc79e1abfa9669706313ef6b77557bc573a) Change-Id: I0ff2251fa0e1110455bdcf23c99b579b5f564db3 Signed-off-by: pooja Signed-off-by: Amit KS --- .../easy-setup/enrollee/inc/samsung/sc_easysetup.h | 9 ++-- .../easy-setup/enrollee/src/samsung/sc_easysetup.c | 58 +++++++++++----------- .../easy-setup/mediator/richsdk/inc/ESSCCommon.h | 37 +++++++------- 3 files changed, 53 insertions(+), 51 deletions(-) diff --git a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h index 90c5d7d..b31db1d 100644 --- a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h +++ b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h @@ -59,12 +59,13 @@ #define SC_RSRVD_ES_VENDOR_TIMEZONE_ID "x.com.samsung.timezoneid" #define SC_RSRVD_ES_VENDOR_HIDDEN "x.com.samsung.hidden" #define SC_RSRVD_ES_VENDOR_HUB_ID "x.com.samsung.hubid" -#define SC_RSRVD_ES_VENDOR_CANDIDATEAPS "x.com.samsung.candidateaps" -#define SC_RSRVD_ES_VENDOR_SSID "x.com.samsung.ssid" -#define SC_RSRVD_ES_VENDOR_PASSPHRASE "x.com.samsung.passphrase" -#define SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL "x.com.samsung.channel" #define SC_RSRVD_ES_VENDOR_DEPLOY_ENVIRONMENT "x.com.samsung.deployenv" #define SC_RSRVD_ES_VENDOR_IATT "x.com.samsung.iatt" +#define SC_RSRVD_ES_VENDOR_CANDIDATEAPS "x.com.samsung.candidateaps" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_SSID "ssid" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE "passphrase" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL "channel" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID "bssid" #define WIFI_DISCOVERY_CHANNEL_INIT -1 diff --git a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c index 0f515fe..4875968 100644 --- a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c +++ b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c @@ -317,40 +317,40 @@ void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata) SCWiFiConfProperties* pWifiConfProp = (SCWiFiConfProperties*)(*userdata); for (size_t i = 0; i < dimensions[0]; i++) { - int64_t cd_channel = -1; - char *cd_bssid = NULL; - char *ssid = NULL; - char *pwd = NULL; - if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_SSID, &ssid)) + int64_t cdChannel = -1; + char *cdBssid = NULL; + char *cdSsid = NULL; + char *cdPwd = NULL; + if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_SSID, &cdSsid)) { - OICStrcpy(pWifiConfProp->candidateAPInfo[i].ssid, sizeof(pWifiConfProp->candidateAPInfo[i].ssid), ssid); - OICStrcpy(g_SCProperties.candidateAPInfo[i].ssid, sizeof(g_SCProperties.candidateAPInfo[i].ssid), ssid); + OICStrcpy(pWifiConfProp->candidateAPInfo[i].ssid, sizeof(pWifiConfProp->candidateAPInfo[i].ssid), cdSsid); + OICStrcpy(g_SCProperties.candidateAPInfo[i].ssid, sizeof(g_SCProperties.candidateAPInfo[i].ssid), cdSsid); OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s", - SC_RSRVD_ES_VENDOR_SSID, ssid); - OICFree(ssid); + SC_RSRVD_ES_VENDOR_CANDIDATE_SSID, cdSsid); + OICFree(cdSsid); } - if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_PASSPHRASE, &pwd)) + if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE, &cdPwd)) { - OICStrcpy(pWifiConfProp->candidateAPInfo[i].passphrase, sizeof(pWifiConfProp->candidateAPInfo[i].passphrase), pwd); - OICStrcpy(g_SCProperties.candidateAPInfo[i].passphrase, sizeof(g_SCProperties.candidateAPInfo[i].passphrase), pwd); - OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s", - SC_RSRVD_ES_VENDOR_PASSPHRASE, ssid); - OICFree(pwd); + OICStrcpy(pWifiConfProp->candidateAPInfo[i].passphrase, sizeof(pWifiConfProp->candidateAPInfo[i].passphrase), cdPwd); + OICStrcpy(g_SCProperties.candidateAPInfo[i].passphrase, sizeof(g_SCProperties.candidateAPInfo[i].passphrase), cdPwd); + OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s", + SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE, cdPwd); + OICFree(cdPwd); } - if (OCRepPayloadGetPropInt(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL, &cd_channel)) + if (OCRepPayloadGetPropInt(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL, &cdChannel)) { - pWifiConfProp->candidateAPInfo[i].channel = (int) cd_channel; - g_SCProperties.candidateAPInfo[i].channel = cd_channel; - OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %d", - SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL, (int) cd_channel); + pWifiConfProp->candidateAPInfo[i].channel = (int) cdChannel; + g_SCProperties.candidateAPInfo[i].channel = cdChannel; + OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %d", + SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL, (int) cdChannel); } - if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_BSSID, &cd_bssid)) + if (OCRepPayloadGetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID, &cdBssid)) { - OICStrcpy(pWifiConfProp->candidateAPInfo[i].bssid, sizeof(pWifiConfProp->candidateAPInfo[i].bssid), cd_bssid); - OICStrcpy(g_SCProperties.candidateAPInfo[i].bssid, sizeof(g_SCProperties.candidateAPInfo[i].bssid), cd_bssid); - OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s", - SC_RSRVD_ES_VENDOR_BSSID, cd_bssid); - OICFree(bssid); + OICStrcpy(pWifiConfProp->candidateAPInfo[i].bssid, sizeof(pWifiConfProp->candidateAPInfo[i].bssid), cdBssid); + OICStrcpy(g_SCProperties.candidateAPInfo[i].bssid, sizeof(g_SCProperties.candidateAPInfo[i].bssid), cdBssid); + OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s", + SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID, cdBssid); + OICFree(cdBssid); } } pWifiConfProp->numCandidateAP = (int)dimensions[0]; @@ -683,9 +683,9 @@ void WriteUserdataCb(OCRepPayload* payload, char* resourceType) OCRepPayloadDestroy(*repPayload); break; } - OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_SSID, g_SCProperties.candidateAPInfo[i].ssid); - OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_PASSPHRASE, g_SCProperties.candidateAPInfo[i].passphrase); - OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_BSSID, g_SCProperties.candidateAPInfo[i].bssid); + OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_SSID, g_SCProperties.candidateAPInfo[i].ssid); + OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE, g_SCProperties.candidateAPInfo[i].passphrase); + OCRepPayloadSetPropString(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID, g_SCProperties.candidateAPInfo[i].bssid); OCRepPayloadSetPropInt(repPayload[i], SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL, g_SCProperties.candidateAPInfo[i].channel); } size_t dimensions[MAX_REP_ARRAY_DEPTH] = {g_SCProperties.numCandidateAP, 0, 0}; diff --git a/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h b/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h index ff298c2..d52cd26 100644 --- a/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h +++ b/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h @@ -68,9 +68,10 @@ using namespace std; #define SC_RSRVD_ES_VENDOR_DEPLOY_ENVIRONMENT "x.com.samsung.deployenv" #define SC_RSRVD_ES_VENDOR_IATT "x.com.samsung.iatt" #define SC_RSRVD_ES_VENDOR_CANDIDATEAPS "x.com.samsung.candidateaps" -#define SC_RSRVD_ES_VENDOR_SSID "x.com.samsung.ssid" -#define SC_RSRVD_ES_VENDOR_PASSPHRASE "x.com.samsung.passphrase" -#define SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL "x.com.samsung.channel" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_SSID "ssid" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE "passphrase" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL "channel" +#define SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID "bssid" namespace OIC { @@ -416,10 +417,10 @@ namespace OIC for (int i=0;i(SC_RSRVD_ES_VENDOR_SSID); + candidateInfotemp.ssid=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_SSID); } - if (rep.hasAttribute(SC_RSRVD_ES_VENDOR_PASSPHRASE)) + if (rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE)) { - candidateInfotemp.passphrase=rep.getValue(SC_RSRVD_ES_VENDOR_PASSPHRASE); + candidateInfotemp.passphrase=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE); } if (rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL)) { candidateInfotemp.channel=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL); } - if (rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID)) + if (rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID)) { - candidateInfotemp.bssid=rep.getValue(SC_RSRVD_ES_VENDOR_BSSID); + candidateInfotemp.bssid=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID); } postcandidateInfo.push_back(candidateInfotemp); } @@ -944,22 +945,22 @@ namespace OIC { OC::OCRepresentation rep = *it; SCCandidateAPInfo candidateInfotemp; - if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_SSID)) + if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_SSID)) { - candidateInfotemp.ssid=rep.getValue(SC_RSRVD_ES_VENDOR_SSID); + candidateInfotemp.ssid=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_SSID); } - if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_PASSPHRASE)) + if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE)) { - candidateInfotemp.passphrase=rep.getValue(SC_RSRVD_ES_VENDOR_PASSPHRASE); + candidateInfotemp.passphrase=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_PASSPHRASE); } if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL)) { candidateInfotemp.channel=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_CHANNEL); } - if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID)) + if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID)) { - candidateInfotemp.bssid=rep.getValue(SC_RSRVD_ES_VENDOR_BSSID); + candidateInfotemp.bssid=rep.getValue(SC_RSRVD_ES_VENDOR_CANDIDATE_BSSID); } postcandidateInfo.push_back(candidateInfotemp); } -- 2.7.4