Following Samsung Specific Property is added :
Resource: Device Configuration (rt = "oic.r.devconf")
Property Name: SSO List Information
Key: "x.com.samsung.ssolist"
Type: String (JSON value with array of string internally).
Access Mode: Read Only
Description: SSO List information
Changes made at Mediator and Enrollee Side (Samsung specific source).
Linux Sample apps updated and verified (Samsung Specific Sample Apps).
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/284
(cherry picked from commit
26aec98b390c57957416dff8c3e9a920299aad8a)
Change-Id: Ib5143bb96488820b01404c2ec68dcf04c9f6a02c
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>
#define SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV "x.com.samsung.rsd"
#define SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO "x.com.samsung.npi"
#define SC_RSRVD_ES_VENDOR_ACCOUNT "x.com.samsung.account"
+#define SC_RSRVD_ES_VENDOR_SSO_LIST "x.com.samsung.ssolist"
#define SC_RSRVD_ES_VENDOR_AAC "x.com.samsung.aac"
#define SC_RSRVD_ES_VENDOR_TNC_HEADER "x.com.samsung.tcheader"
#define SC_RSRVD_ES_VENDOR_TNC_VERSION "x.com.samsung.tcversion"
char location[MAXNUM_LOCATION][MAXLEN_STRING]; /**< Samsung-specific location-related information **/
char regMobileDev[MAXLEN_STRING]; /**< Samsung-specific mobile device information for 'register TV' **/
char account[MAXLEN_STRING]; /**< Samsung-specific account-related information **/
+ char ssoList[MAXLEN_STRING]; /**< Samsung-specific SSO list information which is registered in device **/
SCTncInfo scTnCInfo; /**< Samsung-specific Terms & Conditions information **/
char modelNumber[MAXLEN_STRING]; /**< Samsung-specific model number **/
char language[MAXLEN_STRING]; /**< IETF language tag using ISO 639X **/
char regSetDev[MAXLEN_STRING]; /**< Samsung-specific set device information for 'register TV' **/
char nwProvInfo[MAXLEN_STRING]; /**< Samsung-specific network provisioning information for cellular network vendor **/
char account[MAXLEN_STRING]; /**< Samsung-specific account-related information **/
+ char ssoList[MAXLEN_STRING]; /**< Samsung-specific SSO list information which is registered in device **/
char aac[MAXLEN_STRING]; /**< Samsung-specific aac information **/
SCTncInfo tncInfo; /**< Samsung-specific Terms & Conditions information **/
char tncResult[MAXLEN_STRING]; /**< Samsung-specific Terms & Conditions result **/
OICStrcpy(g_SCProperties.regionalDateTime, strlen(regionalDateTime)+1, regionalDateTime);
OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regionalDateTime %s", g_SCProperties.regionalDateTime);
}
+
+ char *ssoList = NULL;
+ if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_SSO_LIST, &ssoList))
+ {
+ OICStrcpy(pDevConfProp->ssoList, strlen(ssoList)+1, ssoList);
+ OICStrcpy(g_SCProperties.ssoList, strlen(ssoList)+1, ssoList);
+ OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.ssoList %s", g_SCProperties.ssoList);
+ }
}
else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF))
{
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV, g_SCProperties.regSetDev);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, g_SCProperties.regMobileDev);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
+ OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_SSO_LIST, g_SCProperties.ssoList);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_MODEL_NUMBER, g_SCProperties.modelNumber);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_COUNTRY, g_SCProperties.country);
{
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO, g_SCProperties.nwProvInfo);
}
+ if(g_SCProperties.ssoList!= NULL)
+ {
+ OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_SSO_LIST, g_SCProperties.ssoList);
+ }
if(g_SCProperties.pnpPin != NULL)
{
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_PNP_PIN, g_SCProperties.pnpPin);
#define SC_RSRVD_ES_VENDOR_LOCATION "x.com.samsung.location"
#define SC_RSRVD_ES_VENDOR_CLIENTID "x.com.samsung.clientid"
#define SC_RSRVD_ES_VENDOR_ACCOUNT "x.com.samsung.account"
+#define SC_RSRVD_ES_VENDOR_SSO_LIST "x.com.samsung.ssolist"
#define SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE "x.com.samsung.aac"
#define SC_RSRVD_ES_VENDOR_ACCESS_TOKEN "x.com.samsung.accesstoken"
#define SC_RSRVD_ES_VENDOR_REFRESH_TOKEN "x.com.samsung.refreshtoken"
}
return {};
}
+
+ /**
+ * Set SSO list information
+ *
+ * @param SSO list
+ */
+ void setSSOList(const std::string &ssoList)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SSO_LIST, ssoList);
+ }
+
+ /**
+ * Get SSO List information which is registered in device
+ *
+ * @return SSO List
+ */
+ std::string getSSOList()
+ {
+ if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SSO_LIST))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SSO_LIST);
+ }
+ return {};
+ }
};
class SCCloudProp : public CloudProp
return std::string("");
}
+ /**
+ * Get SSO List information for the device.
+ * The format is in JSON. The key indicates the meaning of value and the value is a
+ * corresponding information. Supported keys include: Available Count , Registered Count,
+ * Account List
+ *
+ * @return SSo List Information String.
+ */
+ std::string getSSOList() const
+ {
+ std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
+ for(auto child = children.begin(); child != children.end(); ++child)
+ {
+ if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
+ {
+ OCRepresentation rep;
+ if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
+ {
+ rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
+ }
+ else
+ {
+ return std::string("");
+ }
+
+ if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_SSO_LIST))
+ {
+ return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SSO_LIST);
+ }
+ }
+ }
+ return std::string("");
+ }
+
/**
* Get T&C status
* Indicates T&C is already agreed or not.
printf("[SC] GPS Location : %s\n", data->gpsLocation);
printf("[SC] UTC Date time : %s\n", data->utcDateTime);
printf("[SC] Regional time : %s\n", data->regionalDateTime);
+ printf("[SC] SSO List : %s\n", data->ssoList);
}
printf("DevConfProvCbInApp OUT\n");
cout << "\tDevice Sub-Type: " << conf.getDeviceSubType() << endl;
cout << "\tRegister Set Device: " << conf.getRegisterSetDevice() << endl;
cout << "\tNetwork Provisioning Info: " << conf.getNetworkProvisioningInfo() << endl;
+ cout << "\tSSOList: " << conf.getSSOList() << endl;
cout << "\tPnP Pin: " << conf.getPnpPin() << endl;
cout << "\tNetwork Connection State : " << conf.getNetConnectionState() << endl;
cout << "\tBSSID : " << conf.getBSSID() << endl;
locations.push_back("bd=apartment");
scDevProp.setSCLocation(locations);
scDevProp.setRegisterMobileDevice("{\"wm\":\"00:11:22:33:44:55\",\"pm\":\"00:11:22:33:44:55\",\"bm\":\"00:11:22:33:44:55\",\"dt\":\"0\",\"it\":\"0\"}");
+ scDevProp.setSSOList("[{\"AvailableCount\" : \"1\", \"RegisteredCount\" : \"3\", \"AccountList\" : {\"aaa@samsung.com\", \"bbb@samsung.com\",\"ccc@samsung.com\"} }] ");
+
// Set UTC and regional date
time_t t = time(NULL);