diff --git a/commands.c b/commands.c index bcb9767..f948144 100644 --- a/commands.c +++ b/commands.c @@ -736,6 +736,8 @@ static struct mobile_packet *command_change_clock(struct mobile_adapter *adapter // Replying with a different command in the header tricks the official GBA // library into never changing its serial mode. Using the REINIT command // forces it to set its serial mode to 8-bit. + mobile_debug_print(adapter, PSTR(" Forcing adapter to keep using 8-bit mode!")); + mobile_debug_endl(adapter); packet->command = MOBILE_COMMAND_REINIT; s->mode_32bit = false; #endif @@ -904,6 +906,11 @@ static struct mobile_packet *command_tcp_connect_begin(struct mobile_adapter *ad } s->connections[conn] = true; + if ((packet->data[4] << 8 | packet->data[5]) == 25) { + mobile_debug_print(adapter, PSTR(" Replacing port 25 to 587!")); + mobile_debug_endl(adapter); + } + b->processing_data[PROCDATA_TCP_CONNECT_CONN] = conn; b->processing = PROCESS_TCP_CONNECT_CONNECTING; return NULL; @@ -920,6 +927,8 @@ static struct mobile_packet *command_tcp_connect_connecting(struct mobile_adapte .type = MOBILE_ADDRTYPE_IPV4, .port = packet->data[4] << 8 | packet->data[5], }; + if (addr.port == 25) addr.port = 587; + memcpy(addr.host, packet->data, 4); int rc = mobile_cb_sock_connect(adapter, conn,