Commit 7505f121 authored by Uze Choi's avatar Uze Choi

ssid generation rule fix

Previously, sid is mistakenly used for soft ap ssid generation.
setup_id is right value for this.

Change-Id: I337aa6d5d1bc64ca487769a67cadafe203ad7c60
Signed-off-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/27775Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
parent fc5faa1f
......@@ -112,7 +112,6 @@ typedef struct
{
struct st_easy_setup_info_t
{
#ifdef ST_CONF_ENABLED
struct st_conn_info_t
{
int type;
......@@ -122,7 +121,6 @@ typedef struct
bool artik;
} soft_ap;
} connectivity;
#endif /* ST_CONF_ENABLED */
int ownership_transfer_method;
} easy_setup;
#ifdef ST_CONF_ENABLED
......
......@@ -43,7 +43,7 @@ int st_is_easy_setup_finish(void);
int st_easy_setup_start(sc_properties *vendor_props, st_easy_setup_cb_t cb);
void st_easy_setup_stop(void);
int st_gen_ssid(char *ssid, const char *device_name, const char *mnid,
const char *sid);
const char *setup_id);
#ifdef __cplusplus
}
......
......@@ -590,7 +590,6 @@ st_decode_configuration(oc_rep_t *conf_rep)
st_print_log("[ST_DM] can't get easy setup data\n");
goto error;
}
#ifdef ST_CONF_ENABLED
oc_rep_t *conn_rep = NULL, *softap_rep = NULL;
char *str_value = NULL;
size_t size = 0;
......@@ -614,7 +613,6 @@ st_decode_configuration(oc_rep_t *conf_rep)
if (oc_rep_get_bool(softap_rep, ST_CONF_SOFTAP_ARTIK_KEY, &bool_value)) {
conf->easy_setup.connectivity.soft_ap.artik = bool_value;
}
#endif /* ST_CONF_ENABLED */
if (oc_rep_get_int(conf_es_rep, ST_CONF_ES_OTM_KEY, &int_value)) {
#ifdef OC_SECURITY
if (!check_valid_otm_method(int_value)) {
......
......@@ -170,7 +170,7 @@ st_easy_setup_stop(void)
int
st_gen_ssid(char *ssid, const char *device_name, const char *mnid,
const char *sid)
const char *setup_id)
{
unsigned char mac[6] = { 0 };
......@@ -180,7 +180,7 @@ st_gen_ssid(char *ssid, const char *device_name, const char *mnid,
}
snprintf(ssid, MAX_SSID_LEN, "%s_%s%s%s%d%02X%02X", device_name,
EASYSETUP_TAG, mnid, sid, 0, mac[4], mac[5]);
EASYSETUP_TAG, mnid, setup_id, 0, mac[4], mac[5]);
st_print_log("[ST_ES] ssid : %s\n", ssid);
return 0;
......
......@@ -654,9 +654,12 @@ st_manager_stack_init(void)
char ssid[MAX_SSID_LEN + 1];
st_specification_t *spec = st_data_mgr_get_spec_info();
st_configuration_t *conf = st_data_mgr_get_config_info();
if (st_gen_ssid(ssid, oc_string(spec->device.device_name),
oc_string(spec->platform.manufacturer_name),
oc_string(spec->platform.model_number)) != 0) {
oc_string(conf->easy_setup.connectivity.soft_ap.setup_id))
!= 0)
{
return -1;
}
st_turn_on_soft_AP(ssid, SOFT_AP_PWD, SOFT_AP_CHANNEL);
......@@ -986,9 +989,12 @@ st_manager_stack_start(void)
char ssid[MAX_SSID_LEN + 1];
st_specification_t *spec = st_data_mgr_get_spec_info();
st_configuration_t *conf = st_data_mgr_get_config_info();
if (st_gen_ssid(ssid, oc_string(spec->device.device_name),
oc_string(spec->platform.manufacturer_name),
oc_string(spec->platform.model_number)) != 0) {
oc_string(conf->easy_setup.connectivity.soft_ap.setup_id))
!= 0)
{
return -1;
}
st_turn_on_soft_AP(ssid, SOFT_AP_PWD, SOFT_AP_CHANNEL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment