Websocket arduino library

cWebsocket is lightweight websocket server library written in C. This library include functions for easy creating websocket server. It implements websocket protocol draft 76.

With this library you can get realtime properties from your microcontroller only with browser!

This library provides following functions:

/**
 *
 * @param input_frame .in. pointer to input frame
 * @param input_len .in. length of input frame
 * @param hs .out. clear with nullhandshake() handshake struct
 * @return [WS_INCOMPLETE_FRAME, WS_ERROR_FRAME, WS_OPENING_FRAME]
 */
enum ws_frame_type ws_parse_handshake(const uint8_t *input_frame, size_t input_len,
      struct handshake *hs);

/**
 *
 * @param hs .in. filled handshake struct
 * @param out_frame .out. pointer to out frame buffer
 * @param out_len .in.out. length of out frame buffer. Return length of out frame
 * @return WS_OPENING_FRAME
 */
enum ws_frame_type ws_get_handshake_answer(const struct handshake *hs,
      uint8_t *out_frame, size_t *out_len);

/**
 *
 * @param data .in. pointer to input data array
 * @param data_len .in. length of data array
 * @param out_frame .out. pointer to out frame buffer
 * @param out_len .in.out. length of out frame buffer. Return length of out frame
 * @param frame_type .in. [WS_TEXT_FRAME] frame type to build
 * @return [WS_ERROR_FRAME, WS_TEXT_FRAME]
 */
enum ws_frame_type ws_make_frame(const uint8_t *data, size_t data_len,
      uint8_t *out_frame, size_t *out_len, enum ws_frame_type frame_type);

/**
 *
 * @param input_frame .in. pointer to input frame
 * @param input_len .in. length of input frame
 * @param out_data_ptr .out. pointer to extracted data in input frame
 * @param out_len .in.out. length of out data buffer. Return length of extracted data
 * @return [WS_INCOMPLETE_FRAME, WS_TEXT_FRAME, WS_CLOSING_FRAME, WS_ERROR_FRAME]
 */
enum ws_frame_type ws_parse_input_frame(const uint8_t *input_frame, size_t input_len,
      uint8_t **out_data_ptr, size_t *out_len);

You can download example arduino library with examples in downloads section at Google Code Archive - Long-term storage for Google Code Project Hosting.