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 ...@@ -112,7 +112,6 @@ typedef struct
{ {
struct st_easy_setup_info_t struct st_easy_setup_info_t
{ {
#ifdef ST_CONF_ENABLED
struct st_conn_info_t struct st_conn_info_t
{ {
int type; int type;
...@@ -122,7 +121,6 @@ typedef struct ...@@ -122,7 +121,6 @@ typedef struct
bool artik; bool artik;
} soft_ap; } soft_ap;
} connectivity; } connectivity;
#endif /* ST_CONF_ENABLED */
int ownership_transfer_method; int ownership_transfer_method;
} easy_setup; } easy_setup;
#ifdef ST_CONF_ENABLED #ifdef ST_CONF_ENABLED
......
...@@ -43,7 +43,7 @@ int st_is_easy_setup_finish(void); ...@@ -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); int st_easy_setup_start(sc_properties *vendor_props, st_easy_setup_cb_t cb);
void st_easy_setup_stop(void); void st_easy_setup_stop(void);
int st_gen_ssid(char *ssid, const char *device_name, const char *mnid, int st_gen_ssid(char *ssid, const char *device_name, const char *mnid,
const char *sid); const char *setup_id);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -590,7 +590,6 @@ st_decode_configuration(oc_rep_t *conf_rep) ...@@ -590,7 +590,6 @@ st_decode_configuration(oc_rep_t *conf_rep)
st_print_log("[ST_DM] can't get easy setup data\n"); st_print_log("[ST_DM] can't get easy setup data\n");
goto error; goto error;
} }
#ifdef ST_CONF_ENABLED
oc_rep_t *conn_rep = NULL, *softap_rep = NULL; oc_rep_t *conn_rep = NULL, *softap_rep = NULL;
char *str_value = NULL; char *str_value = NULL;
size_t size = 0; size_t size = 0;
...@@ -614,7 +613,6 @@ st_decode_configuration(oc_rep_t *conf_rep) ...@@ -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)) { if (oc_rep_get_bool(softap_rep, ST_CONF_SOFTAP_ARTIK_KEY, &bool_value)) {
conf->easy_setup.connectivity.soft_ap.artik = 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)) { if (oc_rep_get_int(conf_es_rep, ST_CONF_ES_OTM_KEY, &int_value)) {
#ifdef OC_SECURITY #ifdef OC_SECURITY
if (!check_valid_otm_method(int_value)) { if (!check_valid_otm_method(int_value)) {
......
...@@ -170,7 +170,7 @@ st_easy_setup_stop(void) ...@@ -170,7 +170,7 @@ st_easy_setup_stop(void)
int int
st_gen_ssid(char *ssid, const char *device_name, const char *mnid, st_gen_ssid(char *ssid, const char *device_name, const char *mnid,
const char *sid) const char *setup_id)
{ {
unsigned char mac[6] = { 0 }; unsigned char mac[6] = { 0 };
...@@ -180,7 +180,7 @@ st_gen_ssid(char *ssid, const char *device_name, const char *mnid, ...@@ -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, 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); st_print_log("[ST_ES] ssid : %s\n", ssid);
return 0; return 0;
......
...@@ -654,9 +654,12 @@ st_manager_stack_init(void) ...@@ -654,9 +654,12 @@ st_manager_stack_init(void)
char ssid[MAX_SSID_LEN + 1]; char ssid[MAX_SSID_LEN + 1];
st_specification_t *spec = st_data_mgr_get_spec_info(); 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), if (st_gen_ssid(ssid, oc_string(spec->device.device_name),
oc_string(spec->platform.manufacturer_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; return -1;
} }
st_turn_on_soft_AP(ssid, SOFT_AP_PWD, SOFT_AP_CHANNEL); st_turn_on_soft_AP(ssid, SOFT_AP_PWD, SOFT_AP_CHANNEL);
...@@ -986,9 +989,12 @@ st_manager_stack_start(void) ...@@ -986,9 +989,12 @@ st_manager_stack_start(void)
char ssid[MAX_SSID_LEN + 1]; char ssid[MAX_SSID_LEN + 1];
st_specification_t *spec = st_data_mgr_get_spec_info(); 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), if (st_gen_ssid(ssid, oc_string(spec->device.device_name),
oc_string(spec->platform.manufacturer_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; return -1;
} }
st_turn_on_soft_AP(ssid, SOFT_AP_PWD, SOFT_AP_CHANNEL); 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