Skip to content

Commit

Permalink
js script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt committed Dec 21, 2024
1 parent 20e4efc commit 0669ce9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions built-in-webpages/setup/build_setup/stringConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ module.exports = {
var dataLength = data.byteLength;
console.log('actualDataLength: ' + dataLength);

var resultString = '#define SETUP_HTML_SIZE ';
resultString += dataLength + '\n'
resultString += 'static const unsigned char SETUP_HTML[] PROGMEM = {\n ';
var resultString = '/* C-file generated by minify.js script */\n\n';
resultString += 'static const unsigned char _acsetup_min_htm[' + dataLength +' + 1] PROGMEM = {\n';
resultString += stringConverter.convert(dataLength, 1, true, 16, data);
resultString += '\n};';
return resultString;
Expand Down
4 changes: 2 additions & 2 deletions src/AsyncFsWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ bool AsyncFsWebServer::startCaptivePortal(const char* ssid, const char* pass, co
void AsyncFsWebServer::handleWebSocket(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t * data, size_t len) {
switch (type) {
case WS_EVT_CONNECT:
client->printf("{\"Websocket connected\": true, \"clients\": %"PRIu32"}", client->id());
client->printf("{\"Websocket connected\": true, \"clients\": %" PRIu32 "}", client->id());
break;
case WS_EVT_DISCONNECT:
client->printf("{\"Websocket connected\": false, \"clients\": 0}");
Expand All @@ -167,7 +167,7 @@ void AsyncFsWebServer::handleWebSocket(AsyncWebSocket * server, AsyncWebSocketCl
String msg = "";
if(info->final && info->index == 0 && info->len == len){
//the whole message is in a single frame and we got all of it's data
Serial.printf("ws[%s][%"PRIu32"] %s-message[%llu]: ", server->url(), client->id(), (info->opcode == WS_TEXT)?"text":"binary", info->len);
Serial.printf("ws[%s][%" PRIu32 "] %s-message[%llu]: ", server->url(), client->id(), (info->opcode == WS_TEXT)?"text":"binary", info->len);
if (info->opcode == WS_TEXT){
for(size_t i=0; i < info->len; i++) {
msg += (char) data[i];
Expand Down

0 comments on commit 0669ce9

Please sign in to comment.