Fix the st_things framework bug
authorHeejin Kim <hj_elena.kim@samsung.com>
Sat, 23 Sep 2017 22:36:37 +0000 (07:36 +0900)
committerHeejin Kim <hj_elena.kim@samsung.com>
Sat, 23 Sep 2017 22:36:37 +0000 (07:36 +0900)
When coping the ssid, there is an error. That is fixed.

framework/include/st_things/st_things.h
framework/src/st_things/things_stack/src/common/easy-setup/resource_handler.c

index 377733a..3edd36e 100644 (file)
@@ -140,21 +140,6 @@ int st_things_register_request_cb(st_things_get_request_cb get_cb, st_things_set
 int st_things_start(void);
 
 /**
- * @brief Stops things stack.
- *            Removes all the data being used internally and releases all the memory allocated for the stack.
- *            Stack should have been initialized and started before calling this API.
- * @return @c 0 on success, otherwise a negative error value
- * @retval #ST_THINGS_ERROR_NONE Successful
- * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not initialized.
- *         Initialize the stack by calling st_things_initialize().
- * @retval #ST_THINGS_ERROR_STACK_NOT_STARTED Stack is not started.
- *         Start the stack by calling st_things_start().
- * @since Tizen RT v1.1
- */
-int st_things_stop(void);
-
-/**
  * @brief Callback for getting user's opinion regarding device reset.
  * @return @c true to confirm, otherwise @c to deny
  * @since Tizen RT v1.1
index dc82065..239bbfd 100644 (file)
@@ -405,7 +405,7 @@ void set_ssid_in_wifi_resource(const char *ssid)
                g_wifi_resource.auth_type = NONE_AUTH;
                g_wifi_resource.enc_type = NONE_ENC;
                g_wifi_resource.discovery_channel = 0;
-       } else if (strncmp(ssid, g_wifi_data.ssid, strlen(g_wifi_data.ssid)) == 0) {
+       } else if (strncmp(ssid, g_wifi_data.ssid, strlen(ssid)) == 0) {
                things_strncpy(g_wifi_resource.ssid, g_wifi_data.ssid, sizeof(char) *MAX_SSIDLEN);
                things_strncpy(g_wifi_resource.cred, g_wifi_data.pwd, sizeof(char) *MAX_CREDLEN);
                g_wifi_resource.auth_type = g_wifi_data.authtype;
@@ -487,7 +487,7 @@ void update_wifi_resource(OCRepPayload *input)
        }
 
        THINGS_LOG_D(THINGS_DEBUG, ES_RH_TAG, "Current AP SSID: %s", g_wifi_resource.ssid);
-       if (strncmp(ssid, g_wifi_resource.ssid, strlen(g_wifi_resource.ssid)) == 0) {
+       if (strncmp(ssid, g_wifi_resource.ssid, strlen(ssid)) == 0) {
                THINGS_LOG_D(THINGS_DEBUG, ES_RH_TAG, "Already connected SSID(%s).", ssid);
                free(ssid);
                return;
@@ -1032,7 +1032,7 @@ OCRepPayload *construct_response_of_prov(OCEntityHandlerRequest *eh_request)
                return NULL;
        }
        // Requested interface is Link list interface
-       if (!eh_request->query || (eh_request->query && !strncmp(eh_request->query, "", strlen(""))) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_LL)) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_DEFAULT))) {
+       if (!eh_request->query || (eh_request->query && !strncmp(eh_request->query, "", strlen(eh_request->query))) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_LL)) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_DEFAULT))) {
                if ((arrayPayload[childResCnt] = make_rep_payload(g_wifi_resource.handle, &eh_request->devAddr)) == NULL) {
                        THINGS_LOG_ERROR(THINGS_ERROR, ES_RH_TAG, "It's failed making payload of wifi_resource_s-Representation");
                        goto GOTO_FAILED;