diff --git a/source/gecko/wifi_gecko.c b/source/gecko/wifi_gecko.c index b73dd32b..51bfaf30 100644 --- a/source/gecko/wifi_gecko.c +++ b/source/gecko/wifi_gecko.c @@ -31,6 +31,9 @@ #include #include "wifi_gecko.h" +// set to use TCP socket instead of UDP +#define WIFI_GECKO_USE_TCP (0) + static int connection = -1; static int init = 0; @@ -63,13 +66,21 @@ int WifiGecko_Connect() if (dest_ip == NULL || dest_port == 0) return connection; - connection = net_socket(AF_INET, SOCK_STREAM, IPPROTO_IP); +#if WIFI_GECKO_USE_TCP + connection = net_socket(PF_INET, SOCK_STREAM, 0); +#else + connection = net_socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); +#endif if (connection < 0) return connection; struct sockaddr_in connect_addr; memset(&connect_addr, 0, sizeof(connect_addr)); - connect_addr.sin_family = AF_INET; +#if WIFI_GECKO_USE_TCP + connect_addr.sin_family = PF_INET; +#else + connect_addr.sin_family = AF_INET; +#endif connect_addr.sin_port = htons(dest_port); inet_aton(dest_ip, &connect_addr.sin_addr); @@ -132,4 +143,4 @@ void wifi_printf(const char * format, ...) va_end(va); SAFE_FREE(tmp); -} \ No newline at end of file +} diff --git a/source/gecko/wifi_gecko.h b/source/gecko/wifi_gecko.h index 5cb8048e..264d50d7 100644 --- a/source/gecko/wifi_gecko.h +++ b/source/gecko/wifi_gecko.h @@ -42,4 +42,4 @@ void wifi_printf(const char * format, ...); } #endif -#endif \ No newline at end of file +#endif diff --git a/tools/windows/WifiGeckoReader/WifiGeckoReader.exe b/tools/windows/WifiGeckoReader/WifiGeckoReader.exe new file mode 100644 index 00000000..40853d30 Binary files /dev/null and b/tools/windows/WifiGeckoReader/WifiGeckoReader.exe differ diff --git a/tools/windows/WifiGeckoReader/readme.txt b/tools/windows/WifiGeckoReader/readme.txt new file mode 100644 index 00000000..9b225904 --- /dev/null +++ b/tools/windows/WifiGeckoReader/readme.txt @@ -0,0 +1,15 @@ +WifiGeckoReader allows you to view the gecko debug messages over the wifi connection. Only use this when debugging. There is no need to use it regularly. + +It uses UDP port 4405. + +To make it work with wiiflow, edit or add the following wiiflow.ini lines: +[GENERAL] +async_network=yes +wifi_gecko=yes +wifi_gecko_port=4405 + +wifi_gecko_ip=your.computer.ipAddr.here +eg: +wifi_gecko_ip=192.168.0.199 + +Once this is done, run WifiGeckoReader, then run wiiflow. You should start seeing debug messages.