10000 How to enable debug mode for web sockets? · Issue #60 · Links2004/arduinoWebSockets · GitHub
[go: up one dir, main page]

Skip to content
How to enable debug mode for web sockets? #60
Closed
@michaelphipps

Description

@michaelphipps

Greetings!

I am trying to work out a disconnection issue I am having. Almost all of your responses involve enabling debug and pointing to this link:
https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSockets.h#L40

I think enabling debug mode should involve making the WebSockets.h file look something like this:

#include <Arduino.h>

#define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ )

#ifndef DEBUG_WEBSOCKETS
#define DEBUG_WEBSOCKETS(...) 
#define NODEBUG_WEBSOCKETS
#endif
...

Unfortunately when I do this, my sketch fails to compile resulting in the following error message:

In file included from /home/michaelphipps/arduino-1.6.7/libraries/arduinoWebSockets-master/src/WebSocketsServer.cpp:25:0:
/home/michaelphipps/arduino-1.6.7/libraries/arduinoWebSockets-master/src/WebSocketsServer.cpp: In member function 'void WebSocketsServer::handleHeader(WSclient_t*, String*)':
/home/michaelphipps/arduino-1.6.7/libraries/arduinoWebSockets-master/src/WebSockets.h:30:54: error: cannot pass objects of non-trivially-copyable type 'class String' through '...'
 #define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ )
                                                      ^
/home/michaelphipps/arduino-1.6.7/libraries/arduinoWebSockets-master/src/WebSocketsServer.cpp:630:9: note: in expansion of macro 'DEBUG_WEBSOCKETS'
         DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader]  - base64Authorization: %s\n", client->num, client->base64Authorization);
         ^
exit status 1
Error compiling.

I should note have also tried
#define DEBUG_WEBSOCKETS(...) Serial.printf( __VA_ARGS__ )
with no luck.

What's going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0