WebSockets.h Help: "WStype_t"

waaizK
Posts: 1
Joined: Wed Apr 10, 2024 9:26 pm

WebSockets.h Help: "WStype_t"

Postby waaizK » Wed Apr 10, 2024 9:30 pm

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!

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: WebSockets.h Help: "WStype_t"

Postby lbernstone » Thu Apr 11, 2024 2:07 am

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.

Who is online

Users browsing this forum: No registered users and 57 guests