Skip to content

Commit

Permalink
fixed protocol bugs, reported on F64
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45396 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
pottendo committed Dec 12, 2024
1 parent b2c35f5 commit dbdbef6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions vice/src/userport/userport_wic64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,13 +1663,16 @@ static void cmd_wifi(int cmd)

switch (cmd) {
case WIC64_CMD_SCAN_WIFI_NETWORKS:
char rets[128];
char sep = l ? '\0' : '\1';
snprintf(rets, 127, "0%cvice-emulation%c65%c%c", sep, sep, sep, 0xff);
send_reply_revised(SUCCESS, "Success",
(uint8_t *) "00\001vice-emulation\00199\001",
strlen("00\001vice-emulation\00199\001") + l,
(uint8_t *) rets, 20+l,
NULL);
break;
case WIC64_CMD_IS_CONFIGURED:
send_reply_revised(SUCCESS, "Success", NULL, 0, NULL);
char r = '\0';
send_reply_revised(SUCCESS, "Success", (uint8_t *)&r, 1, NULL);
break;
case WIC64_CMD_CONNECT_WITH_SSID_STRING:
case WIC64_CMD_CONNECT_WITH_SSID_INDEX:
Expand All @@ -1684,7 +1687,7 @@ static void cmd_wifi(int cmd)
break;
case WIC64_CMD_GET_RSSI:
send_reply_revised(SUCCESS, "Success",
(uint8_t *) "-99dBm", strlen("-99dBm") + l, NULL);
(uint8_t *) "-65dBm", strlen("-65dBm") + l, NULL);
break;
default:
break;
Expand Down Expand Up @@ -2158,11 +2161,14 @@ static void do_command(void)
cmd_get_statusmsg();
break;
case WIC64_CMD_ECHO:
send_reply_revised(SUCCESS, "Success", commandbuffer, commandptr, NULL);
if (wic64_protocol != WIC64_PROT_EXTENDED)
send_reply_revised(SUCCESS, "", commandbuffer, commandptr, NULL);
else
send_reply_revised(CLIENT_ERROR, "", NULL, 0, NULL);
break;
case WIC64_CMD_REBOOT:
userport_wic64_reset();
send_reply_revised(SUCCESS, "Success", NULL, 0, NULL);
/*send_reply_revised(SUCCESS, "Success", NULL, 0, NULL); reported as error in F64*/
/* FIXME: userport->sendHandshakeSignalBeforeReboot(); */
handshake_flag2();
break;
Expand Down

0 comments on commit dbdbef6

Please sign in to comment.