Oryx CycloneTCP WebSocket Support for HTTP Server

613 Views Asked by At

I've started to evaluate Oryx Embedded CycloneTCP library, and able to run HTTP server / DHCP client with CubeMX config tools and STM32CubeIDE for custom STM32H7 board.

However, I did not get how to configure WebSocket support for HTTP Server. So I need some help / sample / demo code for it.

1

There are 1 best solutions below

0
Mario Gliewe On

Its an a bit older question, but nonetheless...

https://gricad-gitlab.univ-grenoble-alpes.fr/Projets-INFO4/20-21/05/STM32F7_CycloneServer

shows how to implement a simple websocket->CAN Bus gateway.

Take a look at CycloneServer/Core/Src/main.c

In httpServerRequestCallback() the http connection gets upgraded to a websocket connection.

Received frames are processed in a seperate task (clientTask()).

sendCANBusToClient() shows how to send messages to connected websockets.