--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define TTD_SOFTAP_SSID "tizen-things-service"
+
+int ttd_softap_init(void);
+void ttd_softap_fini(void);
+
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <softap.h>
+#include <stdlib.h>
+
+#include "ttd-log.h"
+#include "ttd-softap.h"
+#include "ttd-config.h"
+
+softap_h sa = NULL;
+
+static void __enabler_connection_changed_cb(softap_client_h client, bool opened, void *user_data)
+{
+ _D("Enabler connection is %s", opened ? "Opened" : "Closed");
+
+ if (opened) {
+ /* Start Transfer with Enabler */
+ } else {
+ /* Can we assume that Enabler disconnect when communication is finished? */
+ }
+}
+
+static void __enabled_cb(softap_error_e result, bool is_requested, void *user_data)
+{
+ _D("SoftAP is enabled: %d", result);
+}
+
+int ttd_softap_init(void)
+{
+ if (softap_create(&sa) != SOFTAP_ERROR_NONE) {
+ _E("Failed to create SoftAP");
+ return -1;
+ }
+
+ if (softap_set_ssid(sa, TTD_SOFTAP_SSID) != SOFTAP_ERROR_NONE) {
+ _E("Failed to set ssid");
+ return -1;
+ }
+
+ if (softap_set_ssid_visibility(sa, 1) != SOFTAP_ERROR_NONE) {
+ _E("Failed to set ssid visibility");
+ return -1;
+ }
+
+ if (softap_set_security_type(sa, 1) != SOFTAP_ERROR_NONE) {
+ _E("Failed to set security type");
+ return -1;
+ }
+
+ if (softap_set_passphrase(sa, "aaaaaaaa") != SOFTAP_ERROR_NONE) {
+ _E("Failed to set pass passphrase");
+ return -1;
+ }
+
+ if (softap_set_enabled_cb(sa, __enabled_cb, NULL) != SOFTAP_ERROR_NONE) {
+ _E("Failed to set enabled_cb");
+ return -1;
+ }
+
+ if (softap_enable(sa) != SOFTAP_ERROR_NONE) {
+ _E("Failed to enable SoftAP");
+ return -1;
+ }
+
+ if (softap_set_client_connection_state_changed_cb(sa, __enabler_connection_changed_cb, NULL) != SOFTAP_ERROR_NONE) {
+ _E("Failed to set client connection changed callback for Enabler");
+ return -1;
+ }
+
+ return 0;
+}
+
+void ttd_softap_fini(void)
+{
+ softap_unset_client_connection_state_changed_cb(sa);
+
+ softap_disable(sa);
+
+ softap_destroy(sa);
+
+ sa = NULL;
+}