Port of TI's CC3100 Websock camera demo. Using FreeRTOS, mbedTLS, also parts of Arducam for cams ov5642 and 0v2640. Can also use MT9D111. Work in progress. Be warned some parts maybe a bit flacky. This is for Seeed Arch max only, for an M3, see the demo for CM3 using the 0v5642 aducam mini.
WebSockHandler
Functions | |
int | Payloadlength (struct HttpBlob *pData, UINT8 iter) |
Parses the payload length to the header if it is more than 125 ie (16 bit/64 bit) | |
int | WSCore_DataRecv (UINT16 uConnection, struct HttpBlob *pData) |
Parse entire websocket packet and forward only the payload to the user API. The API can handle packets received in parts. It is blocked till entire packet is received. | |
int | WSCore_DataSend (UINT16 uConnection, struct HttpBlob PayLoad, UINT8 Opcode) |
Sends data to a websocket client. | |
void | WSStatusString (UINT32 WS_Status, struct HttpBlob *status) |
Returns status string according to status code - CHANGE. |
Function Documentation
int Payloadlength | ( | struct HttpBlob * | pData, |
UINT8 | iter | ||
) |
Parses the payload length to the header if it is more than 125 ie (16 bit/64 bit)
- Parameters:
-
[in] *pData Pointer to the websocket packet [in] iter iter = 2 for 16 bit length iter = 8 for 64 bit length
- Returns:
- size of the payload
Definition at line 86 of file WebSockHandler.cpp.
int WSCore_DataRecv | ( | UINT16 | uConnection, |
struct HttpBlob * | pData | ||
) |
Parse entire websocket packet and forward only the payload to the user API. The API can handle packets received in parts. It is blocked till entire packet is received.
- Parameters:
-
[in] uConnection Connection number on HTTP server. The library supports 4. [in] *pData Pointer to the HttpBlob structure that holds the data.
- Returns:
- 1 - If packet was successfully received, parsed and sent to the user API 0 - Error
If header supports extension, send back error Send error frame : TODO
Definition at line 104 of file WebSockHandler.cpp.
int WSCore_DataSend | ( | UINT16 | uConnection, |
struct HttpBlob | PayLoad, | ||
UINT8 | Opcode | ||
) |
Sends data to a websocket client.
Sends data to a websocket client . *.
- Parameters:
-
[in] uConnection Connection number on HTTP server. [in] PayLoad Structure holding the payload data and the size of the data [in] Opcode User provides data type (text/binary/ping/pong/close).
- Returns:
- 1 - If packet was successfully received, parsed and sent to the user API 0 - Error
Is this the final packet?
Add opcode to the header
Add this byte to the sendpacket
Reset byte
Mask bit is always set to 0 from server to client
PayloadLen field
Add this byte to the sendpacket
If payload length is more than 125 bytes, we need 16 bits to represent it.
Reset byte
Definition at line 291 of file WebSockHandler.cpp.
void WSStatusString | ( | UINT32 | WS_Status, |
struct HttpBlob * | status | ||
) |
Returns status string according to status code - CHANGE.
Returns status string according to status code.
Definition at line 386 of file WebSockHandler.cpp.
Generated on Tue Jul 12 2022 22:22:39 by 1.7.2