From f434b3068b3dc1e053359f24d72eb3558093bd27 Mon Sep 17 00:00:00 2001 From: agrkush Date: Wed, 17 Oct 2018 13:20:51 +0530 Subject: [PATCH] Added API for SSOList in SC Easysetup https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/330 (cherry picked from commit ee54128ab52b613734213d16cdbaebb0c9c1c409) Change-Id: I5841fd01f0fd831bf8b7269db1fd305746ab9437 Signed-off-by: agrkush Signed-off-by: Amit KS --- service/easy-setup/enrollee/inc/samsung/sc_easysetup.h | 1 + service/easy-setup/enrollee/src/samsung/sc_easysetup.c | 10 ++++++++++ .../easy-setup/sampleapp/enrollee/linux-samsung/sc_enrollee.c | 3 +++ 3 files changed, 14 insertions(+) diff --git a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h index fc4a42a..18bd0f0 100644 --- a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h +++ b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h @@ -168,5 +168,6 @@ ESResult SetSCNetConnectionState(NETCONNECTION_STATE netConnectionState); ESResult SetSCPnPPin(const char *pnp); ESResult SetESVersionInfo(const char *esVersionInfo); +ESResult SetSSOList(const char *ssoList); #endif /* EASYSETUPX_ENROLLEE_H__ */ diff --git a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c index ac883f0..70d22b5 100755 --- a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c +++ b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c @@ -238,6 +238,16 @@ ESResult SetESVersionInfo(const char *esProtocolVersion) return ES_ERROR; } +ESResult SetSSOList(const char *ssoList) +{ + if(ssoList != NULL) + { + OICStrcpy(g_SCProperties.ssoList, sizeof(g_SCProperties.ssoList), ssoList); + return ES_OK; + } + return ES_ERROR; +} + void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata) { OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadUserdataCb IN"); diff --git a/service/easy-setup/sampleapp/enrollee/linux-samsung/sc_enrollee.c b/service/easy-setup/sampleapp/enrollee/linux-samsung/sc_enrollee.c index 0713cc9..67e2c99 100644 --- a/service/easy-setup/sampleapp/enrollee/linux-samsung/sc_enrollee.c +++ b/service/easy-setup/sampleapp/enrollee/linux-samsung/sc_enrollee.c @@ -225,6 +225,9 @@ void SetDeviceInfo() if(SetSCProperties(&g_SCProperties) == ES_ERROR) printf("SetSCProperties Error\n"); + if(SetSSOList( "[{\"AvailableCount\" : \"1\", \"RegisteredCount\" : \"3\", \"AccountList\" : {\"aaa@samsung.com\", \"bbb@samsung.com\",\"ccc@samsung.com\"} }] ")== ES_ERROR) + printf("SetSSOList Error\n"); + printf("SetDeviceInfo OUT\n"); } -- 2.7.4