Rework JerryScript transport layer. (#2421)

Introducing jerryscript-debugger-transport.h interface, which allows
chaining multiple protocols (e.g. tcp and websocket).

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-07-12 18:21:08 +02:00
committed by yichoi
parent 43aae199ce
commit 857ba99694
15 changed files with 1229 additions and 421 deletions
+2 -28
View File
@@ -16,39 +16,13 @@
#ifndef DEBUGGER_WS_H
#define DEBUGGER_WS_H
#include "ecma-globals.h"
#include "jerryscript-debugger-transport.h"
#ifdef JERRY_DEBUGGER
/* JerryScript debugger protocol is a simplified version of RFC-6455 (WebSockets). */
/**
* Maximum number of bytes transmitted or received.
*/
#define JERRY_DEBUGGER_MAX_BUFFER_SIZE 128
/**
* Incoming message: next message of string data.
*/
typedef struct
{
uint8_t type; /**< type of the message */
} jerry_debugger_receive_uint8_data_part_t;
/**
* Byte data for evaluating expressions and receiving client source.
*/
typedef struct
{
uint32_t uint8_size; /**< total size of the client source */
uint32_t uint8_offset; /**< current offset in the client source */
} jerry_debugger_uint8_data_t;
bool jerry_debugger_accept_connection (void);
void jerry_debugger_close_connection (void);
bool jerry_debugger_send (size_t data_size);
bool jerry_debugger_receive (jerry_debugger_uint8_data_t **message_data_p);
bool jerry_debugger_ws_create (void);
void jerry_debugger_compute_sha1 (const uint8_t *input1, size_t input1_len,
const uint8_t *input2, size_t input2_len,