*/
typedef struct
{
- char ssid[MAX_SSIDLEN]; /**< Ssid of the Enroller**/
- char pwd[MAX_CREDLEN]; /**< Pwd of the Enroller**/
+ char ssid[OIC_STRING_MAX_VALUE]; /**< Ssid of the Enroller**/
+ char pwd[OIC_STRING_MAX_VALUE]; /**< Pwd of the Enroller**/
WIFI_AUTHTYPE authtype; /**< Auth type of the Enroller**/
WIFI_ENCTYPE enctype; /**< Encryption type of the Enroller**/
void *userdata; /**< Vender-specific data**/
*/
typedef struct
{
+ char location[OIC_STRING_MAX_VALUE]; /**< GPS information of device. Longitude and latitude in json format **/
char language[OIC_STRING_MAX_VALUE]; /**< IETF language tag using ISO 639X **/
char country[OIC_STRING_MAX_VALUE]; /**< ISO Country Code (ISO 3166-1 Alpha-2) **/
void *userdata; /**< Vender-specific data**/
*/
struct
{
- char deviceName[MAX_DEVICELEN];
+ char deviceName[OIC_STRING_MAX_VALUE];
+ char modelNumber[OIC_STRING_MAX_VALUE];
} DevConf;
} ESDeviceProperty;
{
if (name != NULL && pass != NULL)
{
- OICStrcpy(name, MAX_SSIDLEN, gWiFiResource.ssid);
- OICStrcpy(pass, MAX_CREDLEN, gWiFiResource.cred);
+ OICStrcpy(name, MAX_WEBLINKLEN, gWiFiResource.ssid);
+ OICStrcpy(pass, MAX_WEBLINKLEN, gWiFiResource.cred);
}
}
OCStackResult res = OC_STACK_ERROR;
OICStrcpy(gDevConfResource.devName, sizeof(gDevConfResource.devName), "");
+ OICStrcpy(gDevConfResource.modelNumber, sizeof(gDevConfResource.modelNumber), "");
+ OICStrcpy(gDevConfResource.location, sizeof(gDevConfResource.location), "");
OICStrcpy(gDevConfResource.country, sizeof(gDevConfResource.country), "");
OICStrcpy(gDevConfResource.language, sizeof(gDevConfResource.language), "");
return ;
}
- memset(wiFiData->ssid, 0, MAX_SSIDLEN);
- memset(wiFiData->pwd, 0, MAX_CREDLEN);
+ memset(wiFiData->ssid, 0, MAX_WEBLINKLEN);
+ memset(wiFiData->pwd, 0, MAX_WEBLINKLEN);
wiFiData->authtype = NONE_AUTH;
wiFiData->enctype = NONE_AUTH;
wiFiData->userdata = NULL;
memset(devConfData->country, 0, OIC_STRING_MAX_VALUE);
devConfData->userdata = NULL;
+ char *location = NULL;
+ if (OCRepPayloadGetPropString(input, OC_RSRVD_ES_LOCATION, &location))
+ {
+ OICStrcpy(gDevConfResource.location, sizeof(gDevConfResource.location), location);
+ OICStrcpy(devConfData->location, sizeof(devConfData->location), location);
+ OIC_LOG_V(INFO, ES_RH_TAG, "gDevConfResource.location %s", gDevConfResource.location);
+ }
+
char *country = NULL;
if (OCRepPayloadGetPropString(input, OC_RSRVD_ES_COUNTRY, &country))
{
OIC_LOG(INFO, ES_RH_TAG, "constructResponse prov res");
OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_DEVCONF);
OCRepPayloadSetPropString(payload, OC_RSRVD_ES_DEVNAME, gDevConfResource.devName);
+ OCRepPayloadSetPropString(payload, OC_RSRVD_ES_MODELNUMBER, gDevConfResource.modelNumber);
+ OCRepPayloadSetPropString(payload, OC_RSRVD_ES_LOCATION, gDevConfResource.location);
OCRepPayloadSetPropString(payload, OC_RSRVD_ES_LANGUAGE, gDevConfResource.language);
OCRepPayloadSetPropString(payload, OC_RSRVD_ES_COUNTRY, gDevConfResource.country);
}
gWiFiResource.numMode = modeIdx;
- OICStrcpy(gDevConfResource.devName, MAX_DEVICELEN, (deviceProperty->DevConf).deviceName);
+ OICStrcpy(gDevConfResource.devName, OIC_STRING_MAX_VALUE, (deviceProperty->DevConf).deviceName);
OIC_LOG_V(INFO, ES_RH_TAG, "Device Name : %s", gDevConfResource.devName);
+ OICStrcpy(gDevConfResource.modelNumber, OIC_STRING_MAX_VALUE,
+ (deviceProperty->DevConf).modelNumber);
+ OIC_LOG_V(INFO, ES_RH_TAG, "Model Number : %s", gDevConfResource.modelNumber);
+
OIC_LOG(INFO, ES_RH_TAG, "SetDeviceProperty OUT");
return OC_STACK_OK;
}
#endif
// Defines
-#define OIC_STRING_MAX_VALUE 100
-#define IPV4_ADDR_SIZE 16
-#define IP_PORT 55555
-
-/**
- * @brief Mac address length for BT port
- */
-#define NET_MACADDR_SIZE 18
+#define OIC_STRING_MAX_VALUE 64
+#define MAX_WEBLINKLEN 3
+#define NUM_WIFIMODE 5
/**
* Attributes used to form a proper easysetup conforming JSON message.
#define OC_RSRVD_ES_DEVNAME "dn"
#define OC_RSRVD_ES_LANGUAGE "lang"
#define OC_RSRVD_ES_COUNTRY "ctry"
+#define OC_RSRVD_ES_MODELNUMBER "mnmo"
+#define OC_RSRVD_ES_LOCATION "loc"
/**
* Easysetup defined resoruce types and uris.
#define OC_RSRVD_ES_RES_TYPE_DEVCONF "ocf.wk.devconf"
#define OC_RSRVD_ES_URI_DEVCONF "/DevConfProvisioningResURI"
-#define NUM_WIFIMODE 10
-#define MAX_SSIDLEN 33
-#define MAX_CREDLEN 20
-
-#define MAX_DEVICELEN 100
-#define MAX_WEBLINKLEN 100
/**
* @brief Supported WIFI frequency like 2.4G and 5G