Page 1 of 1

WebSockets.h Help: "WStype_t"

Posted: Wed Apr 10, 2024 9:30 pm
by waaizK
Hi, I was trying to create a webserver/websockets project, following this video for the general structure: https://www.youtube.com/watch?v=15X0WvG ... MoThunderz

I was writing my function to handle websocketevents (in the video, he starts this around 19:44), which looked like this:

void webSocketEvent(byte num, WStype_t type, uint8_t * payload, size_t length) {
do stuff }

However, I'm getting a compilation error: 'WStype_t' has not been declared.
I have no idea how to fix this - I can see WStype_t declared in the WebSocket.h header file, and I don't have to redeclare it in my code. How do I fix this??
Thank you!

Re: WebSockets.h Help: "WStype_t"

Posted: Thu Apr 11, 2024 2:07 am
by lbernstone
You need to include the header file in your code (`#include <WebSocket.h>`)
If you need more help, please provide code and a link for the library you are using.