#include "tethering.h"
-#define INPUT_BUF_LEN 32
+#define INPUT_BUF_LEN 128
#define DISABLE_REASON_TEXT_LEN 64
#define COMMON_STR_BUF_LEN 32
g_print("\nTo get Wi-Fi tethering setting, enter 'get wifi_setting'");
g_print("\nTo set Wi-Fi tethering setting, enter '[set_security_type | set_visibility] [0 | 1]'");
g_print("\nTo set Wi-Fi tethering passphrase, enter 'set_passphrase [passphrase]'");
+ g_print("\nTo set Wi-Fi tethering SSID, enter 'set_ssid [SSID]'");
g_print("\nTo quit, enter 'quit'\n> ");
return;
}
#else
GError *err = NULL;
+ GIOStatus ios;
- g_io_channel_read_chars(channel, buf, INPUT_BUF_LEN, &read, &err);
+ ios = g_io_channel_read_chars(channel, buf, INPUT_BUF_LEN, &read, &err);
if (err != NULL) {
- g_print("g_io_channel_read is failed : %s\n", err->message);
+ g_print("g_io_channel_read_chars is failed : %s\n",
+ err->message);
g_error_free(err);
return FALSE;
+ } else if (ios != G_IO_STATUS_NORMAL) {
+ g_print("g_io_channel_read_chars is failed : %d\n", ios);
+ return FALSE;
}
#endif
goto DONE;
}
+ if (!strcmp(cmd, "set_ssid")) {
+ error = tethering_wifi_set_ssid(th, param);
+ if (error != TETHERING_ERROR_NONE)
+ g_print("tethering_wifi_set_ssid is failed [0x%X]\n",
+ error);
+ goto DONE;
+ }
+
/* One parameter(type) */
if (!strcmp(param, "USB"))
type = TETHERING_TYPE_USB;
__connection_state_changed_cb, __security_type_changed_cb,
__ssid_visibility_changed_cb, __passphrase_changed_cb};
+#if !GLIB_CHECK_VERSION(2,35,0)
g_type_init();
+#endif
/* Create tethering handle */
ret = tethering_create(&th);