# Makefile.tizen
# for TIZEN-maru board
-
-$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/tizen/src/genmsg:$(SRC_PATH)/tizen/distrib/protobuf:$(SRC_PATH)/hw:$(SRC_PATH)/tizen/src:$(SRC_PATH)/tizen/src/hw:$(SRC_PATH)/tizen/src/skin:$(SRC_PATH)/tizen/src/SDL_gfx)
+$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/tizen/src:$(SRC_PATH)/tizen/src/hw:$(SRC_PATH)/tizen/src/skin:$(SRC_PATH)/tizen/src/SDL_gfx)
QEMU_CFLAGS += -I$(SRC_PATH)/hw -I$(SRC_PATH)/tizen/src
-QEMU_CFLAGS += -I$(SRC_PATH)/tizen/src/genmsg
-QEMU_CFLAGS += -I$(SRC_PATH)/tizen/distrib/protobuf
QEMU_CFLAGS += -I$(SRC_PATH)/tizen/distrib/libav/$(ARCH)/include
LDFLAGS += -L$(SRC_PATH)/tizen/distrib/libav/$(ARCH)/lib
QEMU_CFLAGS += $(SDL_CFLAGS)
# debug channel
obj-y += debug_ch.o
-# ecs
-obj-y += ecs_msg.o ecs.o ecs-json-streamer.o qmp_handler.o ecs_sensor.o
-
-# ecs msg
-obj-y += ecs.pb-c.o protobuf-c.o
-
+# ECS
+include $(SRC_PATH)/tizen/src/ecs/Makefile.tizen
# maru hardware
include $(SRC_PATH)/tizen/src/Makefile.tizen.$(TARGET_BASE_ARCH)
# guest server
obj-y += guest_server.o
-# base64
-obj-y += base64.o
-
-
#ifndef CONFIG_DARWIN
###########################################################
## opengl library for i386
+++ /dev/null
-#include "base64.h"
-
-/*------ Base64 Encoding Table ------*/
-static const char MimeBase64[] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '0', '1', '2', '3',
- '4', '5', '6', '7', '8', '9', '+', '/'
-};
-
-/*------ Base64 Decoding Table ------*/
-static int DecodeMimeBase64[256] = {
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00-0F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10-1F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20-2F */
- 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30-3F */
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
- 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50-5F */
- -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
- 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70-7F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-8F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90-9F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-AF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0-BF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0-CF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0-DF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-EF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 /* F0-FF */
- };
-
-int base64_decode(const char *text, unsigned char *dst, int numBytes )
-{
- const char* cp;
- int space_idx = 0, phase;
- int d, prev_d = 0;
- unsigned char c;
-
- space_idx = 0;
- phase = 0;
-
- for ( cp = text; *cp != '\0'; ++cp ) {
- d = DecodeMimeBase64[(int) *cp];
- if ( d != -1 ) {
- switch ( phase ) {
- case 0:
- ++phase;
- break;
- case 1:
- c = ( ( prev_d << 2 ) | ( ( d & 0x30 ) >> 4 ) );
- if ( space_idx < numBytes )
- dst[space_idx++] = c;
- ++phase;
- break;
- case 2:
- c = ( ( ( prev_d & 0xf ) << 4 ) | ( ( d & 0x3c ) >> 2 ) );
- if ( space_idx < numBytes )
- dst[space_idx++] = c;
- ++phase;
- break;
- case 3:
- c = ( ( ( prev_d & 0x03 ) << 6 ) | d );
- if ( space_idx < numBytes )
- dst[space_idx++] = c;
- phase = 0;
- break;
- }
- prev_d = d;
- }
- }
-
- return space_idx;
-
-}
-
-int base64_encode(const char *text, int numBytes, char **encodedText)
-{
- unsigned char input[3] = {0,0,0};
- unsigned char output[4] = {0,0,0,0};
- int index, i, j, size;
- char *p, *plen;
-
- plen = text + numBytes - 1;
- size = (4 * (numBytes / 3)) + (numBytes % 3? 4 : 0) + 1;
- (*encodedText) = malloc(size);
- j = 0;
-
- for (i = 0, p = text;p <= plen; i++, p++) {
- index = i % 3;
- input[index] = *p;
-
- if (index == 2 || p == plen) {
- output[0] = ((input[0] & 0xFC) >> 2);
- output[1] = ((input[0] & 0x3) << 4) | ((input[1] & 0xF0) >> 4);
- output[2] = ((input[1] & 0xF) << 2) | ((input[2] & 0xC0) >> 6);
- output[3] = (input[2] & 0x3F);
-
- (*encodedText)[j++] = MimeBase64[output[0]];
- (*encodedText)[j++] = MimeBase64[output[1]];
- (*encodedText)[j++] = index == 0? '=' : MimeBase64[output[2]];
- (*encodedText)[j++] = index < 2? '=' : MimeBase64[output[3]];
-
- input[0] = input[1] = input[2] = 0;
- }
- }
-
- (*encodedText)[j] = '\0';
-
- return 0;
-}
+++ /dev/null
-#include "maru_common.h"
-
-int base64_decode(const char *text, unsigned char *dst, int numBytes);
-int base64_encode(const char *text, int numBytes, char **encodedText);
+++ /dev/null
-/*
- * JSON streaming support
- *
- * Copyright IBM, Corp. 2009
- *
- * Authors:
- * Anthony Liguori <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/json-lexer.h"
-#include "qemu-common.h"
-#include "ecs-json-streamer.h"
-
-#define MAX_TOKEN_SIZE (64ULL << 20)
-#define MAX_NESTING (1ULL << 10)
-
-static void ecs_json_message_process_token(JSONLexer *lexer, QString *token, JSONTokenType type, int x, int y)
-{
- JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer);
- QDict *dict;
-
- if (type == JSON_OPERATOR) {
- switch (qstring_get_str(token)[0]) {
- case '{':
- parser->brace_count++;
- break;
- case '}':
- parser->brace_count--;
- break;
- case '[':
- parser->bracket_count++;
- break;
- case ']':
- parser->bracket_count--;
- break;
- default:
- break;
- }
- }
-
- dict = qdict_new();
- qdict_put(dict, "type", qint_from_int(type));
- QINCREF(token);
- qdict_put(dict, "token", token);
- qdict_put(dict, "x", qint_from_int(x));
- qdict_put(dict, "y", qint_from_int(y));
-
- parser->token_size += token->length;
-
- qlist_append(parser->tokens, dict);
-
- if (type == JSON_ERROR) {
- goto out_emit_bad;
- } else if (parser->brace_count < 0 ||
- parser->bracket_count < 0 ||
- (parser->brace_count == 0 &&
- parser->bracket_count == 0)) {
- goto out_emit;
- } else if (parser->token_size > MAX_TOKEN_SIZE ||
- parser->bracket_count > MAX_NESTING ||
- parser->brace_count > MAX_NESTING) {
- /* Security consideration, we limit total memory allocated per object
- * and the maximum recursion depth that a message can force.
- */
- goto out_emit;
- }
-
- return;
-
-out_emit_bad:
- /* clear out token list and tell the parser to emit and error
- * indication by passing it a NULL list
- */
- QDECREF(parser->tokens);
- parser->tokens = NULL;
-out_emit:
- /* send current list of tokens to parser and reset tokenizer */
- parser->brace_count = 0;
- parser->bracket_count = 0;
- parser->emit(parser, parser->tokens, parser->opaque);
- if (parser->tokens) {
- QDECREF(parser->tokens);
- }
- parser->tokens = qlist_new();
- parser->token_size = 0;
-}
-
-void ecs_json_message_parser_init(JSONMessageParser *parser,
- void (*func)(JSONMessageParser *, QList *, void *), void *opaque)
-{
- parser->emit = func;
- parser->brace_count = 0;
- parser->bracket_count = 0;
- parser->tokens = qlist_new();
- parser->token_size = 0;
- parser->opaque = opaque;
-
- json_lexer_init(&parser->lexer, ecs_json_message_process_token);
-}
-
-int ecs_json_message_parser_feed(JSONMessageParser *parser,
- const char *buffer, size_t size)
-{
- return json_lexer_feed(&parser->lexer, buffer, size);
-}
-
-int ecs_json_message_parser_flush(JSONMessageParser *parser)
-{
- return json_lexer_flush(&parser->lexer);
-}
-
-void ecs_json_message_parser_destroy(JSONMessageParser *parser)
-{
- json_lexer_destroy(&parser->lexer);
- QDECREF(parser->tokens);
-}
+++ /dev/null
-/*
- * JSON streaming support
- *
- * Copyright IBM, Corp. 2009
- *
- * Authors:
- * Anthony Liguori <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-
-#ifndef QEMU_JSON_STREAMER_H
-#define QEMU_JSON_STREAMER_H
-
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/json-lexer.h"
-
-typedef struct JSONMessageParser
-{
- void (*emit)(struct JSONMessageParser *parser, QList *tokens, void *);
- JSONLexer lexer;
- int brace_count;
- int bracket_count;
- QList *tokens;
- uint64_t token_size;
- void *opaque;
-} JSONMessageParser;
-
-void ecs_json_message_parser_init(JSONMessageParser *parser,
- void (*func)(JSONMessageParser *, QList *, void *), void *opaque);
-
-int ecs_json_message_parser_feed(JSONMessageParser *parser,
- const char *buffer, size_t size);
-
-int ecs_json_message_parser_flush(JSONMessageParser *parser);
-
-void ecs_json_message_parser_destroy(JSONMessageParser *parser);
-
-#endif
+++ /dev/null
-#include <stdbool.h>
-#include <pthread.h>
-#include <stdlib.h>
-
-#include "hw/qdev.h"
-#include "net/net.h"
-#include "ui/console.h"
-#include "migration/migration.h"
-#include "qapi/qmp/qjson.h"
-#include "qapi/qmp/json-parser.h"
-#include "qapi/qmp/qint.h"
-#include "ui/qemu-spice.h"
-
-#include "qemu-common.h"
-#include "qemu/queue.h"
-#include "qemu/sockets.h"
-#include "qemu/option.h"
-#include "qemu/timer.h"
-#include "qemu/main-loop.h"
-#include "sysemu/char.h"
-#include "qmp-commands.h"
-#include "config.h"
-
-#include "sdb.h"
-#include "ecs.h"
-#include "hw/maru_virtio_evdi.h"
-#include "hw/maru_virtio_sensor.h"
-#include "hw/maru_virtio_nfc.h"
-
-#include "base64.h"
-#include "genmsg/ecs.pb-c.h"
-
-#define DEBUG
-
-typedef struct mon_fd_t mon_fd_t;
-struct mon_fd_t {
- char *name;
- int fd;
- QLIST_ENTRY(mon_fd_t)
- next;
-};
-
-#ifndef min
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif
-
-typedef struct mon_cmd_t {
- const char *name;
- const char *args_type;
- const char *params;
- const char *help;
- void (*user_print)(Monitor *mon, const QObject *data);
- union {
- void (*info)(Monitor *mon);
- void (*cmd)(Monitor *mon, const QDict *qdict);
- int (*cmd_new)(Monitor *mon, const QDict *params, QObject **ret_data);
- int (*cmd_async)(Monitor *mon, const QDict *params,
- MonitorCompletion *cb, void *opaque);
- } mhandler;
- int flags;
-} mon_cmd_t;
-
-static QTAILQ_HEAD(ECS_ClientHead, ECS_Client)
-clients = QTAILQ_HEAD_INITIALIZER(clients);
-
-static ECS_State *current_ecs;
-
-static int port;
-static int port_setting = -1;
-
-static pthread_mutex_t mutex_clilist = PTHREAD_MUTEX_INITIALIZER;
-
-static inline void start_logging(void) {
- char path[256];
- char* home;
-
- home = getenv(LOG_HOME);
- sprintf(path, "%s%s", home, LOG_PATH);
-
-#ifdef _WIN32
- FILE* fnul;
- FILE* flog;
-
- fnul = fopen("NUL", "rt");
- if (fnul != NULL)
- stdin[0] = fnul[0];
-
- flog = fopen(path, "at");
- if (flog == NULL)
- flog = fnul;
-
- setvbuf(flog, NULL, _IONBF, 0);
-
- stdout[0] = flog[0];
- stderr[0] = flog[0];
-#else
- int fd = open("/dev/null", O_RDONLY);
- dup2(fd, 0);
-
- fd = open(path, O_WRONLY | O_CREAT | O_APPEND, 0640);
- if (fd < 0) {
- fd = open("/dev/null", O_WRONLY);
- }
- dup2(fd, 1);
- dup2(fd, 2);
-#endif
-}
-
-static int ecs_write(int fd, const uint8_t *buf, int len);
-
-static void ecs_client_close(ECS_Client* clii) {
- pthread_mutex_lock(&mutex_clilist);
-
- if (0 <= clii->client_fd) {
- LOG("ecs client closed with fd: %d", clii->client_fd);
- closesocket(clii->client_fd);
-#ifndef CONFIG_LINUX
- FD_CLR(clii->client_fd, &clii->cs->reads);
-#endif
- clii->client_fd = -1;
- }
-
- QTAILQ_REMOVE(&clients, clii, next);
- if (NULL != clii) {
- g_free(clii);
- }
-
- pthread_mutex_unlock(&mutex_clilist);
-}
-
-bool send_to_all_client(const char* data, const int len) {
- pthread_mutex_lock(&mutex_clilist);
-
- ECS_Client *clii;
-
- QTAILQ_FOREACH(clii, &clients, next)
- {
- send_to_client(clii->client_fd, data, len);
- }
- pthread_mutex_unlock(&mutex_clilist);
-
- return true;
-}
-
-
-void send_to_client(int fd, const char* data, const int len)
-{
- ecs_write(fd, (const uint8_t*) data, len);
-}
-
-/*
-void send_to_client(int fd, const char* data, const int len)
-{
- char c;
- uint8_t outbuf[OUT_BUF_SIZE];
- int outbuf_index = 0;
-
- for (;;) {
- c = *data++;
- if (outbuf_index >= OUT_BUF_SIZE - 1) {
- LOG("string is too long: overflow buffer.");
- return;
- }
-#ifndef _WIN32
- if (c == '\n') {
- outbuf[outbuf_index++] = '\r';
- }
-#endif
- outbuf[outbuf_index++] = c;
- if (c == '\0') {
- break;
- }
- }
- ecs_write(fd, outbuf, outbuf_index);
-}
-*/
-
-#define QMP_ACCEPT_UNKNOWNS 1
-static void ecs_monitor_flush(ECS_Client *clii, Monitor *mon) {
- int ret;
-
- if (clii && 0 < clii->client_fd && mon && mon->outbuf_index != 0) {
- ret = ecs_write(clii->client_fd, mon->outbuf, mon->outbuf_index);
- mon->outbuf_index = 0;
- if (ret < -1) {
- ecs_client_close(clii);
- }
- }
-}
-
-static void ecs_monitor_puts(ECS_Client *clii, Monitor *mon, const char *str) {
- char c;
-
- if (!clii || !mon) {
- return;
- }
-
- for (;;) {
- c = *str++;
- if (c == '\0')
- break;
-#ifndef _WIN32
- if (c == '\n')
- mon->outbuf[mon->outbuf_index++] = '\r';
-#endif
- mon->outbuf[mon->outbuf_index++] = c;
- if (mon->outbuf_index >= (sizeof(mon->outbuf) - 1) || c == '\n')
- ecs_monitor_flush(clii, mon);
- }
-}
-
-void ecs_vprintf(const char *type, const char *fmt, va_list ap) {
- char buf[READ_BUF_LEN];
- ECS_Client *clii;
-
- QTAILQ_FOREACH(clii, &clients, next)
- {
- vsnprintf(buf, sizeof(buf), fmt, ap);
- ecs_monitor_puts(clii, clii->cs->mon, buf);
- }
-}
-
-void ecs_printf(const char* type, const char *fmt, ...) {
- va_list ap;
- va_start(ap, fmt);
- ecs_vprintf(type, fmt, ap);
- va_end(ap);
-}
-
-static inline int monitor_has_error(const Monitor *mon) {
- return mon->error != NULL;
-}
-
-static QDict *build_qmp_error_dict(const QError *err) {
- QObject *obj = qobject_from_jsonf(
- "{ 'error': { 'class': %s, 'desc': %p } }",
- ErrorClass_lookup[err->err_class], qerror_human(err));
-
- return qobject_to_qdict(obj);
-}
-
-static void ecs_json_emitter(ECS_Client *clii, const QObject *data) {
- QString *json;
-
- json = qobject_to_json(data);
-
- assert(json != NULL);
-
- qstring_append_chr(json, '\n');
- ecs_monitor_puts(clii, clii->cs->mon, qstring_get_str(json));
-
- QDECREF(json);
-}
-
-static void ecs_protocol_emitter(ECS_Client *clii, const char* type,
- QObject *data) {
- QDict *qmp;
- QObject *obj;
-
- LOG("ecs_protocol_emitter called.");
- trace_monitor_protocol_emitter(clii->cs->mon);
-
- if (!monitor_has_error(clii->cs->mon)) {
- /* success response */
- qmp = qdict_new();
- if (data) {
- qobject_incref(data);
- qdict_put_obj(qmp, "return", data);
- } else {
- /* return an empty QDict by default */
- qdict_put(qmp, "return", qdict_new());
- }
-
- if (type == NULL) {
- obj = qobject_from_jsonf("%s", "unknown");
- } else {
- obj = qobject_from_jsonf("%s", type);
- }
- qdict_put_obj(qmp, "type", obj);
-
- } else {
- /* error response */
- qmp = build_qmp_error_dict(clii->cs->mon->error);
- QDECREF(clii->cs->mon->error);
- clii->cs->mon->error = NULL;
- }
-
- ecs_json_emitter(clii, QOBJECT(qmp));
- QDECREF(qmp);
-}
-
-static void qmp_monitor_complete(void *opaque, QObject *ret_data) {
- // ecs_protocol_emitter(opaque, ret_data);
-}
-
-static int qmp_async_cmd_handler(ECS_Client *clii, const mon_cmd_t *cmd,
- const QDict *params) {
- return cmd->mhandler.cmd_async(clii->cs->mon, params, qmp_monitor_complete,
- clii);
-}
-
-static void qmp_call_cmd(ECS_Client *clii, Monitor *mon, const char* type,
- const mon_cmd_t *cmd, const QDict *params) {
- int ret;
- QObject *data = NULL;
-
- ret = cmd->mhandler.cmd_new(mon, params, &data);
- if (ret && !monitor_has_error(mon)) {
- qerror_report(QERR_UNDEFINED_ERROR);
- }
- ecs_protocol_emitter(clii, type, data);
- qobject_decref(data);
-}
-
-static inline bool handler_is_async(const mon_cmd_t *cmd) {
- return cmd->flags & MONITOR_CMD_ASYNC;
-}
-
-/*
-static void monitor_user_noop(Monitor *mon, const QObject *data) {
-}
-
-static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data) {
- //vga_hw_screen_dump(qdict_get_str(qdict, "filename"));
- return 0;
-}
-
-static int client_migrate_info(Monitor *mon, const QDict *qdict,
- MonitorCompletion cb, void *opaque) {
- return 0;
-}
-
-static int add_graphics_client(Monitor *mon, const QDict *qdict,
- QObject **ret_data) {
- return 0;
-}
-
-static int do_qmp_capabilities(Monitor *mon, const QDict *params,
- QObject **ret_data) {
- return 0;
-}
-*/
-
-static const mon_cmd_t qmp_cmds[] = {
-//#include "qmp-commands-old.h"
- { /* NULL */}, };
-
-static int check_mandatory_args(const QDict *cmd_args, const QDict *client_args,
- int *flags) {
- const QDictEntry *ent;
-
- for (ent = qdict_first(cmd_args); ent; ent = qdict_next(cmd_args, ent)) {
- const char *cmd_arg_name = qdict_entry_key(ent);
- QString *type = qobject_to_qstring(qdict_entry_value(ent));
- assert(type != NULL);
-
- if (qstring_get_str(type)[0] == 'O') {
- assert((*flags & QMP_ACCEPT_UNKNOWNS) == 0);
- *flags |= QMP_ACCEPT_UNKNOWNS;
- } else if (qstring_get_str(type)[0] != '-'
- && qstring_get_str(type)[1] != '?'
- && !qdict_haskey(client_args, cmd_arg_name)) {
- qerror_report(QERR_MISSING_PARAMETER, cmd_arg_name);
- return -1;
- }
- }
-
- return 0;
-}
-
-static int check_client_args_type(const QDict *client_args,
- const QDict *cmd_args, int flags) {
- const QDictEntry *ent;
-
- for (ent = qdict_first(client_args); ent;
- ent = qdict_next(client_args, ent)) {
- QObject *obj;
- QString *arg_type;
- const QObject *client_arg = qdict_entry_value(ent);
- const char *client_arg_name = qdict_entry_key(ent);
-
- obj = qdict_get(cmd_args, client_arg_name);
- if (!obj) {
- if (flags & QMP_ACCEPT_UNKNOWNS) {
- continue;
- }
- qerror_report(QERR_INVALID_PARAMETER, client_arg_name);
- return -1;
- }
-
- arg_type = qobject_to_qstring(obj);
- assert(arg_type != NULL);
-
- switch (qstring_get_str(arg_type)[0]) {
- case 'F':
- case 'B':
- case 's':
- if (qobject_type(client_arg) != QTYPE_QSTRING) {
- qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
- "string");
- return -1;
- }
- break;
- case 'i':
- case 'l':
- case 'M':
- case 'o':
- if (qobject_type(client_arg) != QTYPE_QINT) {
- qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
- "int");
- return -1;
- }
- break;
- case 'T':
- if (qobject_type(client_arg) != QTYPE_QINT
- && qobject_type(client_arg) != QTYPE_QFLOAT) {
- qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
- "number");
- return -1;
- }
- break;
- case 'b':
- case '-':
- if (qobject_type(client_arg) != QTYPE_QBOOL) {
- qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
- "bool");
- return -1;
- }
- break;
- case 'O':
- assert(flags & QMP_ACCEPT_UNKNOWNS);
- break;
- case 'q':
- break;
- case '/':
- case '.':
- default:
- abort();
- }
- }
-
- return 0;
-}
-
-static QDict *qdict_from_args_type(const char *args_type) {
- int i;
- QDict *qdict;
- QString *key, *type, *cur_qs;
-
- assert(args_type != NULL);
-
- qdict = qdict_new();
-
- if (args_type == NULL || args_type[0] == '\0') {
- goto out;
- }
-
- key = qstring_new();
- type = qstring_new();
-
- cur_qs = key;
-
- for (i = 0;; i++) {
- switch (args_type[i]) {
- case ',':
- case '\0':
- qdict_put(qdict, qstring_get_str(key), type);
- QDECREF(key);
- if (args_type[i] == '\0') {
- goto out;
- }
- type = qstring_new();
- cur_qs = key = qstring_new();
- break;
- case ':':
- cur_qs = type;
- break;
- default:
- qstring_append_chr(cur_qs, args_type[i]);
- break;
- }
- }
-
- out: return qdict;
-}
-
-static int qmp_check_client_args(const mon_cmd_t *cmd, QDict *client_args) {
- int flags, err;
- QDict *cmd_args;
-
- cmd_args = qdict_from_args_type(cmd->args_type);
-
- flags = 0;
- err = check_mandatory_args(cmd_args, client_args, &flags);
- if (err) {
- goto out;
- }
-
- err = check_client_args_type(client_args, cmd_args, flags);
-
- out:
- QDECREF(cmd_args);
- return err;
-}
-
-static QDict *qmp_check_input_obj(QObject *input_obj) {
- const QDictEntry *ent;
- int has_exec_key = 0;
- QDict *input_dict;
-
- if (qobject_type(input_obj) != QTYPE_QDICT) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
- return NULL;
- }
-
- input_dict = qobject_to_qdict(input_obj);
-
- for (ent = qdict_first(input_dict); ent;
- ent = qdict_next(input_dict, ent)) {
- const char *arg_name = qdict_entry_key(ent);
- const QObject *arg_obj = qdict_entry_value(ent);
-
- if (!strcmp(arg_name, "execute")) {
- if (qobject_type(arg_obj) != QTYPE_QSTRING) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "execute",
- "string");
- return NULL;
- }
- has_exec_key = 1;
- } else if (!strcmp(arg_name, "arguments")) {
- if (qobject_type(arg_obj) != QTYPE_QDICT) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "arguments",
- "object");
- return NULL;
- }
- } else if (!strcmp(arg_name, "id")) {
- } else {
- qerror_report(QERR_QMP_EXTRA_MEMBER, arg_name);
- return NULL;
- }
- }
-
- if (!has_exec_key) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "execute");
- return NULL;
- }
-
- return input_dict;
-}
-
-static int compare_cmd(const char *name, const char *list) {
- const char *p, *pstart;
- int len;
- len = strlen(name);
- p = list;
- for (;;) {
- pstart = p;
- p = strchr(p, '|');
- if (!p)
- p = pstart + strlen(pstart);
- if ((p - pstart) == len && !memcmp(pstart, name, len))
- return 1;
- if (*p == '\0')
- break;
- p++;
- }
- return 0;
-}
-
-static const mon_cmd_t *search_dispatch_table(const mon_cmd_t *disp_table,
- const char *cmdname) {
- const mon_cmd_t *cmd;
-
- for (cmd = disp_table; cmd->name != NULL; cmd++) {
- if (compare_cmd(cmdname, cmd->name)) {
- return cmd;
- }
- }
-
- return NULL;
-}
-
-static const mon_cmd_t *qmp_find_cmd(const char *cmdname) {
- return search_dispatch_table(qmp_cmds, cmdname);
-}
-
-static void handle_qmp_command(ECS_Client *clii, const char* type_name,
- QObject *obj) {
- int err;
- const mon_cmd_t *cmd;
- const char *cmd_name;
- QDict *input = NULL;
- QDict *args = NULL;
-
- input = qmp_check_input_obj(obj);
- if (!input) {
- qobject_decref(obj);
- goto err_out;
- }
-
- cmd_name = qdict_get_str(input, "execute");
-
- LOG("execute exists.");
- cmd = qmp_find_cmd(cmd_name);
- if (!cmd) {
- qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_out;
- }
-
- obj = qdict_get(input, "arguments");
- if (!obj) {
- args = qdict_new();
- } else {
- args = qobject_to_qdict(obj);
- QINCREF(args);
- }
-
- err = qmp_check_client_args(cmd, args);
- if (err < 0) {
- goto err_out;
- }
-
- LOG("argument exists.");
- if (handler_is_async(cmd)) {
- err = qmp_async_cmd_handler(clii, cmd, args);
- if (err) {
- goto err_out;
- }
- } else {
- LOG("qmp_call_cmd called client fd: %d", clii->client_fd);
- qmp_call_cmd(clii, clii->cs->mon, type_name, cmd, args);
- }
-
- goto out;
-
- err_out: ecs_protocol_emitter(clii, type_name, NULL);
- out:
- QDECREF(input);
- QDECREF(args);
-
-}
-
-static int check_key(QObject *input_obj, const char *key) {
- const QDictEntry *ent;
- QDict *input_dict;
-
- if (qobject_type(input_obj) != QTYPE_QDICT) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
- return -1;
- }
-
- input_dict = qobject_to_qdict(input_obj);
-
- for (ent = qdict_first(input_dict); ent;
- ent = qdict_next(input_dict, ent)) {
- const char *arg_name = qdict_entry_key(ent);
- if (!strcmp(arg_name, key)) {
- return 1;
- }
- }
-
- return 0;
-}
-
-static QObject* get_data_object(QObject *input_obj) {
- const QDictEntry *ent;
- QDict *input_dict;
-
- if (qobject_type(input_obj) != QTYPE_QDICT) {
- qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
- return NULL;
- }
-
- input_dict = qobject_to_qdict(input_obj);
-
- for (ent = qdict_first(input_dict); ent;
- ent = qdict_next(input_dict, ent)) {
- const char *arg_name = qdict_entry_key(ent);
- QObject *arg_obj = qdict_entry_value(ent);
- if (!strcmp(arg_name, COMMANDS_DATA)) {
- return arg_obj;
- }
- }
-
- return NULL;
-}
-
-void read_val_short(const char* data, unsigned short* ret_val) {
- memcpy(ret_val, data, sizeof(unsigned short));
-}
-
-void read_val_char(const char* data, unsigned char* ret_val) {
- memcpy(ret_val, data, sizeof(unsigned char));
-}
-
-void read_val_str(const char* data, char* ret_val, int len) {
- memcpy(ret_val, data, len);
-}
-
-void ecs_make_header(QDict* obj, type_length length, type_group group,
- type_action action) {
- qdict_put(obj, "length", qint_from_int((int64_t )length));
- qdict_put(obj, "group", qint_from_int((int64_t )group));
- qdict_put(obj, "action", qint_from_int((int64_t )action));
-}
-
-
-
-bool ntf_to_control(const char* data, const int len) {
- return true;
-}
-
-bool ntf_to_monitor(const char* data, const int len) {
- return true;
-}
-
-static int ijcount = 0;
-
-
-static bool injector_command_proc(ECS_Client *clii, QObject *obj) {
- QDict* header = qdict_get_qdict(qobject_to_qdict(obj), "header");
-
- char cmd[10];
- memset(cmd, 0, 10);
- strcpy(cmd, qdict_get_str(header, "cat"));
- type_length length = (type_length) qdict_get_int(header, "length");
- type_group group = (type_action) (qdict_get_int(header, "group") & 0xff);
- type_action action = (type_group) (qdict_get_int(header, "action") & 0xff);
-
- // get data
- const char* data = qdict_get_str(qobject_to_qdict(obj), COMMANDS_DATA);
- LOG(">> count= %d", ++ijcount);
- LOG(">> print len = %d, data\" %s\"", strlen(data), data);
- LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
- action, group);
-
- int datalen = strlen(data);
- int sndlen = datalen + 14;
- char* sndbuf = (char*) malloc(sndlen + 1);
- if (!sndbuf) {
- return false;
- }
-
- memset(sndbuf, 0, sndlen + 1);
-
- if(!strcmp(cmd, "telephony")) {
- unsigned char *decoded_data = (unsigned char*)malloc(datalen + 1);
-
- if (!decoded_data) {
- return false;
- }
-
- int len_b64 = base64_decode(data, decoded_data, datalen);
- length = (type_length)len_b64;
- sndlen = length + 14;
- memcpy(sndbuf, cmd, 10);
- memcpy(sndbuf + 10, &length, 2);
- memcpy(sndbuf + 12, &group, 1);
- memcpy(sndbuf + 13, &action, 1);
- memcpy(sndbuf + 14, decoded_data, length);
-
- send_to_evdi(route_ij, sndbuf, sndlen);
-
- free(sndbuf);
-
- if(decoded_data != NULL) {
- free(decoded_data);
- }
-
- } else {
-
- // set data
- memcpy(sndbuf, cmd, 10);
- memcpy(sndbuf + 10, &length, 2);
- memcpy(sndbuf + 12, &group, 1);
- memcpy(sndbuf + 13, &action, 1);
- memcpy(sndbuf + 14, data, datalen);
-
- send_to_evdi(route_ij, sndbuf, sndlen);
-
- free(sndbuf);
- }
-
- return true;
-}
-
-
-static bool device_command_proc(ECS_Client *clii, QObject *obj) {
- QDict* header = qdict_get_qdict(qobject_to_qdict(obj), "header");
-
- char cmd[10];
- memset(cmd, 0, 10);
- strcpy(cmd, qdict_get_str(header, "cat"));
- type_length length = (type_length) qdict_get_int(header, "length");
- type_group group = (type_action) (qdict_get_int(header, "group") & 0xff);
- type_action action = (type_group) (qdict_get_int(header, "action") & 0xff);
-
- // get data
- const char* data = qdict_get_str(qobject_to_qdict(obj), COMMANDS_DATA);
- LOG(">> count= %d", ++ijcount);
- LOG(">> print len = %d, data\" %s\"", strlen(data), data);
- LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
- action, group);
-
- if (!strncmp(cmd, MSG_TYPE_SENSOR, 6)) {
- if (group == MSG_GROUP_STATUS) {
- if (action ==MSG_ACTION_ACCEL) {
- get_sensor_accel();
- } else if (action == MSG_ACTION_GYRO) {
- get_sensor_gyro();
- } else if (action == MSG_ACTION_MAG) {
- get_sensor_mag();
- } else if (action == MSG_ACTION_LIGHT) {
- get_sensor_light();
- } else if (action == MSG_ACTION_PROXI) {
- get_sensor_proxi();
- }
- } else {
- set_sensor_data(length, data);
- }
- }
- else if (!strncmp(cmd, MSG_TYPE_NFC, 3)) {
- if (group == MSG_GROUP_STATUS) {
- send_to_nfc(request_nfc_get, data, length);
- }
- else
- {
- send_to_nfc(request_nfc_set, data, length);
- }
- }
-
-
- return true;
-}
-
-static void handle_ecs_command(JSONMessageParser *parser, QList *tokens,
- void *opaque) {
- const char *type_name;
- int def_target = 0;
-// int def_data = 0;
- QObject *obj;
- ECS_Client *clii = opaque;
-
- if (NULL == clii) {
- LOG("ClientInfo is null.");
- return;
- }
-
-#ifdef DEBUG
- LOG("Handle ecs command.");
-#endif
-
- obj = json_parser_parse(tokens, NULL);
- if (!obj) {
- qerror_report(QERR_JSON_PARSING);
- ecs_protocol_emitter(clii, NULL, NULL);
- return;
- }
-
- def_target = check_key(obj, COMMANDS_TYPE);
-#ifdef DEBUG
- LOG("check_key(COMMAND_TYPE): %d", def_target);
-#endif
- if (0 > def_target) {
- LOG("def_target failed.");
- return;
- } else if (0 == def_target) {
-#ifdef DEBUG
- LOG("call handle_qmp_command");
-#endif
- handle_qmp_command(clii, NULL, obj);
- return;
- }
-
- type_name = qdict_get_str(qobject_to_qdict(obj), COMMANDS_TYPE);
-
- /*
- def_data = check_key(obj, COMMANDS_DATA);
- if (0 > def_data) {
- LOG("json format error: data.");
- return;
- } else if (0 == def_data) {
- LOG("data key is not found.");
- return;
- }
- */
-
- if (!strcmp(type_name, TYPE_DATA_SELF)) {
- LOG("set client fd %d keep alive 0", clii->client_fd);
- clii->keep_alive = 0;
- return;
- } else if (!strcmp(type_name, COMMAND_TYPE_INJECTOR)) {
- injector_command_proc(clii, obj);
- } else if (!strcmp(type_name, COMMAND_TYPE_CONTROL)) {
- //control_command_proc(clii, obj);
- } else if (!strcmp(type_name, COMMAND_TYPE_MONITOR)) {
- handle_qmp_command(clii, type_name, get_data_object(obj));
- } else if (!strcmp(type_name, COMMAND_TYPE_DEVICE)) {
- device_command_proc(clii, obj);
- } else if (!strcmp(type_name, ECS_MSG_STARTINFO_REQ)) {
- //ecs_startinfo_req(clii);
- } else {
- LOG("handler not found");
- }
-}
-
-static Monitor *monitor_create(void) {
- Monitor *mon;
-
- mon = g_malloc0(sizeof(*mon));
- if (NULL == mon) {
- LOG("monitor allocation failed.");
- return NULL;
- }
- memset(mon, 0, sizeof(*mon));
-
- return mon;
-}
-
-static int device_initialize(void) {
- // currently nothing to do with it.
- return 1;
-}
-
-static void ecs_close(ECS_State *cs) {
- ECS_Client *clii;
- LOG("### Good bye! ECS ###");
-
- if (0 <= cs->listen_fd) {
- closesocket(cs->listen_fd);
- }
-
- if (NULL != cs->mon) {
- g_free(cs->mon);
- }
-
- if (NULL != cs->alive_timer) {
- qemu_del_timer(cs->alive_timer);
- cs->alive_timer = NULL;
- }
-
- pthread_mutex_lock(&mutex_clilist);
-
- QTAILQ_FOREACH(clii, &clients, next)
- {
- ecs_client_close(clii);
- }
- pthread_mutex_unlock(&mutex_clilist);
-
- //TODO: device close
-
- if (NULL != cs) {
- g_free(cs);
- }
-}
-
-static int ecs_write(int fd, const uint8_t *buf, int len) {
- LOG("write buflen : %d, buf : %s", len, buf);
- if (fd < 0) {
- return -1;
- }
-
- return send_all(fd, buf, len);
-}
-
-#ifndef _WIN32
-static ssize_t ecs_recv(int fd, char *buf, size_t len) {
- struct msghdr msg = { NULL, };
- struct iovec iov[1];
- union {
- struct cmsghdr cmsg;
- char control[CMSG_SPACE(sizeof(int))];
- } msg_control;
- int flags = 0;
-
- iov[0].iov_base = buf;
- iov[0].iov_len = len;
-
- msg.msg_iov = iov;
- msg.msg_iovlen = 1;
- msg.msg_control = &msg_control;
- msg.msg_controllen = sizeof(msg_control);
-
-#ifdef MSG_CMSG_CLOEXEC
- flags |= MSG_CMSG_CLOEXEC;
-#endif
- return recvmsg(fd, &msg, flags);
-}
-
-#else
-static ssize_t ecs_recv(int fd, char *buf, size_t len)
-{
- return qemu_recv(fd, buf, len, 0);
-}
-#endif
-
-
-static void reset_sbuf(sbuf* sbuf)
-{
- memset(sbuf->_buf, 0, 4096);
- sbuf->_use = 0;
- sbuf->_netlen = 0;
-}
-
-static void ecs_read(ECS_Client *cli) {
-
- int read = 0;
- int to_read_bytes = 0;
-
-#ifndef __WIN32
- if (ioctl(cli->client_fd, FIONREAD, &to_read_bytes) < 0)
- {
- LOG("ioctl failed");
- return;
- }
-#else
- unsigned long to_read_bytes_long = 0;
- if (ioctlsocket(cli->client_fd, FIONREAD, &to_read_bytes_long) < 0)
- {
- LOG("ioctl failed");
- return;
- }
- to_read_bytes = (int)to_read_bytes_long;
-#endif
-
- if (to_read_bytes == 0) {
- LOG("ioctl FIONREAD: 0\n");
- goto fail;
- }
-
- if (cli->sbuf._netlen == 0)
- {
- if (to_read_bytes < 4)
- {
- //LOG("insufficient data size to read");
- return;
- }
-
- long payloadsize = 0;
- read = ecs_recv(cli->client_fd, (char*) &payloadsize, 4);
-
- if (read < 4)
- {
- LOG("insufficient header size");
- goto fail;
- }
-
- payloadsize = ntohl(payloadsize);
-
- cli->sbuf._netlen = payloadsize;
-
- LOG("payload size: %ld\n", payloadsize);
-
- to_read_bytes -= 4;
- }
-
- if (to_read_bytes == 0)
- return;
-
-
- to_read_bytes = min(to_read_bytes, cli->sbuf._netlen - cli->sbuf._use);
-
- read = ecs_recv(cli->client_fd, (char*)(cli->sbuf._buf + cli->sbuf._use), to_read_bytes);
- if (read == 0)
- goto fail;
-
-
- cli->sbuf._use += read;
-
-
- if (cli->sbuf._netlen == cli->sbuf._use)
- {
- handle_protobuf_msg(cli, (char*)cli->sbuf._buf, cli->sbuf._use);
- reset_sbuf(&cli->sbuf);
- }
-
- return;
-fail:
- ecs_client_close(cli);
-}
-
-#ifdef CONFIG_LINUX
-static void epoll_cli_add(ECS_State *cs, int fd) {
- struct epoll_event events;
-
- /* event control set for read event */
- events.events = EPOLLIN;
- events.data.fd = fd;
-
- if (epoll_ctl(cs->epoll_fd, EPOLL_CTL_ADD, fd, &events) < 0) {
- LOG("Epoll control fails.in epoll_cli_add.");
- }
-}
-#endif
-
-static ECS_Client *ecs_find_client(int fd) {
- ECS_Client *clii;
-
- QTAILQ_FOREACH(clii, &clients, next)
- {
- if (clii->client_fd == fd)
- return clii;
- }
- return NULL;
-}
-
-static int ecs_add_client(ECS_State *cs, int fd) {
-
- ECS_Client *clii = g_malloc0(sizeof(ECS_Client));
- if (NULL == clii) {
- LOG("ECS_Client allocation failed.");
- return -1;
- }
-
- reset_sbuf(&clii->sbuf);
-
- qemu_set_nonblock(fd);
-
- clii->client_fd = fd;
- clii->cs = cs;
- ecs_json_message_parser_init(&clii->parser, handle_ecs_command, clii);
-
-#ifdef CONFIG_LINUX
- epoll_cli_add(cs, fd);
-#else
- FD_SET(fd, &cs->reads);
-#endif
-
- pthread_mutex_lock(&mutex_clilist);
-
- QTAILQ_INSERT_TAIL(&clients, clii, next);
-
- LOG("Add an ecs client. fd: %d", fd);
-
- pthread_mutex_unlock(&mutex_clilist);
-
- return 0;
-}
-
-static void ecs_accept(ECS_State *cs) {
- struct sockaddr_in saddr;
-#ifndef _WIN32
- struct sockaddr_un uaddr;
-#endif
- struct sockaddr *addr;
- socklen_t len;
- int fd;
-
- for (;;) {
-#ifndef _WIN32
- if (cs->is_unix) {
- len = sizeof(uaddr);
- addr = (struct sockaddr *) &uaddr;
- } else
-#endif
- {
- len = sizeof(saddr);
- addr = (struct sockaddr *) &saddr;
- }
- fd = qemu_accept(cs->listen_fd, addr, &len);
- if (0 > fd && EINTR != errno) {
- return;
- } else if (0 <= fd) {
- break;
- }
- }
- if (0 > ecs_add_client(cs, fd)) {
- LOG("failed to add client.");
- }
-}
-
-#ifdef CONFIG_LINUX
-static void epoll_init(ECS_State *cs) {
- struct epoll_event events;
-
- cs->epoll_fd = epoll_create(MAX_EVENTS);
- if (cs->epoll_fd < 0) {
- closesocket(cs->listen_fd);
- }
-
- events.events = EPOLLIN;
- events.data.fd = cs->listen_fd;
-
- if (epoll_ctl(cs->epoll_fd, EPOLL_CTL_ADD, cs->listen_fd, &events) < 0) {
- close(cs->listen_fd);
- close(cs->epoll_fd);
- }
-}
-#endif
-
-static void alive_checker(void *opaque) {
- /*
- ECS_State *cs = opaque;
- ECS_Client *clii;
- QObject *obj;
-
- obj = qobject_from_jsonf("{\"type\":\"self\"}");
-
- if (NULL != current_ecs && !current_ecs->ecs_running) {
- return;
- }
-
- QTAILQ_FOREACH(clii, &clients, next)
- {
- if (1 == clii->keep_alive) {
- LOG("get client fd %d - keep alive fail", clii->client_fd);
- //ecs_client_close(clii);
- continue;
- }
- LOG("set client fd %d - keep alive 1", clii->client_fd);
- clii->keep_alive = 1;
- ecs_json_emitter(clii, obj);
- }
-
- qemu_mod_timer(cs->alive_timer,
- qemu_get_clock_ns(vm_clock) + get_ticks_per_sec() * TIMER_ALIVE_S);
- */
-}
-
-static int socket_initialize(ECS_State *cs, QemuOpts *opts) {
- int fd = -1;
- Error *local_err = NULL;
-
- fd = inet_listen_opts(opts, 0, &local_err);
- if (0 > fd || error_is_set(&local_err)) {
- qerror_report_err(local_err);
- error_free(local_err);
- return -1;
- }
-
- LOG("Listen fd is %d", fd);
-
- qemu_set_nonblock(fd);
-
- cs->listen_fd = fd;
-
-#ifdef CONFIG_LINUX
- epoll_init(cs);
-#else
- FD_ZERO(&cs->reads);
- FD_SET(fd, &cs->reads);
-#endif
-
- cs->alive_timer = qemu_new_timer_ns(vm_clock, alive_checker, cs);
-
- qemu_mod_timer(cs->alive_timer,
- qemu_get_clock_ns(vm_clock) + get_ticks_per_sec() * TIMER_ALIVE_S);
-
- return 0;
-}
-
-#ifdef CONFIG_LINUX
-static int ecs_loop(ECS_State *cs) {
- int i, nfds;
-
- nfds = epoll_wait(cs->epoll_fd, cs->events, MAX_EVENTS, 100);
- if (0 == nfds) {
- return 0;
- }
-
- if (0 > nfds) {
- LOG("epoll wait error:%d.", nfds);
- return -1;
- }
-
- for (i = 0; i < nfds; i++) {
- if (cs->events[i].data.fd == cs->listen_fd) {
- ecs_accept(cs);
- continue;
- }
- ecs_read(ecs_find_client(cs->events[i].data.fd));
- }
-
- return 0;
-}
-#elif defined(CONFIG_WIN32)
-static int ecs_loop(ECS_State *cs)
-{
- int index = 0;
- TIMEVAL timeout;
- fd_set temps = cs->reads;
-
- timeout.tv_sec = 5;
- timeout.tv_usec = 0;
-
- if (select(0, &temps, 0, 0, &timeout) < 0) {
- LOG("select error.");
- return -1;
- }
-
- for (index = 0; index < cs->reads.fd_count; index++) {
- if (FD_ISSET(cs->reads.fd_array[index], &temps)) {
- if (cs->reads.fd_array[index] == cs->listen_fd) {
- ecs_accept(cs);
- continue;
- }
-
- ecs_read(ecs_find_client(cs->reads.fd_array[index]));
- }
- }
-
- return 0;
-}
-#elif defined(CONFIG_DARWIN)
-static int ecs_loop(ECS_State *cs)
-{
- int index = 0;
- int res = 0;
- struct timeval timeout;
- fd_set temps = cs->reads;
-
- timeout.tv_sec = 5;
- timeout.tv_usec = 0;
-
- if ((res = select(MAX_FD_NUM + 1, &temps, NULL, NULL, &timeout)) < 0) {
- LOG("select failed..");
- return -1;
- }
-
- for (index = 0; index < MAX_FD_NUM; index ++) {
- if (FD_ISSET(index, &temps)) {
- if (index == cs->listen_fd) {
- ecs_accept(cs);
- continue;
- }
-
- ecs_read(ecs_find_client(index));
- }
- }
-
- return 0;
-}
-
-#endif
-
-static int check_port(int port) {
- int try = EMULATOR_SERVER_NUM;
-
- for (; try > 0; try--) {
- if (0 <= check_port_bind_listen(port)) {
- LOG("Listening port is %d", port);
- return port;
- }
- port++;
- }
- return -1;
-}
-
-int get_ecs_port(void) {
- if (port_setting < 0) {
- LOG("ecs port is not determined yet.");
- return 0;
- }
- return port;
-}
-
-static void* ecs_initialize(void* args) {
- int ret = 1;
- int index;
- ECS_State *cs = NULL;
- QemuOpts *opts = NULL;
- Error *local_err = NULL;
- Monitor* mon = NULL;
- char host_port[16];
-
- start_logging();
- LOG("ecs starts initializing.");
-
- opts = qemu_opts_create(qemu_find_opts(ECS_OPTS_NAME), ECS_OPTS_NAME, 1, &local_err);
- if (error_is_set(&local_err)) {
- qerror_report_err(local_err);
- error_free(local_err);
- return NULL;
- }
-
- port = check_port(HOST_LISTEN_PORT);
- if (port < 0) {
- LOG("None of port is available.");
- return NULL;
- }
-
- qemu_opt_set(opts, "host", HOST_LISTEN_ADDR);
-
- cs = g_malloc0(sizeof(ECS_State));
- if (NULL == cs) {
- LOG("ECS_State allocation failed.");
- return NULL;
- }
-
- for (index = 0; index < EMULATOR_SERVER_NUM; index ++) {
- sprintf(host_port, "%d", port);
- qemu_opt_set(opts, "port", host_port);
- ret = socket_initialize(cs, opts);
- if (0 > ret) {
- LOG("socket initialization failed with port %d. next trial", port);
- port ++;
-
- port = check_port(port);
- if (port < 0) {
- LOG("None of port is available.");
- break;
- }
- } else {
- break;
- }
- }
-
- if (0 > ret) {
- LOG("socket resource is full.");
- port = -1;
- return NULL;
- }
-
- port_setting = 1;
-
- mon = monitor_create();
- if (NULL == mon) {
- LOG("monitor initialization failed.");
- ecs_close(cs);
- return NULL;
- }
-
- cs->mon = mon;
- ret = device_initialize();
- if (0 > ret) {
- LOG("device initialization failed.");
- ecs_close(cs);
- return NULL;
- }
-
- current_ecs = cs;
- cs->ecs_running = 1;
-
- LOG("ecs_loop entered.");
- while (cs->ecs_running) {
- ret = ecs_loop(cs);
- if (0 > ret) {
- ecs_close(cs);
- break;
- }
- }
-
- return (void*) ret;
-}
-
-int stop_ecs(void) {
- LOG("ecs is closing.");
- if (NULL != current_ecs) {
- current_ecs->ecs_running = 0;
- ecs_close(current_ecs);
- }
-
- pthread_mutex_destroy(&mutex_clilist);
-
- return 0;
-}
-
-int start_ecs(void) {
- pthread_t thread_id;
-
- if (0 != pthread_create(&thread_id, NULL, ecs_initialize, NULL)) {
- LOG("pthread creation failed.");
- return -1;
- }
- return 0;
-}
-
-bool handle_protobuf_msg(ECS_Client* cli, char* data, int len)
-{
- ECS__Master* master = ecs__master__unpack(NULL, (size_t)len, (const uint8_t*)data);
- if (!master)
- return false;
-
- if (master->type == ECS__MASTER__TYPE__START_REQ)
- {
- ECS__StartReq* msg = master->start_req;
- if (!msg)
- goto fail;
- msgproc_start_req(cli, msg);
- }
- if (master->type == ECS__MASTER__TYPE__INJECTOR_REQ)
- {
- ECS__InjectorReq* msg = master->injector_req;
- if (!msg)
- goto fail;
- msgproc_injector_req(cli, msg);
- }
- else if (master->type == ECS__MASTER__TYPE__CONTROL_MSG)
- {
- ECS__ControlMsg* msg = master->control_msg;
- if (!msg)
- goto fail;
- msgproc_control_msg(cli, msg);
- }
- else if (master->type == ECS__MASTER__TYPE__MONITOR_REQ)
- {
- ECS__MonitorReq* msg = master->monitor_req;
- if (!msg)
- goto fail;
- msgproc_monitor_req(cli, msg);
- }
- else if (master->type == ECS__MASTER__TYPE__DEVICE_REQ)
- {
- ECS__DeviceReq* msg = master->device_req;
- if (!msg)
- goto fail;
- msgproc_device_req(cli, msg);
- }
- else if (master->type == ECS__MASTER__TYPE__SCREEN_DUMP_REQ)
- {
- ECS__ScreenDumpReq* msg = master->screen_dump_req;
- if (!msg)
- goto fail;
- msgproc_screen_dump_req(cli, msg);
- }
- ecs__master__free_unpacked(master, NULL);
- return true;
-fail:
- LOG("invalid message type");
- ecs__master__free_unpacked(master, NULL);
- return false;
-}
-
+++ /dev/null
-#ifndef __ECS_H__
-#define __ECS_H__
-
-#ifdef CONFIG_LINUX
-#include <sys/epoll.h>
-#endif
-
-#include "qapi/qmp/qerror.h"
-#include "qemu-common.h"
-#include "ecs-json-streamer.h"
-#include "genmsg/ecs.pb-c.h"
-
-#define ECS_DEBUG 1
-
-#ifdef ECS_DEBUG
-#define LOG(fmt, arg...) \
- do { \
- fprintf(stdout,"[%s-%s:%d] "fmt"\n", __TIME__, __FUNCTION__, __LINE__, ##arg); \
- } while (0)
-#else
-#define LOG(fmt, arg...)
-#endif
-
-#ifndef _WIN32
-#define LOG_HOME "HOME"
-#define LOG_PATH "/tizen-sdk-data/emulator/vms/ecs.log"
-#else
-#define LOG_HOME "LOCALAPPDATA"
-#define LOG_PATH "\\tizen-sdk-data\\emulator\\vms\\ecs.log"
-#endif
-
-#define ECS_OPTS_NAME "ecs"
-#define HOST_LISTEN_ADDR "127.0.0.1"
-#define HOST_LISTEN_PORT 27000
-#define EMULATOR_SERVER_NUM 10
-
-#define COMMANDS_TYPE "type"
-#define COMMANDS_DATA "data"
-
-
-#define COMMAND_TYPE_INJECTOR "injector"
-#define COMMAND_TYPE_CONTROL "control"
-#define COMMAND_TYPE_MONITOR "monitor"
-#define COMMAND_TYPE_DEVICE "device"
-
-#define ECS_MSG_STARTINFO_REQ "startinfo_req"
-#define ECS_MSG_STARTINFO_ANS "startinfo_ans"
-
-#define MSG_TYPE_SENSOR "sensor"
-#define MSG_TYPE_NFC "nfc"
-
-#define MSG_GROUP_STATUS 15
-
-#define MSG_ACTION_ACCEL 110
-#define MSG_ACTION_GYRO 111
-#define MSG_ACTION_MAG 112
-#define MSG_ACTION_LIGHT 113
-#define MSG_ACTION_PROXI 114
-
-#define TIMER_ALIVE_S 60
-#define TYPE_DATA_SELF "self"
-
-enum sensor_level {
- level_accel = 1,
- level_proxi = 2,
- level_light = 3,
- level_gyro = 4,
- level_geo = 5,
- level_tilt = 12,
- level_magnetic = 13
-};
-
-typedef unsigned short type_length;
-typedef unsigned char type_group;
-typedef unsigned char type_action;
-
-#define OUT_BUF_SIZE 4096
-#define READ_BUF_LEN 4096
-
-
-
-typedef struct sbuf
-{
- int _netlen;
- int _use;
- char _buf[4096];
-}sbuf;
-
-
-struct Monitor {
- int suspend_cnt;
- uint8_t outbuf[OUT_BUF_SIZE];
- int outbuf_index;
- CPUArchState *mon_cpu;
- void *password_opaque;
- QError *error;
- QLIST_HEAD(,mon_fd_t) fds;
- QLIST_ENTRY(Monitor) entry;
-};
-
-#define MAX_EVENTS 1000
-#define MAX_FD_NUM 300
-typedef struct ECS_State {
- int listen_fd;
-#ifdef CONFIG_LINUX
- int epoll_fd;
- struct epoll_event events[MAX_EVENTS];
-#else
- fd_set reads;
-#endif
- int is_unix;
- int ecs_running;
- QEMUTimer *alive_timer;
- Monitor *mon;
-} ECS_State;
-
-typedef struct ECS_Client {
- int client_fd;
- int client_id;
- int keep_alive;
- const char* type;
-
- sbuf sbuf;
-
- ECS_State *cs;
- JSONMessageParser parser;
- QTAILQ_ENTRY(ECS_Client) next;
-} ECS_Client;
-
-
-int start_ecs(void);
-int stop_ecs(void);
-int get_ecs_port(void);
-
-void ecs_vprintf(const char *type, const char *fmt, va_list ap);
-void ecs_printf(const char *type, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
-
-bool handle_protobuf_msg(ECS_Client* cli, char* data, const int len);
-
-bool ntf_to_injector(const char* data, const int len);
-bool ntf_to_control(const char* data, const int len);
-bool ntf_to_monitor(const char* data, const int len);
-
-
-bool send_to_ecp(ECS__Master* master);
-
-bool send_start_ans(int host_keyboard_onff);
-bool send_injector_ntf(const char* data, const int len);
-bool send_control_ntf(const char* data, const int len);
-bool send_monitor_ntf(const char* data, const int len);
-bool send_hostkeyboard_ntf(int is_on);
-bool send_device_ntf(const char* data, const int len);
-
-bool send_to_all_client(const char* data, const int len);
-void send_to_client(int fd, const char* data, const int len) ;
-
-
-void ecs_make_header(QDict* obj, type_length length, type_group group, type_action action);
-
-void read_val_short(const char* data, unsigned short* ret_val);
-void read_val_char(const char* data, unsigned char* ret_val);
-void read_val_str(const char* data, char* ret_val, int len);
-
-
-bool msgproc_start_req(ECS_Client* ccli, ECS__StartReq* msg);
-bool msgproc_injector_req(ECS_Client* ccli, ECS__InjectorReq* msg);
-bool msgproc_control_msg(ECS_Client *cli, ECS__ControlMsg* msg);
-bool msgproc_monitor_req(ECS_Client *ccli, ECS__MonitorReq* msg);
-bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg);
-bool msgproc_screen_dump_req(ECS_Client *ccli, ECS__ScreenDumpReq* msg);
-
-
-enum{
- CONTROL_COMMAND_HOST_KEYBOARD_ONOFF_REQ = 1,
- CONTROL_COMMAND_SCREENSHOT_REQ = 2
-};
-
-// control sub messages
-void msgproc_control_hostkeyboard_req(ECS_Client *cli, ECS__HostKeyboardReq* req);
-
-void set_sensor_data(int length, const char* data);
-
-static QemuOptsList qemu_ecs_opts = {
- .name = ECS_OPTS_NAME,
- .implied_opt_name = ECS_OPTS_NAME,
- .head = QTAILQ_HEAD_INITIALIZER(qemu_ecs_opts.head),
- .desc = {
- {
- .name = "host",
- .type = QEMU_OPT_STRING,
- },{
- .name = "port",
- .type = QEMU_OPT_STRING,
- },{
- .name = "localaddr",
- .type = QEMU_OPT_STRING,
- },{
- .name = "localport",
- .type = QEMU_OPT_STRING,
- },{
- .name = "to",
- .type = QEMU_OPT_NUMBER,
- },{
- .name = "ipv4",
- .type = QEMU_OPT_BOOL,
- },{
- .name = "ipv6",
- .type = QEMU_OPT_BOOL,
- },
- { /* End of list */ }
- },
-};
-
-#endif /* __ECS_H__ */
--- /dev/null
+# ECS Makefile.tizen
+
+$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/tizen/src/ecs:$(SRC_PATH)/tizen/src/ecs/genmsg:$(SRC_PATH)/tizen/distrib/protobuf)
+
+QEMU_CFLAGS += -I$(SRC_PATH)/tizen/distrib/protobuf
+QEMU_CFLAGS += -I$(SRC_PATH)/tizen/src/ecs/genmsg
+
+obj-y += ecs.pb-c.o protobuf-c.o
+obj-y += base64.o
+obj-y += ecs_msg.o ecs.o ecs-json-streamer.o qmp_handler.o ecs_sensor.o
+
--- /dev/null
+#include "base64.h"
+
+/*------ Base64 Encoding Table ------*/
+static const char MimeBase64[] = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
+ 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+ 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '0', '1', '2', '3',
+ '4', '5', '6', '7', '8', '9', '+', '/'
+};
+
+/*------ Base64 Decoding Table ------*/
+static int DecodeMimeBase64[256] = {
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00-0F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10-1F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20-2F */
+ 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30-3F */
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
+ 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50-5F */
+ -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
+ 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70-7F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-8F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90-9F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-AF */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0-BF */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0-CF */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0-DF */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-EF */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 /* F0-FF */
+ };
+
+int base64_decode(const char *text, unsigned char *dst, int numBytes )
+{
+ const char* cp;
+ int space_idx = 0, phase;
+ int d, prev_d = 0;
+ unsigned char c;
+
+ space_idx = 0;
+ phase = 0;
+
+ for ( cp = text; *cp != '\0'; ++cp ) {
+ d = DecodeMimeBase64[(int) *cp];
+ if ( d != -1 ) {
+ switch ( phase ) {
+ case 0:
+ ++phase;
+ break;
+ case 1:
+ c = ( ( prev_d << 2 ) | ( ( d & 0x30 ) >> 4 ) );
+ if ( space_idx < numBytes )
+ dst[space_idx++] = c;
+ ++phase;
+ break;
+ case 2:
+ c = ( ( ( prev_d & 0xf ) << 4 ) | ( ( d & 0x3c ) >> 2 ) );
+ if ( space_idx < numBytes )
+ dst[space_idx++] = c;
+ ++phase;
+ break;
+ case 3:
+ c = ( ( ( prev_d & 0x03 ) << 6 ) | d );
+ if ( space_idx < numBytes )
+ dst[space_idx++] = c;
+ phase = 0;
+ break;
+ }
+ prev_d = d;
+ }
+ }
+
+ return space_idx;
+
+}
+
+int base64_encode(const char *text, int numBytes, char **encodedText)
+{
+ unsigned char input[3] = {0,0,0};
+ unsigned char output[4] = {0,0,0,0};
+ int index, i, j, size;
+ char *p, *plen, *ptext;
+
+ ptext = (char*)text;
+ plen = ptext + numBytes - 1;
+ size = (4 * (numBytes / 3)) + (numBytes % 3? 4 : 0) + 1;
+ (*encodedText) = malloc(size);
+ j = 0;
+
+ for (i = 0, p = ptext;p <= plen; i++, p++) {
+ index = i % 3;
+ input[index] = *p;
+
+ if (index == 2 || p == plen) {
+ output[0] = ((input[0] & 0xFC) >> 2);
+ output[1] = ((input[0] & 0x3) << 4) | ((input[1] & 0xF0) >> 4);
+ output[2] = ((input[1] & 0xF) << 2) | ((input[2] & 0xC0) >> 6);
+ output[3] = (input[2] & 0x3F);
+
+ (*encodedText)[j++] = MimeBase64[output[0]];
+ (*encodedText)[j++] = MimeBase64[output[1]];
+ (*encodedText)[j++] = index == 0? '=' : MimeBase64[output[2]];
+ (*encodedText)[j++] = index < 2? '=' : MimeBase64[output[3]];
+
+ input[0] = input[1] = input[2] = 0;
+ }
+ }
+
+ (*encodedText)[j] = '\0';
+
+ return 0;
+}
--- /dev/null
+#include "maru_common.h"
+
+int base64_decode(const char *text, unsigned char *dst, int numBytes);
+int base64_encode(const char *text, int numBytes, char **encodedText);
--- /dev/null
+/*
+ * JSON streaming support
+ *
+ * Copyright IBM, Corp. 2009
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ *
+ */
+
+#include "qapi/qmp/qlist.h"
+#include "qapi/qmp/qint.h"
+#include "qapi/qmp/qdict.h"
+#include "qapi/qmp/json-lexer.h"
+#include "qemu-common.h"
+#include "ecs-json-streamer.h"
+
+#define MAX_TOKEN_SIZE (64ULL << 20)
+#define MAX_NESTING (1ULL << 10)
+
+static void ecs_json_message_process_token(JSONLexer *lexer, QString *token, JSONTokenType type, int x, int y)
+{
+ JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer);
+ QDict *dict;
+
+ if (type == JSON_OPERATOR) {
+ switch (qstring_get_str(token)[0]) {
+ case '{':
+ parser->brace_count++;
+ break;
+ case '}':
+ parser->brace_count--;
+ break;
+ case '[':
+ parser->bracket_count++;
+ break;
+ case ']':
+ parser->bracket_count--;
+ break;
+ default:
+ break;
+ }
+ }
+
+ dict = qdict_new();
+ qdict_put(dict, "type", qint_from_int(type));
+ QINCREF(token);
+ qdict_put(dict, "token", token);
+ qdict_put(dict, "x", qint_from_int(x));
+ qdict_put(dict, "y", qint_from_int(y));
+
+ parser->token_size += token->length;
+
+ qlist_append(parser->tokens, dict);
+
+ if (type == JSON_ERROR) {
+ goto out_emit_bad;
+ } else if (parser->brace_count < 0 ||
+ parser->bracket_count < 0 ||
+ (parser->brace_count == 0 &&
+ parser->bracket_count == 0)) {
+ goto out_emit;
+ } else if (parser->token_size > MAX_TOKEN_SIZE ||
+ parser->bracket_count > MAX_NESTING ||
+ parser->brace_count > MAX_NESTING) {
+ /* Security consideration, we limit total memory allocated per object
+ * and the maximum recursion depth that a message can force.
+ */
+ goto out_emit;
+ }
+
+ return;
+
+out_emit_bad:
+ /* clear out token list and tell the parser to emit and error
+ * indication by passing it a NULL list
+ */
+ QDECREF(parser->tokens);
+ parser->tokens = NULL;
+out_emit:
+ /* send current list of tokens to parser and reset tokenizer */
+ parser->brace_count = 0;
+ parser->bracket_count = 0;
+ parser->emit(parser, parser->tokens, parser->opaque);
+ if (parser->tokens) {
+ QDECREF(parser->tokens);
+ }
+ parser->tokens = qlist_new();
+ parser->token_size = 0;
+}
+
+void ecs_json_message_parser_init(JSONMessageParser *parser,
+ void (*func)(JSONMessageParser *, QList *, void *), void *opaque)
+{
+ parser->emit = func;
+ parser->brace_count = 0;
+ parser->bracket_count = 0;
+ parser->tokens = qlist_new();
+ parser->token_size = 0;
+ parser->opaque = opaque;
+
+ json_lexer_init(&parser->lexer, ecs_json_message_process_token);
+}
+
+int ecs_json_message_parser_feed(JSONMessageParser *parser,
+ const char *buffer, size_t size)
+{
+ return json_lexer_feed(&parser->lexer, buffer, size);
+}
+
+int ecs_json_message_parser_flush(JSONMessageParser *parser)
+{
+ return json_lexer_flush(&parser->lexer);
+}
+
+void ecs_json_message_parser_destroy(JSONMessageParser *parser)
+{
+ json_lexer_destroy(&parser->lexer);
+ QDECREF(parser->tokens);
+}
--- /dev/null
+/*
+ * JSON streaming support
+ *
+ * Copyright IBM, Corp. 2009
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_JSON_STREAMER_H
+#define QEMU_JSON_STREAMER_H
+
+#include "qapi/qmp/qlist.h"
+#include "qapi/qmp/json-lexer.h"
+
+typedef struct JSONMessageParser
+{
+ void (*emit)(struct JSONMessageParser *parser, QList *tokens, void *);
+ JSONLexer lexer;
+ int brace_count;
+ int bracket_count;
+ QList *tokens;
+ uint64_t token_size;
+ void *opaque;
+} JSONMessageParser;
+
+void ecs_json_message_parser_init(JSONMessageParser *parser,
+ void (*func)(JSONMessageParser *, QList *, void *), void *opaque);
+
+int ecs_json_message_parser_feed(JSONMessageParser *parser,
+ const char *buffer, size_t size);
+
+int ecs_json_message_parser_flush(JSONMessageParser *parser);
+
+void ecs_json_message_parser_destroy(JSONMessageParser *parser);
+
+#endif
--- /dev/null
+#include <stdbool.h>
+#include <pthread.h>
+#include <stdlib.h>
+
+#include "hw/qdev.h"
+#include "net/net.h"
+#include "ui/console.h"
+#include "migration/migration.h"
+#include "qapi/qmp/qjson.h"
+#include "qapi/qmp/json-parser.h"
+#include "qapi/qmp/qint.h"
+#include "ui/qemu-spice.h"
+
+#include "qemu-common.h"
+#include "qemu/queue.h"
+#include "qemu/sockets.h"
+#include "qemu/option.h"
+#include "qemu/timer.h"
+#include "qemu/main-loop.h"
+#include "sysemu/char.h"
+#include "qmp-commands.h"
+#include "config.h"
+
+#include "sdb.h"
+#include "ecs.h"
+#include "hw/maru_virtio_evdi.h"
+#include "hw/maru_virtio_sensor.h"
+#include "hw/maru_virtio_nfc.h"
+
+#include "base64.h"
+#include "genmsg/ecs.pb-c.h"
+
+#define DEBUG
+
+typedef struct mon_fd_t mon_fd_t;
+struct mon_fd_t {
+ char *name;
+ int fd;
+ QLIST_ENTRY(mon_fd_t)
+ next;
+};
+
+#ifndef min
+#define min(a,b) ((a)<(b)?(a):(b))
+#endif
+
+typedef struct mon_cmd_t {
+ const char *name;
+ const char *args_type;
+ const char *params;
+ const char *help;
+ void (*user_print)(Monitor *mon, const QObject *data);
+ union {
+ void (*info)(Monitor *mon);
+ void (*cmd)(Monitor *mon, const QDict *qdict);
+ int (*cmd_new)(Monitor *mon, const QDict *params, QObject **ret_data);
+ int (*cmd_async)(Monitor *mon, const QDict *params,
+ MonitorCompletion *cb, void *opaque);
+ } mhandler;
+ int flags;
+} mon_cmd_t;
+
+static QTAILQ_HEAD(ECS_ClientHead, ECS_Client)
+clients = QTAILQ_HEAD_INITIALIZER(clients);
+
+static ECS_State *current_ecs;
+
+static int port;
+static int port_setting = -1;
+
+static pthread_mutex_t mutex_clilist = PTHREAD_MUTEX_INITIALIZER;
+
+static inline void start_logging(void) {
+ char path[256];
+ char* home;
+
+ home = getenv(LOG_HOME);
+ sprintf(path, "%s%s", home, LOG_PATH);
+
+#ifdef _WIN32
+ FILE* fnul;
+ FILE* flog;
+
+ fnul = fopen("NUL", "rt");
+ if (fnul != NULL)
+ stdin[0] = fnul[0];
+
+ flog = fopen(path, "at");
+ if (flog == NULL)
+ flog = fnul;
+
+ setvbuf(flog, NULL, _IONBF, 0);
+
+ stdout[0] = flog[0];
+ stderr[0] = flog[0];
+#else
+ int fd = open("/dev/null", O_RDONLY);
+ dup2(fd, 0);
+
+ fd = open(path, O_WRONLY | O_CREAT | O_APPEND, 0640);
+ if (fd < 0) {
+ fd = open("/dev/null", O_WRONLY);
+ }
+ dup2(fd, 1);
+ dup2(fd, 2);
+#endif
+}
+
+static int ecs_write(int fd, const uint8_t *buf, int len);
+
+static void ecs_client_close(ECS_Client* clii) {
+ pthread_mutex_lock(&mutex_clilist);
+
+ if (0 <= clii->client_fd) {
+ LOG("ecs client closed with fd: %d", clii->client_fd);
+ closesocket(clii->client_fd);
+#ifndef CONFIG_LINUX
+ FD_CLR(clii->client_fd, &clii->cs->reads);
+#endif
+ clii->client_fd = -1;
+ }
+
+ QTAILQ_REMOVE(&clients, clii, next);
+ if (NULL != clii) {
+ g_free(clii);
+ }
+
+ pthread_mutex_unlock(&mutex_clilist);
+}
+
+bool send_to_all_client(const char* data, const int len) {
+ pthread_mutex_lock(&mutex_clilist);
+
+ ECS_Client *clii;
+
+ QTAILQ_FOREACH(clii, &clients, next)
+ {
+ send_to_client(clii->client_fd, data, len);
+ }
+ pthread_mutex_unlock(&mutex_clilist);
+
+ return true;
+}
+
+
+void send_to_client(int fd, const char* data, const int len)
+{
+ ecs_write(fd, (const uint8_t*) data, len);
+}
+
+/*
+void send_to_client(int fd, const char* data, const int len)
+{
+ char c;
+ uint8_t outbuf[OUT_BUF_SIZE];
+ int outbuf_index = 0;
+
+ for (;;) {
+ c = *data++;
+ if (outbuf_index >= OUT_BUF_SIZE - 1) {
+ LOG("string is too long: overflow buffer.");
+ return;
+ }
+#ifndef _WIN32
+ if (c == '\n') {
+ outbuf[outbuf_index++] = '\r';
+ }
+#endif
+ outbuf[outbuf_index++] = c;
+ if (c == '\0') {
+ break;
+ }
+ }
+ ecs_write(fd, outbuf, outbuf_index);
+}
+*/
+
+#define QMP_ACCEPT_UNKNOWNS 1
+static void ecs_monitor_flush(ECS_Client *clii, Monitor *mon) {
+ int ret;
+
+ if (clii && 0 < clii->client_fd && mon && mon->outbuf_index != 0) {
+ ret = ecs_write(clii->client_fd, mon->outbuf, mon->outbuf_index);
+ mon->outbuf_index = 0;
+ if (ret < -1) {
+ ecs_client_close(clii);
+ }
+ }
+}
+
+static void ecs_monitor_puts(ECS_Client *clii, Monitor *mon, const char *str) {
+ char c;
+
+ if (!clii || !mon) {
+ return;
+ }
+
+ for (;;) {
+ c = *str++;
+ if (c == '\0')
+ break;
+#ifndef _WIN32
+ if (c == '\n')
+ mon->outbuf[mon->outbuf_index++] = '\r';
+#endif
+ mon->outbuf[mon->outbuf_index++] = c;
+ if (mon->outbuf_index >= (sizeof(mon->outbuf) - 1) || c == '\n')
+ ecs_monitor_flush(clii, mon);
+ }
+}
+
+void ecs_vprintf(const char *type, const char *fmt, va_list ap) {
+ char buf[READ_BUF_LEN];
+ ECS_Client *clii;
+
+ QTAILQ_FOREACH(clii, &clients, next)
+ {
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ ecs_monitor_puts(clii, clii->cs->mon, buf);
+ }
+}
+
+void ecs_printf(const char* type, const char *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ ecs_vprintf(type, fmt, ap);
+ va_end(ap);
+}
+
+static inline int monitor_has_error(const Monitor *mon) {
+ return mon->error != NULL;
+}
+
+static QDict *build_qmp_error_dict(const QError *err) {
+ QObject *obj = qobject_from_jsonf(
+ "{ 'error': { 'class': %s, 'desc': %p } }",
+ ErrorClass_lookup[err->err_class], qerror_human(err));
+
+ return qobject_to_qdict(obj);
+}
+
+static void ecs_json_emitter(ECS_Client *clii, const QObject *data) {
+ QString *json;
+
+ json = qobject_to_json(data);
+
+ assert(json != NULL);
+
+ qstring_append_chr(json, '\n');
+ ecs_monitor_puts(clii, clii->cs->mon, qstring_get_str(json));
+
+ QDECREF(json);
+}
+
+static void ecs_protocol_emitter(ECS_Client *clii, const char* type,
+ QObject *data) {
+ QDict *qmp;
+ QObject *obj;
+
+ LOG("ecs_protocol_emitter called.");
+ trace_monitor_protocol_emitter(clii->cs->mon);
+
+ if (!monitor_has_error(clii->cs->mon)) {
+ /* success response */
+ qmp = qdict_new();
+ if (data) {
+ qobject_incref(data);
+ qdict_put_obj(qmp, "return", data);
+ } else {
+ /* return an empty QDict by default */
+ qdict_put(qmp, "return", qdict_new());
+ }
+
+ if (type == NULL) {
+ obj = qobject_from_jsonf("%s", "unknown");
+ } else {
+ obj = qobject_from_jsonf("%s", type);
+ }
+ qdict_put_obj(qmp, "type", obj);
+
+ } else {
+ /* error response */
+ qmp = build_qmp_error_dict(clii->cs->mon->error);
+ QDECREF(clii->cs->mon->error);
+ clii->cs->mon->error = NULL;
+ }
+
+ ecs_json_emitter(clii, QOBJECT(qmp));
+ QDECREF(qmp);
+}
+
+static void qmp_monitor_complete(void *opaque, QObject *ret_data) {
+ // ecs_protocol_emitter(opaque, ret_data);
+}
+
+static int qmp_async_cmd_handler(ECS_Client *clii, const mon_cmd_t *cmd,
+ const QDict *params) {
+ return cmd->mhandler.cmd_async(clii->cs->mon, params, qmp_monitor_complete,
+ clii);
+}
+
+static void qmp_call_cmd(ECS_Client *clii, Monitor *mon, const char* type,
+ const mon_cmd_t *cmd, const QDict *params) {
+ int ret;
+ QObject *data = NULL;
+
+ ret = cmd->mhandler.cmd_new(mon, params, &data);
+ if (ret && !monitor_has_error(mon)) {
+ qerror_report(QERR_UNDEFINED_ERROR);
+ }
+ ecs_protocol_emitter(clii, type, data);
+ qobject_decref(data);
+}
+
+static inline bool handler_is_async(const mon_cmd_t *cmd) {
+ return cmd->flags & MONITOR_CMD_ASYNC;
+}
+
+/*
+static void monitor_user_noop(Monitor *mon, const QObject *data) {
+}
+
+static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data) {
+ //vga_hw_screen_dump(qdict_get_str(qdict, "filename"));
+ return 0;
+}
+
+static int client_migrate_info(Monitor *mon, const QDict *qdict,
+ MonitorCompletion cb, void *opaque) {
+ return 0;
+}
+
+static int add_graphics_client(Monitor *mon, const QDict *qdict,
+ QObject **ret_data) {
+ return 0;
+}
+
+static int do_qmp_capabilities(Monitor *mon, const QDict *params,
+ QObject **ret_data) {
+ return 0;
+}
+*/
+
+static const mon_cmd_t qmp_cmds[] = {
+//#include "qmp-commands-old.h"
+ { /* NULL */}, };
+
+static int check_mandatory_args(const QDict *cmd_args, const QDict *client_args,
+ int *flags) {
+ const QDictEntry *ent;
+
+ for (ent = qdict_first(cmd_args); ent; ent = qdict_next(cmd_args, ent)) {
+ const char *cmd_arg_name = qdict_entry_key(ent);
+ QString *type = qobject_to_qstring(qdict_entry_value(ent));
+ assert(type != NULL);
+
+ if (qstring_get_str(type)[0] == 'O') {
+ assert((*flags & QMP_ACCEPT_UNKNOWNS) == 0);
+ *flags |= QMP_ACCEPT_UNKNOWNS;
+ } else if (qstring_get_str(type)[0] != '-'
+ && qstring_get_str(type)[1] != '?'
+ && !qdict_haskey(client_args, cmd_arg_name)) {
+ qerror_report(QERR_MISSING_PARAMETER, cmd_arg_name);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int check_client_args_type(const QDict *client_args,
+ const QDict *cmd_args, int flags) {
+ const QDictEntry *ent;
+
+ for (ent = qdict_first(client_args); ent;
+ ent = qdict_next(client_args, ent)) {
+ QObject *obj;
+ QString *arg_type;
+ const QObject *client_arg = qdict_entry_value(ent);
+ const char *client_arg_name = qdict_entry_key(ent);
+
+ obj = qdict_get(cmd_args, client_arg_name);
+ if (!obj) {
+ if (flags & QMP_ACCEPT_UNKNOWNS) {
+ continue;
+ }
+ qerror_report(QERR_INVALID_PARAMETER, client_arg_name);
+ return -1;
+ }
+
+ arg_type = qobject_to_qstring(obj);
+ assert(arg_type != NULL);
+
+ switch (qstring_get_str(arg_type)[0]) {
+ case 'F':
+ case 'B':
+ case 's':
+ if (qobject_type(client_arg) != QTYPE_QSTRING) {
+ qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
+ "string");
+ return -1;
+ }
+ break;
+ case 'i':
+ case 'l':
+ case 'M':
+ case 'o':
+ if (qobject_type(client_arg) != QTYPE_QINT) {
+ qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
+ "int");
+ return -1;
+ }
+ break;
+ case 'T':
+ if (qobject_type(client_arg) != QTYPE_QINT
+ && qobject_type(client_arg) != QTYPE_QFLOAT) {
+ qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
+ "number");
+ return -1;
+ }
+ break;
+ case 'b':
+ case '-':
+ if (qobject_type(client_arg) != QTYPE_QBOOL) {
+ qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
+ "bool");
+ return -1;
+ }
+ break;
+ case 'O':
+ assert(flags & QMP_ACCEPT_UNKNOWNS);
+ break;
+ case 'q':
+ break;
+ case '/':
+ case '.':
+ default:
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+static QDict *qdict_from_args_type(const char *args_type) {
+ int i;
+ QDict *qdict;
+ QString *key, *type, *cur_qs;
+
+ assert(args_type != NULL);
+
+ qdict = qdict_new();
+
+ if (args_type == NULL || args_type[0] == '\0') {
+ goto out;
+ }
+
+ key = qstring_new();
+ type = qstring_new();
+
+ cur_qs = key;
+
+ for (i = 0;; i++) {
+ switch (args_type[i]) {
+ case ',':
+ case '\0':
+ qdict_put(qdict, qstring_get_str(key), type);
+ QDECREF(key);
+ if (args_type[i] == '\0') {
+ goto out;
+ }
+ type = qstring_new();
+ cur_qs = key = qstring_new();
+ break;
+ case ':':
+ cur_qs = type;
+ break;
+ default:
+ qstring_append_chr(cur_qs, args_type[i]);
+ break;
+ }
+ }
+
+ out: return qdict;
+}
+
+static int qmp_check_client_args(const mon_cmd_t *cmd, QDict *client_args) {
+ int flags, err;
+ QDict *cmd_args;
+
+ cmd_args = qdict_from_args_type(cmd->args_type);
+
+ flags = 0;
+ err = check_mandatory_args(cmd_args, client_args, &flags);
+ if (err) {
+ goto out;
+ }
+
+ err = check_client_args_type(client_args, cmd_args, flags);
+
+ out:
+ QDECREF(cmd_args);
+ return err;
+}
+
+static QDict *qmp_check_input_obj(QObject *input_obj) {
+ const QDictEntry *ent;
+ int has_exec_key = 0;
+ QDict *input_dict;
+
+ if (qobject_type(input_obj) != QTYPE_QDICT) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
+ return NULL;
+ }
+
+ input_dict = qobject_to_qdict(input_obj);
+
+ for (ent = qdict_first(input_dict); ent;
+ ent = qdict_next(input_dict, ent)) {
+ const char *arg_name = qdict_entry_key(ent);
+ const QObject *arg_obj = qdict_entry_value(ent);
+
+ if (!strcmp(arg_name, "execute")) {
+ if (qobject_type(arg_obj) != QTYPE_QSTRING) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "execute",
+ "string");
+ return NULL;
+ }
+ has_exec_key = 1;
+ } else if (!strcmp(arg_name, "arguments")) {
+ if (qobject_type(arg_obj) != QTYPE_QDICT) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "arguments",
+ "object");
+ return NULL;
+ }
+ } else if (!strcmp(arg_name, "id")) {
+ } else {
+ qerror_report(QERR_QMP_EXTRA_MEMBER, arg_name);
+ return NULL;
+ }
+ }
+
+ if (!has_exec_key) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "execute");
+ return NULL;
+ }
+
+ return input_dict;
+}
+
+static int compare_cmd(const char *name, const char *list) {
+ const char *p, *pstart;
+ int len;
+ len = strlen(name);
+ p = list;
+ for (;;) {
+ pstart = p;
+ p = strchr(p, '|');
+ if (!p)
+ p = pstart + strlen(pstart);
+ if ((p - pstart) == len && !memcmp(pstart, name, len))
+ return 1;
+ if (*p == '\0')
+ break;
+ p++;
+ }
+ return 0;
+}
+
+static const mon_cmd_t *search_dispatch_table(const mon_cmd_t *disp_table,
+ const char *cmdname) {
+ const mon_cmd_t *cmd;
+
+ for (cmd = disp_table; cmd->name != NULL; cmd++) {
+ if (compare_cmd(cmdname, cmd->name)) {
+ return cmd;
+ }
+ }
+
+ return NULL;
+}
+
+static const mon_cmd_t *qmp_find_cmd(const char *cmdname) {
+ return search_dispatch_table(qmp_cmds, cmdname);
+}
+
+static void handle_qmp_command(ECS_Client *clii, const char* type_name,
+ QObject *obj) {
+ int err;
+ const mon_cmd_t *cmd;
+ const char *cmd_name;
+ QDict *input = NULL;
+ QDict *args = NULL;
+
+ input = qmp_check_input_obj(obj);
+ if (!input) {
+ qobject_decref(obj);
+ goto err_out;
+ }
+
+ cmd_name = qdict_get_str(input, "execute");
+
+ LOG("execute exists.");
+ cmd = qmp_find_cmd(cmd_name);
+ if (!cmd) {
+ qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
+ goto err_out;
+ }
+
+ obj = qdict_get(input, "arguments");
+ if (!obj) {
+ args = qdict_new();
+ } else {
+ args = qobject_to_qdict(obj);
+ QINCREF(args);
+ }
+
+ err = qmp_check_client_args(cmd, args);
+ if (err < 0) {
+ goto err_out;
+ }
+
+ LOG("argument exists.");
+ if (handler_is_async(cmd)) {
+ err = qmp_async_cmd_handler(clii, cmd, args);
+ if (err) {
+ goto err_out;
+ }
+ } else {
+ LOG("qmp_call_cmd called client fd: %d", clii->client_fd);
+ qmp_call_cmd(clii, clii->cs->mon, type_name, cmd, args);
+ }
+
+ goto out;
+
+ err_out: ecs_protocol_emitter(clii, type_name, NULL);
+ out:
+ QDECREF(input);
+ QDECREF(args);
+
+}
+
+static int check_key(QObject *input_obj, const char *key) {
+ const QDictEntry *ent;
+ QDict *input_dict;
+
+ if (qobject_type(input_obj) != QTYPE_QDICT) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
+ return -1;
+ }
+
+ input_dict = qobject_to_qdict(input_obj);
+
+ for (ent = qdict_first(input_dict); ent;
+ ent = qdict_next(input_dict, ent)) {
+ const char *arg_name = qdict_entry_key(ent);
+ if (!strcmp(arg_name, key)) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static QObject* get_data_object(QObject *input_obj) {
+ const QDictEntry *ent;
+ QDict *input_dict;
+
+ if (qobject_type(input_obj) != QTYPE_QDICT) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
+ return NULL;
+ }
+
+ input_dict = qobject_to_qdict(input_obj);
+
+ for (ent = qdict_first(input_dict); ent;
+ ent = qdict_next(input_dict, ent)) {
+ const char *arg_name = qdict_entry_key(ent);
+ QObject *arg_obj = qdict_entry_value(ent);
+ if (!strcmp(arg_name, COMMANDS_DATA)) {
+ return arg_obj;
+ }
+ }
+
+ return NULL;
+}
+
+void read_val_short(const char* data, unsigned short* ret_val) {
+ memcpy(ret_val, data, sizeof(unsigned short));
+}
+
+void read_val_char(const char* data, unsigned char* ret_val) {
+ memcpy(ret_val, data, sizeof(unsigned char));
+}
+
+void read_val_str(const char* data, char* ret_val, int len) {
+ memcpy(ret_val, data, len);
+}
+
+void ecs_make_header(QDict* obj, type_length length, type_group group,
+ type_action action) {
+ qdict_put(obj, "length", qint_from_int((int64_t )length));
+ qdict_put(obj, "group", qint_from_int((int64_t )group));
+ qdict_put(obj, "action", qint_from_int((int64_t )action));
+}
+
+
+
+bool ntf_to_control(const char* data, const int len) {
+ return true;
+}
+
+bool ntf_to_monitor(const char* data, const int len) {
+ return true;
+}
+
+static int ijcount = 0;
+
+
+static bool injector_command_proc(ECS_Client *clii, QObject *obj) {
+ QDict* header = qdict_get_qdict(qobject_to_qdict(obj), "header");
+
+ char cmd[10];
+ memset(cmd, 0, 10);
+ strcpy(cmd, qdict_get_str(header, "cat"));
+ type_length length = (type_length) qdict_get_int(header, "length");
+ type_group group = (type_action) (qdict_get_int(header, "group") & 0xff);
+ type_action action = (type_group) (qdict_get_int(header, "action") & 0xff);
+
+ // get data
+ const char* data = qdict_get_str(qobject_to_qdict(obj), COMMANDS_DATA);
+ LOG(">> count= %d", ++ijcount);
+ LOG(">> print len = %d, data\" %s\"", strlen(data), data);
+ LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
+ action, group);
+
+ int datalen = strlen(data);
+ int sndlen = datalen + 14;
+ char* sndbuf = (char*) malloc(sndlen + 1);
+ if (!sndbuf) {
+ return false;
+ }
+
+ memset(sndbuf, 0, sndlen + 1);
+
+ if(!strcmp(cmd, "telephony")) {
+ unsigned char *decoded_data = (unsigned char*)malloc(datalen + 1);
+
+ if (!decoded_data) {
+ return false;
+ }
+
+ int len_b64 = base64_decode(data, decoded_data, datalen);
+ length = (type_length)len_b64;
+ sndlen = length + 14;
+ memcpy(sndbuf, cmd, 10);
+ memcpy(sndbuf + 10, &length, 2);
+ memcpy(sndbuf + 12, &group, 1);
+ memcpy(sndbuf + 13, &action, 1);
+ memcpy(sndbuf + 14, decoded_data, length);
+
+ send_to_evdi(route_ij, sndbuf, sndlen);
+
+ free(sndbuf);
+
+ if(decoded_data != NULL) {
+ free(decoded_data);
+ }
+
+ } else {
+
+ // set data
+ memcpy(sndbuf, cmd, 10);
+ memcpy(sndbuf + 10, &length, 2);
+ memcpy(sndbuf + 12, &group, 1);
+ memcpy(sndbuf + 13, &action, 1);
+ memcpy(sndbuf + 14, data, datalen);
+
+ send_to_evdi(route_ij, sndbuf, sndlen);
+
+ free(sndbuf);
+ }
+
+ return true;
+}
+
+
+static bool device_command_proc(ECS_Client *clii, QObject *obj) {
+ QDict* header = qdict_get_qdict(qobject_to_qdict(obj), "header");
+
+ char cmd[10];
+ memset(cmd, 0, 10);
+ strcpy(cmd, qdict_get_str(header, "cat"));
+ type_length length = (type_length) qdict_get_int(header, "length");
+ type_group group = (type_action) (qdict_get_int(header, "group") & 0xff);
+ type_action action = (type_group) (qdict_get_int(header, "action") & 0xff);
+
+ // get data
+ const char* data = qdict_get_str(qobject_to_qdict(obj), COMMANDS_DATA);
+ LOG(">> count= %d", ++ijcount);
+ LOG(">> print len = %d, data\" %s\"", strlen(data), data);
+ LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
+ action, group);
+
+ if (!strncmp(cmd, MSG_TYPE_SENSOR, 6)) {
+ if (group == MSG_GROUP_STATUS) {
+ if (action ==MSG_ACTION_ACCEL) {
+ get_sensor_accel();
+ } else if (action == MSG_ACTION_GYRO) {
+ get_sensor_gyro();
+ } else if (action == MSG_ACTION_MAG) {
+ get_sensor_mag();
+ } else if (action == MSG_ACTION_LIGHT) {
+ get_sensor_light();
+ } else if (action == MSG_ACTION_PROXI) {
+ get_sensor_proxi();
+ }
+ } else {
+ set_sensor_data(length, data);
+ }
+ }
+ else if (!strncmp(cmd, MSG_TYPE_NFC, 3)) {
+ if (group == MSG_GROUP_STATUS) {
+ send_to_nfc(request_nfc_get, data, length);
+ }
+ else
+ {
+ send_to_nfc(request_nfc_set, data, length);
+ }
+ }
+
+
+ return true;
+}
+
+static void handle_ecs_command(JSONMessageParser *parser, QList *tokens,
+ void *opaque) {
+ const char *type_name;
+ int def_target = 0;
+// int def_data = 0;
+ QObject *obj;
+ ECS_Client *clii = opaque;
+
+ if (NULL == clii) {
+ LOG("ClientInfo is null.");
+ return;
+ }
+
+#ifdef DEBUG
+ LOG("Handle ecs command.");
+#endif
+
+ obj = json_parser_parse(tokens, NULL);
+ if (!obj) {
+ qerror_report(QERR_JSON_PARSING);
+ ecs_protocol_emitter(clii, NULL, NULL);
+ return;
+ }
+
+ def_target = check_key(obj, COMMANDS_TYPE);
+#ifdef DEBUG
+ LOG("check_key(COMMAND_TYPE): %d", def_target);
+#endif
+ if (0 > def_target) {
+ LOG("def_target failed.");
+ return;
+ } else if (0 == def_target) {
+#ifdef DEBUG
+ LOG("call handle_qmp_command");
+#endif
+ handle_qmp_command(clii, NULL, obj);
+ return;
+ }
+
+ type_name = qdict_get_str(qobject_to_qdict(obj), COMMANDS_TYPE);
+
+ /*
+ def_data = check_key(obj, COMMANDS_DATA);
+ if (0 > def_data) {
+ LOG("json format error: data.");
+ return;
+ } else if (0 == def_data) {
+ LOG("data key is not found.");
+ return;
+ }
+ */
+
+ if (!strcmp(type_name, TYPE_DATA_SELF)) {
+ LOG("set client fd %d keep alive 0", clii->client_fd);
+ clii->keep_alive = 0;
+ return;
+ } else if (!strcmp(type_name, COMMAND_TYPE_INJECTOR)) {
+ injector_command_proc(clii, obj);
+ } else if (!strcmp(type_name, COMMAND_TYPE_CONTROL)) {
+ //control_command_proc(clii, obj);
+ } else if (!strcmp(type_name, COMMAND_TYPE_MONITOR)) {
+ handle_qmp_command(clii, type_name, get_data_object(obj));
+ } else if (!strcmp(type_name, COMMAND_TYPE_DEVICE)) {
+ device_command_proc(clii, obj);
+ } else if (!strcmp(type_name, ECS_MSG_STARTINFO_REQ)) {
+ //ecs_startinfo_req(clii);
+ } else {
+ LOG("handler not found");
+ }
+}
+
+static Monitor *monitor_create(void) {
+ Monitor *mon;
+
+ mon = g_malloc0(sizeof(*mon));
+ if (NULL == mon) {
+ LOG("monitor allocation failed.");
+ return NULL;
+ }
+ memset(mon, 0, sizeof(*mon));
+
+ return mon;
+}
+
+static int device_initialize(void) {
+ // currently nothing to do with it.
+ return 1;
+}
+
+static void ecs_close(ECS_State *cs) {
+ ECS_Client *clii;
+ LOG("### Good bye! ECS ###");
+
+ if (0 <= cs->listen_fd) {
+ closesocket(cs->listen_fd);
+ }
+
+ if (NULL != cs->mon) {
+ g_free(cs->mon);
+ }
+
+ if (NULL != cs->alive_timer) {
+ qemu_del_timer(cs->alive_timer);
+ cs->alive_timer = NULL;
+ }
+
+ pthread_mutex_lock(&mutex_clilist);
+
+ QTAILQ_FOREACH(clii, &clients, next)
+ {
+ ecs_client_close(clii);
+ }
+ pthread_mutex_unlock(&mutex_clilist);
+
+ //TODO: device close
+
+ if (NULL != cs) {
+ g_free(cs);
+ }
+}
+
+static int ecs_write(int fd, const uint8_t *buf, int len) {
+ LOG("write buflen : %d, buf : %s", len, buf);
+ if (fd < 0) {
+ return -1;
+ }
+
+ return send_all(fd, buf, len);
+}
+
+#ifndef _WIN32
+static ssize_t ecs_recv(int fd, char *buf, size_t len) {
+ struct msghdr msg = { NULL, };
+ struct iovec iov[1];
+ union {
+ struct cmsghdr cmsg;
+ char control[CMSG_SPACE(sizeof(int))];
+ } msg_control;
+ int flags = 0;
+
+ iov[0].iov_base = buf;
+ iov[0].iov_len = len;
+
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = &msg_control;
+ msg.msg_controllen = sizeof(msg_control);
+
+#ifdef MSG_CMSG_CLOEXEC
+ flags |= MSG_CMSG_CLOEXEC;
+#endif
+ return recvmsg(fd, &msg, flags);
+}
+
+#else
+static ssize_t ecs_recv(int fd, char *buf, size_t len)
+{
+ return qemu_recv(fd, buf, len, 0);
+}
+#endif
+
+
+static void reset_sbuf(sbuf* sbuf)
+{
+ memset(sbuf->_buf, 0, 4096);
+ sbuf->_use = 0;
+ sbuf->_netlen = 0;
+}
+
+static void ecs_read(ECS_Client *cli) {
+
+ int read = 0;
+ int to_read_bytes = 0;
+
+#ifndef __WIN32
+ if (ioctl(cli->client_fd, FIONREAD, &to_read_bytes) < 0)
+ {
+ LOG("ioctl failed");
+ return;
+ }
+#else
+ unsigned long to_read_bytes_long = 0;
+ if (ioctlsocket(cli->client_fd, FIONREAD, &to_read_bytes_long) < 0)
+ {
+ LOG("ioctl failed");
+ return;
+ }
+ to_read_bytes = (int)to_read_bytes_long;
+#endif
+
+ if (to_read_bytes == 0) {
+ LOG("ioctl FIONREAD: 0\n");
+ goto fail;
+ }
+
+ if (cli->sbuf._netlen == 0)
+ {
+ if (to_read_bytes < 4)
+ {
+ //LOG("insufficient data size to read");
+ return;
+ }
+
+ long payloadsize = 0;
+ read = ecs_recv(cli->client_fd, (char*) &payloadsize, 4);
+
+ if (read < 4)
+ {
+ LOG("insufficient header size");
+ goto fail;
+ }
+
+ payloadsize = ntohl(payloadsize);
+
+ cli->sbuf._netlen = payloadsize;
+
+ LOG("payload size: %ld\n", payloadsize);
+
+ to_read_bytes -= 4;
+ }
+
+ if (to_read_bytes == 0)
+ return;
+
+
+ to_read_bytes = min(to_read_bytes, cli->sbuf._netlen - cli->sbuf._use);
+
+ read = ecs_recv(cli->client_fd, (char*)(cli->sbuf._buf + cli->sbuf._use), to_read_bytes);
+ if (read == 0)
+ goto fail;
+
+
+ cli->sbuf._use += read;
+
+
+ if (cli->sbuf._netlen == cli->sbuf._use)
+ {
+ handle_protobuf_msg(cli, (char*)cli->sbuf._buf, cli->sbuf._use);
+ reset_sbuf(&cli->sbuf);
+ }
+
+ return;
+fail:
+ ecs_client_close(cli);
+}
+
+#ifdef CONFIG_LINUX
+static void epoll_cli_add(ECS_State *cs, int fd) {
+ struct epoll_event events;
+
+ /* event control set for read event */
+ events.events = EPOLLIN;
+ events.data.fd = fd;
+
+ if (epoll_ctl(cs->epoll_fd, EPOLL_CTL_ADD, fd, &events) < 0) {
+ LOG("Epoll control fails.in epoll_cli_add.");
+ }
+}
+#endif
+
+static ECS_Client *ecs_find_client(int fd) {
+ ECS_Client *clii;
+
+ QTAILQ_FOREACH(clii, &clients, next)
+ {
+ if (clii->client_fd == fd)
+ return clii;
+ }
+ return NULL;
+}
+
+static int ecs_add_client(ECS_State *cs, int fd) {
+
+ ECS_Client *clii = g_malloc0(sizeof(ECS_Client));
+ if (NULL == clii) {
+ LOG("ECS_Client allocation failed.");
+ return -1;
+ }
+
+ reset_sbuf(&clii->sbuf);
+
+ qemu_set_nonblock(fd);
+
+ clii->client_fd = fd;
+ clii->cs = cs;
+ ecs_json_message_parser_init(&clii->parser, handle_ecs_command, clii);
+
+#ifdef CONFIG_LINUX
+ epoll_cli_add(cs, fd);
+#else
+ FD_SET(fd, &cs->reads);
+#endif
+
+ pthread_mutex_lock(&mutex_clilist);
+
+ QTAILQ_INSERT_TAIL(&clients, clii, next);
+
+ LOG("Add an ecs client. fd: %d", fd);
+
+ pthread_mutex_unlock(&mutex_clilist);
+
+ return 0;
+}
+
+static void ecs_accept(ECS_State *cs) {
+ struct sockaddr_in saddr;
+#ifndef _WIN32
+ struct sockaddr_un uaddr;
+#endif
+ struct sockaddr *addr;
+ socklen_t len;
+ int fd;
+
+ for (;;) {
+#ifndef _WIN32
+ if (cs->is_unix) {
+ len = sizeof(uaddr);
+ addr = (struct sockaddr *) &uaddr;
+ } else
+#endif
+ {
+ len = sizeof(saddr);
+ addr = (struct sockaddr *) &saddr;
+ }
+ fd = qemu_accept(cs->listen_fd, addr, &len);
+ if (0 > fd && EINTR != errno) {
+ return;
+ } else if (0 <= fd) {
+ break;
+ }
+ }
+ if (0 > ecs_add_client(cs, fd)) {
+ LOG("failed to add client.");
+ }
+}
+
+#ifdef CONFIG_LINUX
+static void epoll_init(ECS_State *cs) {
+ struct epoll_event events;
+
+ cs->epoll_fd = epoll_create(MAX_EVENTS);
+ if (cs->epoll_fd < 0) {
+ closesocket(cs->listen_fd);
+ }
+
+ events.events = EPOLLIN;
+ events.data.fd = cs->listen_fd;
+
+ if (epoll_ctl(cs->epoll_fd, EPOLL_CTL_ADD, cs->listen_fd, &events) < 0) {
+ close(cs->listen_fd);
+ close(cs->epoll_fd);
+ }
+}
+#endif
+
+static void alive_checker(void *opaque) {
+ /*
+ ECS_State *cs = opaque;
+ ECS_Client *clii;
+ QObject *obj;
+
+ obj = qobject_from_jsonf("{\"type\":\"self\"}");
+
+ if (NULL != current_ecs && !current_ecs->ecs_running) {
+ return;
+ }
+
+ QTAILQ_FOREACH(clii, &clients, next)
+ {
+ if (1 == clii->keep_alive) {
+ LOG("get client fd %d - keep alive fail", clii->client_fd);
+ //ecs_client_close(clii);
+ continue;
+ }
+ LOG("set client fd %d - keep alive 1", clii->client_fd);
+ clii->keep_alive = 1;
+ ecs_json_emitter(clii, obj);
+ }
+
+ qemu_mod_timer(cs->alive_timer,
+ qemu_get_clock_ns(vm_clock) + get_ticks_per_sec() * TIMER_ALIVE_S);
+ */
+}
+
+static int socket_initialize(ECS_State *cs, QemuOpts *opts) {
+ int fd = -1;
+ Error *local_err = NULL;
+
+ fd = inet_listen_opts(opts, 0, &local_err);
+ if (0 > fd || error_is_set(&local_err)) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ return -1;
+ }
+
+ LOG("Listen fd is %d", fd);
+
+ qemu_set_nonblock(fd);
+
+ cs->listen_fd = fd;
+
+#ifdef CONFIG_LINUX
+ epoll_init(cs);
+#else
+ FD_ZERO(&cs->reads);
+ FD_SET(fd, &cs->reads);
+#endif
+
+ cs->alive_timer = qemu_new_timer_ns(vm_clock, alive_checker, cs);
+
+ qemu_mod_timer(cs->alive_timer,
+ qemu_get_clock_ns(vm_clock) + get_ticks_per_sec() * TIMER_ALIVE_S);
+
+ return 0;
+}
+
+#ifdef CONFIG_LINUX
+static int ecs_loop(ECS_State *cs) {
+ int i, nfds;
+
+ nfds = epoll_wait(cs->epoll_fd, cs->events, MAX_EVENTS, 100);
+ if (0 == nfds) {
+ return 0;
+ }
+
+ if (0 > nfds) {
+ LOG("epoll wait error:%d.", nfds);
+ return -1;
+ }
+
+ for (i = 0; i < nfds; i++) {
+ if (cs->events[i].data.fd == cs->listen_fd) {
+ ecs_accept(cs);
+ continue;
+ }
+ ecs_read(ecs_find_client(cs->events[i].data.fd));
+ }
+
+ return 0;
+}
+#elif defined(CONFIG_WIN32)
+static int ecs_loop(ECS_State *cs)
+{
+ int index = 0;
+ TIMEVAL timeout;
+ fd_set temps = cs->reads;
+
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+
+ if (select(0, &temps, 0, 0, &timeout) < 0) {
+ LOG("select error.");
+ return -1;
+ }
+
+ for (index = 0; index < cs->reads.fd_count; index++) {
+ if (FD_ISSET(cs->reads.fd_array[index], &temps)) {
+ if (cs->reads.fd_array[index] == cs->listen_fd) {
+ ecs_accept(cs);
+ continue;
+ }
+
+ ecs_read(ecs_find_client(cs->reads.fd_array[index]));
+ }
+ }
+
+ return 0;
+}
+#elif defined(CONFIG_DARWIN)
+static int ecs_loop(ECS_State *cs)
+{
+ int index = 0;
+ int res = 0;
+ struct timeval timeout;
+ fd_set temps = cs->reads;
+
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+
+ if ((res = select(MAX_FD_NUM + 1, &temps, NULL, NULL, &timeout)) < 0) {
+ LOG("select failed..");
+ return -1;
+ }
+
+ for (index = 0; index < MAX_FD_NUM; index ++) {
+ if (FD_ISSET(index, &temps)) {
+ if (index == cs->listen_fd) {
+ ecs_accept(cs);
+ continue;
+ }
+
+ ecs_read(ecs_find_client(index));
+ }
+ }
+
+ return 0;
+}
+
+#endif
+
+static int check_port(int port) {
+ int try = EMULATOR_SERVER_NUM;
+
+ for (; try > 0; try--) {
+ if (0 <= check_port_bind_listen(port)) {
+ LOG("Listening port is %d", port);
+ return port;
+ }
+ port++;
+ }
+ return -1;
+}
+
+int get_ecs_port(void) {
+ if (port_setting < 0) {
+ LOG("ecs port is not determined yet.");
+ return 0;
+ }
+ return port;
+}
+
+static void* ecs_initialize(void* args) {
+ int ret = 1;
+ int index;
+ ECS_State *cs = NULL;
+ QemuOpts *opts = NULL;
+ Error *local_err = NULL;
+ Monitor* mon = NULL;
+ char host_port[16];
+
+ start_logging();
+ LOG("ecs starts initializing.");
+
+ opts = qemu_opts_create(qemu_find_opts(ECS_OPTS_NAME), ECS_OPTS_NAME, 1, &local_err);
+ if (error_is_set(&local_err)) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ return NULL;
+ }
+
+ port = check_port(HOST_LISTEN_PORT);
+ if (port < 0) {
+ LOG("None of port is available.");
+ return NULL;
+ }
+
+ qemu_opt_set(opts, "host", HOST_LISTEN_ADDR);
+
+ cs = g_malloc0(sizeof(ECS_State));
+ if (NULL == cs) {
+ LOG("ECS_State allocation failed.");
+ return NULL;
+ }
+
+ for (index = 0; index < EMULATOR_SERVER_NUM; index ++) {
+ sprintf(host_port, "%d", port);
+ qemu_opt_set(opts, "port", host_port);
+ ret = socket_initialize(cs, opts);
+ if (0 > ret) {
+ LOG("socket initialization failed with port %d. next trial", port);
+ port ++;
+
+ port = check_port(port);
+ if (port < 0) {
+ LOG("None of port is available.");
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (0 > ret) {
+ LOG("socket resource is full.");
+ port = -1;
+ return NULL;
+ }
+
+ port_setting = 1;
+
+ mon = monitor_create();
+ if (NULL == mon) {
+ LOG("monitor initialization failed.");
+ ecs_close(cs);
+ return NULL;
+ }
+
+ cs->mon = mon;
+ ret = device_initialize();
+ if (0 > ret) {
+ LOG("device initialization failed.");
+ ecs_close(cs);
+ return NULL;
+ }
+
+ current_ecs = cs;
+ cs->ecs_running = 1;
+
+ LOG("ecs_loop entered.");
+ while (cs->ecs_running) {
+ ret = ecs_loop(cs);
+ if (0 > ret) {
+ ecs_close(cs);
+ break;
+ }
+ }
+
+ return (void*) ret;
+}
+
+int stop_ecs(void) {
+ LOG("ecs is closing.");
+ if (NULL != current_ecs) {
+ current_ecs->ecs_running = 0;
+ ecs_close(current_ecs);
+ }
+
+ pthread_mutex_destroy(&mutex_clilist);
+
+ return 0;
+}
+
+int start_ecs(void) {
+ pthread_t thread_id;
+
+ if (0 != pthread_create(&thread_id, NULL, ecs_initialize, NULL)) {
+ LOG("pthread creation failed.");
+ return -1;
+ }
+ return 0;
+}
+
+bool handle_protobuf_msg(ECS_Client* cli, char* data, int len)
+{
+ ECS__Master* master = ecs__master__unpack(NULL, (size_t)len, (const uint8_t*)data);
+ if (!master)
+ return false;
+
+ if (master->type == ECS__MASTER__TYPE__START_REQ)
+ {
+ ECS__StartReq* msg = master->start_req;
+ if (!msg)
+ goto fail;
+ msgproc_start_req(cli, msg);
+ }
+ if (master->type == ECS__MASTER__TYPE__INJECTOR_REQ)
+ {
+ ECS__InjectorReq* msg = master->injector_req;
+ if (!msg)
+ goto fail;
+ msgproc_injector_req(cli, msg);
+ }
+ else if (master->type == ECS__MASTER__TYPE__CONTROL_MSG)
+ {
+ ECS__ControlMsg* msg = master->control_msg;
+ if (!msg)
+ goto fail;
+ msgproc_control_msg(cli, msg);
+ }
+ else if (master->type == ECS__MASTER__TYPE__MONITOR_REQ)
+ {
+ ECS__MonitorReq* msg = master->monitor_req;
+ if (!msg)
+ goto fail;
+ msgproc_monitor_req(cli, msg);
+ }
+ else if (master->type == ECS__MASTER__TYPE__DEVICE_REQ)
+ {
+ ECS__DeviceReq* msg = master->device_req;
+ if (!msg)
+ goto fail;
+ msgproc_device_req(cli, msg);
+ }
+ else if (master->type == ECS__MASTER__TYPE__SCREEN_DUMP_REQ)
+ {
+ ECS__ScreenDumpReq* msg = master->screen_dump_req;
+ if (!msg)
+ goto fail;
+ msgproc_screen_dump_req(cli, msg);
+ }
+ ecs__master__free_unpacked(master, NULL);
+ return true;
+fail:
+ LOG("invalid message type");
+ ecs__master__free_unpacked(master, NULL);
+ return false;
+}
+
--- /dev/null
+#ifndef __ECS_H__
+#define __ECS_H__
+
+#ifdef CONFIG_LINUX
+#include <sys/epoll.h>
+#endif
+
+#include "qapi/qmp/qerror.h"
+#include "qemu-common.h"
+#include "ecs-json-streamer.h"
+#include "genmsg/ecs.pb-c.h"
+
+#define ECS_DEBUG 1
+
+#ifdef ECS_DEBUG
+#define LOG(fmt, arg...) \
+ do { \
+ fprintf(stdout,"[%s-%s:%d] "fmt"\n", __TIME__, __FUNCTION__, __LINE__, ##arg); \
+ } while (0)
+#else
+#define LOG(fmt, arg...)
+#endif
+
+#ifndef _WIN32
+#define LOG_HOME "HOME"
+#define LOG_PATH "/tizen-sdk-data/emulator/vms/ecs.log"
+#else
+#define LOG_HOME "LOCALAPPDATA"
+#define LOG_PATH "\\tizen-sdk-data\\emulator\\vms\\ecs.log"
+#endif
+
+#define ECS_OPTS_NAME "ecs"
+#define HOST_LISTEN_ADDR "127.0.0.1"
+#define HOST_LISTEN_PORT 27000
+#define EMULATOR_SERVER_NUM 10
+
+#define COMMANDS_TYPE "type"
+#define COMMANDS_DATA "data"
+
+
+#define COMMAND_TYPE_INJECTOR "injector"
+#define COMMAND_TYPE_CONTROL "control"
+#define COMMAND_TYPE_MONITOR "monitor"
+#define COMMAND_TYPE_DEVICE "device"
+
+#define ECS_MSG_STARTINFO_REQ "startinfo_req"
+#define ECS_MSG_STARTINFO_ANS "startinfo_ans"
+
+#define MSG_TYPE_SENSOR "sensor"
+#define MSG_TYPE_NFC "nfc"
+
+#define MSG_GROUP_STATUS 15
+
+#define MSG_ACTION_ACCEL 110
+#define MSG_ACTION_GYRO 111
+#define MSG_ACTION_MAG 112
+#define MSG_ACTION_LIGHT 113
+#define MSG_ACTION_PROXI 114
+
+#define TIMER_ALIVE_S 60
+#define TYPE_DATA_SELF "self"
+
+enum sensor_level {
+ level_accel = 1,
+ level_proxi = 2,
+ level_light = 3,
+ level_gyro = 4,
+ level_geo = 5,
+ level_tilt = 12,
+ level_magnetic = 13
+};
+
+typedef unsigned short type_length;
+typedef unsigned char type_group;
+typedef unsigned char type_action;
+
+#define OUT_BUF_SIZE 4096
+#define READ_BUF_LEN 4096
+
+
+
+typedef struct sbuf
+{
+ int _netlen;
+ int _use;
+ char _buf[4096];
+}sbuf;
+
+
+struct Monitor {
+ int suspend_cnt;
+ uint8_t outbuf[OUT_BUF_SIZE];
+ int outbuf_index;
+ CPUArchState *mon_cpu;
+ void *password_opaque;
+ QError *error;
+ QLIST_HEAD(,mon_fd_t) fds;
+ QLIST_ENTRY(Monitor) entry;
+};
+
+#define MAX_EVENTS 1000
+#define MAX_FD_NUM 300
+typedef struct ECS_State {
+ int listen_fd;
+#ifdef CONFIG_LINUX
+ int epoll_fd;
+ struct epoll_event events[MAX_EVENTS];
+#else
+ fd_set reads;
+#endif
+ int is_unix;
+ int ecs_running;
+ QEMUTimer *alive_timer;
+ Monitor *mon;
+} ECS_State;
+
+typedef struct ECS_Client {
+ int client_fd;
+ int client_id;
+ int keep_alive;
+ const char* type;
+
+ sbuf sbuf;
+
+ ECS_State *cs;
+ JSONMessageParser parser;
+ QTAILQ_ENTRY(ECS_Client) next;
+} ECS_Client;
+
+
+int start_ecs(void);
+int stop_ecs(void);
+int get_ecs_port(void);
+
+void ecs_vprintf(const char *type, const char *fmt, va_list ap);
+void ecs_printf(const char *type, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
+
+bool handle_protobuf_msg(ECS_Client* cli, char* data, const int len);
+
+bool ntf_to_injector(const char* data, const int len);
+bool ntf_to_control(const char* data, const int len);
+bool ntf_to_monitor(const char* data, const int len);
+
+
+bool send_to_ecp(ECS__Master* master);
+
+bool send_start_ans(int host_keyboard_onff);
+bool send_injector_ntf(const char* data, const int len);
+bool send_control_ntf(const char* data, const int len);
+bool send_monitor_ntf(const char* data, const int len);
+bool send_hostkeyboard_ntf(int is_on);
+bool send_device_ntf(const char* data, const int len);
+
+bool send_to_all_client(const char* data, const int len);
+void send_to_client(int fd, const char* data, const int len) ;
+
+
+void ecs_make_header(QDict* obj, type_length length, type_group group, type_action action);
+
+void read_val_short(const char* data, unsigned short* ret_val);
+void read_val_char(const char* data, unsigned char* ret_val);
+void read_val_str(const char* data, char* ret_val, int len);
+
+
+bool msgproc_start_req(ECS_Client* ccli, ECS__StartReq* msg);
+bool msgproc_injector_req(ECS_Client* ccli, ECS__InjectorReq* msg);
+bool msgproc_control_msg(ECS_Client *cli, ECS__ControlMsg* msg);
+bool msgproc_monitor_req(ECS_Client *ccli, ECS__MonitorReq* msg);
+bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg);
+bool msgproc_screen_dump_req(ECS_Client *ccli, ECS__ScreenDumpReq* msg);
+
+
+enum{
+ CONTROL_COMMAND_HOST_KEYBOARD_ONOFF_REQ = 1,
+ CONTROL_COMMAND_SCREENSHOT_REQ = 2
+};
+
+// control sub messages
+void msgproc_control_hostkeyboard_req(ECS_Client *cli, ECS__HostKeyboardReq* req);
+
+void set_sensor_data(int length, const char* data);
+
+static QemuOptsList qemu_ecs_opts = {
+ .name = ECS_OPTS_NAME,
+ .implied_opt_name = ECS_OPTS_NAME,
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_ecs_opts.head),
+ .desc = {
+ {
+ .name = "host",
+ .type = QEMU_OPT_STRING,
+ },{
+ .name = "port",
+ .type = QEMU_OPT_STRING,
+ },{
+ .name = "localaddr",
+ .type = QEMU_OPT_STRING,
+ },{
+ .name = "localport",
+ .type = QEMU_OPT_STRING,
+ },{
+ .name = "to",
+ .type = QEMU_OPT_NUMBER,
+ },{
+ .name = "ipv4",
+ .type = QEMU_OPT_BOOL,
+ },{
+ .name = "ipv6",
+ .type = QEMU_OPT_BOOL,
+ },
+ { /* End of list */ }
+ },
+};
+
+#endif /* __ECS_H__ */
--- /dev/null
+#include <stdbool.h>
+#include <pthread.h>
+
+#include "hw/qdev.h"
+#include "net/net.h"
+#include "ui/console.h"
+#include "migration/migration.h"
+#include "qapi/qmp/qint.h"
+#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qjson.h"
+#include "qapi/qmp/json-parser.h"
+#include "ui/qemu-spice.h"
+#include "qemu/queue.h"
+#include "qemu/option.h"
+#include "sysemu/char.h"
+#include "qemu/main-loop.h"
+
+#ifdef CONFIG_LINUX
+#include <sys/epoll.h>
+#endif
+
+#include "qemu-common.h"
+//#include "qemu_socket.h"
+#include "sdb.h"
+#include "ecs-json-streamer.h"
+#include "qmp-commands.h"
+
+#include "ecs.h"
+#include "base64.h"
+#include "mloop_event.h"
+#include "hw/maru_virtio_evdi.h"
+#include "hw/maru_virtio_sensor.h"
+#include "hw/maru_virtio_nfc.h"
+#include "skin/maruskin_operation.h"
+
+// utility functions
+
+static void* build_master(ECS__Master* master, int* payloadsize)
+{
+ int len_pack = ecs__master__get_packed_size(master);
+ *payloadsize = len_pack + 4;
+ LOG("pack size=%d", len_pack);
+ void* buf = g_malloc(len_pack + 4);
+ if (!buf)
+ return NULL;
+
+ ecs__master__pack(master, buf + 4);
+
+ len_pack = htonl(len_pack);
+ memcpy(buf, &len_pack, 4);
+
+ return buf;
+}
+
+bool send_to_ecp(ECS__Master* master)
+{
+ int payloadsize = 0;
+ void* buf = build_master(master, &payloadsize);
+ if (!buf)
+ {
+ LOG("invalid buf");
+ return false;
+ }
+
+ if (!send_to_all_client(buf, payloadsize))
+ return false;
+
+ if (buf)
+ {
+ g_free(buf);
+ }
+ return true;
+}
+
+
+// message handlers
+
+
+bool msgproc_start_req(ECS_Client* ccli, ECS__StartReq* msg)
+{
+ LOG("ecs_startinfo_req");
+
+ int hostkbd_status = mloop_evcmd_get_hostkbd_status();
+
+ LOG("hostkbd_status = %d", hostkbd_status);
+
+ send_start_ans(hostkbd_status);
+
+ return true;
+}
+
+bool msgproc_injector_req(ECS_Client* ccli, ECS__InjectorReq* msg)
+{
+ char cmd[10];
+ memset(cmd, 0, 10);
+ strcpy(cmd, msg->category);
+ type_length length = (type_length) msg->length;
+ type_group group = (type_group) (msg->group & 0xff);
+ type_action action = (type_action) (msg->action & 0xff);
+
+
+ int datalen = 0;
+ if (msg->has_data)
+ {
+ datalen = msg->data.len;
+ }
+ //LOG(">> count= %d", ++ijcount);
+
+ LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
+ action, group);
+
+
+ int sndlen = datalen + 14;
+ char* sndbuf = (char*) g_malloc(sndlen + 1);
+ if (!sndbuf) {
+ return false;
+ }
+
+ memset(sndbuf, 0, sndlen + 1);
+
+ // set data
+ memcpy(sndbuf, cmd, 10);
+ memcpy(sndbuf + 10, &length, 2);
+ memcpy(sndbuf + 12, &group, 1);
+ memcpy(sndbuf + 13, &action, 1);
+
+
+ if (msg->has_data)
+ {
+ if (msg->data.data && msg->data.len > 0)
+ {
+ const char* data = (const char*)msg->data.data;
+ memcpy(sndbuf + 14, data, datalen);
+ LOG(">> print len = %d, data\" %s\"", strlen(data), data);
+ }
+ }
+
+ send_to_evdi(route_ij, sndbuf, sndlen);
+
+ g_free(sndbuf);
+
+ return true;
+}
+
+bool msgproc_control_msg(ECS_Client *cli, ECS__ControlMsg* msg)
+{
+ if (msg->type == ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ)
+ {
+ ECS__HostKeyboardReq* hkr = msg->hostkeyboard_req;
+ if (!hkr)
+ return false;
+ msgproc_control_hostkeyboard_req(cli, hkr);
+ }
+
+ return true;
+}
+
+bool msgproc_monitor_req(ECS_Client *ccli, ECS__MonitorReq* msg)
+{
+
+ return true;
+}
+
+bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg)
+{
+ char cmd[10];
+ char* data = NULL;
+ memset(cmd, 0, 10);
+ strcpy(cmd, msg->category);
+ type_length length = (type_length) msg->length;
+ type_group group = (type_group) (msg->group & 0xff);
+ type_action action = (type_action) (msg->action & 0xff);
+
+ if (msg->has_data && msg->data.len > 0)
+ {
+ data = (char*)msg->data.data;
+ }
+
+ LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
+ action, group);
+
+ if (!strncmp(cmd, MSG_TYPE_SENSOR, 6)) {
+ if (group == MSG_GROUP_STATUS) {
+ if (action ==MSG_ACTION_ACCEL) {
+ get_sensor_accel();
+ } else if (action == MSG_ACTION_GYRO) {
+ get_sensor_gyro();
+ } else if (action == MSG_ACTION_MAG) {
+ get_sensor_mag();
+ } else if (action == MSG_ACTION_LIGHT) {
+ get_sensor_light();
+ } else if (action == MSG_ACTION_PROXI) {
+ get_sensor_proxi();
+ }
+ } else {
+ set_sensor_data(length, data);
+ }
+ }
+ else if (!strncmp(cmd, MSG_TYPE_NFC, 3)) {
+ if (group == MSG_GROUP_STATUS) {
+ send_to_nfc(request_get, data, length);
+ }
+ else
+ {
+ send_to_nfc(request_set, data, length);
+ }
+ }
+
+ return true;
+}
+
+bool msgproc_screen_dump_req(ECS_Client *ccli, ECS__ScreenDumpReq* msg)
+{
+
+ return true;
+}
+
+
+// begin control command
+
+void msgproc_control_hostkeyboard_req(ECS_Client *clii, ECS__HostKeyboardReq* req)
+{
+ int64_t is_on = req->ison;
+ onoff_host_kbd(is_on);
+}
+
+// end control command
+
+
+//
+
+bool ntf_to_injector(const char* data, const int len) {
+ type_length length = 0;
+ type_group group = 0;
+ type_action action = 0;
+
+ const int catsize = 10;
+ char cat[catsize + 1];
+ memset(cat, 0, catsize + 1);
+
+ read_val_str(data, cat, catsize);
+ read_val_short(data + catsize, &length);
+ read_val_char(data + catsize + 2, &group);
+ read_val_char(data + catsize + 2 + 1, &action);
+
+
+ const char* ijdata = (data + catsize + 2 + 1 + 1);
+
+ char *encoded_ijdata = NULL;
+ LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,
+ action, group);
+
+ if(!strcmp(cat, "telephony")) {
+ base64_encode(ijdata, length, &encoded_ijdata);
+ }
+
+ QDict* obj_header = qdict_new();
+ ecs_make_header(obj_header, length, group, action);
+
+ QDict* objData = qdict_new();
+ qobject_incref(QOBJECT(obj_header));
+
+ qdict_put(objData, "cat", qstring_from_str(cat));
+ qdict_put(objData, "header", obj_header);
+ if(!strcmp(cat, "telephony")) {
+ qdict_put(objData, "ijdata", qstring_from_str(encoded_ijdata));
+ } else {
+ qdict_put(objData, "ijdata", qstring_from_str(ijdata));
+ }
+
+ QDict* objMsg = qdict_new();
+ qobject_incref(QOBJECT(objData));
+
+ qdict_put(objMsg, "type", qstring_from_str("injector"));
+ qdict_put(objMsg, "result", qstring_from_str("success"));
+ qdict_put(objMsg, "data", objData);
+
+ QString *json;
+ json = qobject_to_json(QOBJECT(objMsg));
+
+ assert(json != NULL);
+
+ qstring_append_chr(json, '\n');
+ const char* snddata = qstring_get_str(json);
+
+ LOG("<< json str = %s", snddata);
+
+ send_to_all_client(snddata, strlen(snddata));
+
+ QDECREF(json);
+
+ QDECREF(obj_header);
+ QDECREF(objData);
+ QDECREF(objMsg);
+
+ return true;
+}
+
+bool send_start_ans(int host_keyboard_onff)
+{
+ ECS__Master master = ECS__MASTER__INIT;
+ ECS__StartAns ans = ECS__START_ANS__INIT;
+
+ ans.has_host_keyboard_onoff = 1;
+ ans.host_keyboard_onoff = host_keyboard_onff;
+
+ ans.has_camera_onoff = 1;
+ ans.camera_onoff = 1;
+
+ ans.has_earjack_onoff = 1;
+ ans.earjack_onoff = 1;
+
+ master.type = ECS__MASTER__TYPE__START_ANS;
+ master.start_ans = &ans;
+
+ return send_to_ecp(&master);
+}
+
+bool send_injector_ntf(const char* data, const int len)
+{
+ type_length length = 0;
+ type_group group = 0;
+ type_action action = 0;
+
+ const int catsize = 10;
+ char cat[catsize + 1];
+ memset(cat, 0, catsize + 1);
+
+ read_val_str(data, cat, catsize);
+ read_val_short(data + catsize, &length);
+ read_val_char(data + catsize + 2, &group);
+ read_val_char(data + catsize + 2 + 1, &action);
+
+
+ const char* ijdata = (data + catsize + 2 + 1 + 1);
+
+ LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,action, group);
+
+ ECS__Master master = ECS__MASTER__INIT;
+ ECS__InjectorNtf ntf = ECS__INJECTOR_NTF__INIT;
+
+ ntf.category = (char*) g_malloc(catsize + 1);
+ strncpy(ntf.category, cat, 10);
+
+
+ ntf.length = length;
+ ntf.group = group;
+ ntf.action = action;
+
+ if (length > 0)
+ {
+ ntf.has_data = 1;
+
+ ntf.data.data = g_malloc(length);
+ ntf.data.len = length;
+ memcpy(ntf.data.data, ijdata, length);
+ }
+
+ master.type = ECS__MASTER__TYPE__INJECTOR_NTF;
+ master.injector_ntf = &ntf;
+
+ send_to_ecp(&master);
+
+ if (ntf.data.data && ntf.data.len > 0)
+ {
+ g_free(ntf.data.data);
+ }
+
+ if (ntf.category)
+ g_free(ntf.category);
+
+ return true;
+}
+
+
+bool send_hostkeyboard_ntf(int is_on)
+{
+ ECS__Master master = ECS__MASTER__INIT;
+ ECS__ControlMsg ctl = ECS__CONTROL_MSG__INIT;
+
+ ECS__HostKeyboardNtf ntf = ECS__HOST_KEYBOARD_NTF__INIT;
+
+ ntf.has_ison = 1;
+ ntf.ison = is_on;
+
+ ctl.type = ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF;
+ ctl.hostkeyboard_ntf = &ntf;
+
+ master.type = ECS__MASTER__TYPE__CONTROL_MSG;
+ master.control_msg = &ctl;
+
+ return send_to_ecp(&master);
+}
+
+
+bool send_device_ntf(const char* data, const int len)
+{
+ type_length length = 0;
+ type_group group = 0;
+ type_action action = 0;
+
+ const int catsize = 10;
+ char cat[catsize + 1];
+ memset(cat, 0, catsize + 1);
+
+ read_val_str(data, cat, catsize);
+ read_val_short(data + catsize, &length);
+ read_val_char(data + catsize + 2, &group);
+ read_val_char(data + catsize + 2 + 1, &action);
+
+
+ const char* ijdata = (data + catsize + 2 + 1 + 1);
+
+ LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,action, group);
+
+ ECS__Master master = ECS__MASTER__INIT;
+ ECS__DeviceNtf ntf = ECS__DEVICE_NTF__INIT;
+
+ ntf.category = (char*) g_malloc(catsize + 1);
+ strncpy(ntf.category, cat, 10);
+
+
+ ntf.length = length;
+ ntf.group = group;
+ ntf.action = action;
+
+ if (length > 0)
+ {
+ ntf.has_data = 1;
+
+ ntf.data.data = g_malloc(length);
+ ntf.data.len = length;
+ memcpy(ntf.data.data, ijdata, length);
+ }
+
+ master.type = ECS__MASTER__TYPE__DEVICE_NTF;
+ master.device_ntf = &ntf;
+
+ send_to_ecp(&master);
+
+ if (ntf.data.data && ntf.data.len > 0)
+ {
+ g_free(ntf.data.data);
+ }
+
+ if (ntf.category)
+ g_free(ntf.category);
+
+ return true;
+}
+
--- /dev/null
+/*
+ * Emulator Control Server - Sensor Device Handler
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact:
+ * Jinhyung choi <jinhyung2.choi@samsung.com>
+ * Daiyoung Kim <daiyoung777.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "qemu-common.h"
+//#include "qemu_socket.h"
+//#include "qemu-queue.h"
+//#include "qemu-option.h"
+//#include "qemu-config.h"
+//#include "qemu-timer.h"
+
+#include "ecs.h"
+#include "hw/maru_virtio_sensor.h"
+
+#define TEMP_BUF_SIZE 255
+#define MAX_VAL_LENGTH 40
+
+#define ACCEL_ADJUST 100000
+#define ACCEL_MAX 1961330
+
+#define GYRO_ADJUST 17.50
+
+static int parse_val(const char *buff, unsigned char data, char *parsbuf)
+{
+ int count=0;
+
+ while(1)
+ {
+ if(count > MAX_VAL_LENGTH)
+ return -1;
+ if(buff[count] == data)
+ {
+ count++;
+ strncpy(parsbuf, buff, count);
+ return count;
+ }
+ count++;
+ }
+
+ return 0;
+}
+
+static int get_parse_val (const char* buf, char* tmp)
+{
+ int index = 0;
+
+ memset(tmp, 0, sizeof(TEMP_BUF_SIZE));
+
+ index = parse_val(buf, 0x0a, tmp);
+
+ return index;
+}
+
+static int accel_min_max(char* tmp)
+{
+ int value = (int)(atof(tmp) * ACCEL_ADJUST);
+
+ if (value > ACCEL_MAX)
+ value = ACCEL_MAX;
+
+ if (value < -ACCEL_MAX)
+ value = -ACCEL_MAX;
+
+ return value;
+}
+
+static void req_set_sensor_accel(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x, y, z;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = accel_min_max(tmp);
+
+ // y
+ len += get_parse_val(data + len, tmp);
+ y = accel_min_max(tmp);
+
+ // z
+ len += get_parse_val(data + len, tmp);
+ z = accel_min_max(tmp);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d, %d, %d", x, y, z);
+
+ set_sensor_accel(tmp, strlen(tmp));
+}
+
+static void req_set_sensor_proxi(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // vo
+ len += get_parse_val(data + len, tmp);
+
+ set_sensor_proxi(tmp, strlen(tmp));
+}
+
+static void req_set_sensor_light(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = atoi(tmp);
+
+ if (x == 2) {
+ // y
+ len += get_parse_val(data + len, tmp);
+
+ set_sensor_light(tmp, strlen(tmp));
+ }
+}
+
+static void req_set_sensor_gyro(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x, y, z;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = (int)(atoi(tmp) / GYRO_ADJUST);
+
+ // y
+ len += get_parse_val(data + len, tmp);
+ y = (int)(atoi(tmp) / GYRO_ADJUST);
+
+ // z
+ len += get_parse_val(data + len, tmp);
+ z = (int)(atoi(tmp) / GYRO_ADJUST);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d %d %d", x, y, z);
+
+ set_sensor_gyro(tmp, strlen(tmp));
+}
+
+static void req_set_sensor_geo(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x, y, z, accuracy, t_north, t_east, t_vertical;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = atoi(tmp);
+
+ // y
+ len += get_parse_val(data + len, tmp);
+ y = atoi(tmp);
+
+ // z
+ len += get_parse_val(data + len, tmp);
+ z = atoi(tmp);
+
+ len += get_parse_val(data + len, tmp);
+ accuracy = atoi(tmp);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d %d %d %d", x, y, z, accuracy);
+
+ set_sensor_tilt(tmp, strlen(tmp));
+
+ // tesla_north
+ len += get_parse_val(data + len, tmp);
+ t_north = atoi(tmp);
+
+ // tesla_east
+ len += get_parse_val(data + len, tmp);
+ t_east = atoi(tmp);
+
+ // tesla_vertical
+ len += get_parse_val(data + len, tmp);
+ t_vertical = atoi(tmp);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d %d %d", t_north, t_east, t_vertical);
+
+ set_sensor_mag(tmp, strlen(tmp));
+}
+
+static void req_set_sensor_tilt(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x, y, z, accuracy = 3;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = atoi(tmp);
+
+ // y
+ len += get_parse_val(data + len, tmp);
+ y = atoi(tmp);
+
+ // z
+ len += get_parse_val(data + len, tmp);
+ z = atoi(tmp);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d %d %d %d", x, y, z, accuracy);
+
+ set_sensor_tilt(tmp, strlen(tmp));
+}
+
+static void req_set_sensor_mag(int len, const char* data)
+{
+ char tmp[TEMP_BUF_SIZE];
+ int x, y, z;
+
+ // get sensor level
+ len += get_parse_val(data + len, tmp);
+
+ // x
+ len += get_parse_val(data + len, tmp);
+ x = atoi(tmp);
+
+ // y
+ len += get_parse_val(data + len, tmp);
+ y = atoi(tmp);
+
+ // z
+ len += get_parse_val(data + len, tmp);
+ z = atoi(tmp);
+
+ memset(tmp, 0, TEMP_BUF_SIZE);
+
+ sprintf(tmp, "%d %d %d", x, y, z);
+
+ set_sensor_mag(tmp, strlen(tmp));
+}
+
+void set_sensor_data(int length, const char* data)
+{
+ char tmpbuf[TEMP_BUF_SIZE];
+ int len = get_parse_val(data, tmpbuf);
+
+ switch(atoi(tmpbuf)) {
+ case level_accel:
+ req_set_sensor_accel(len, data);
+ break;
+ case level_proxi:
+ req_set_sensor_proxi(len, data);
+ break;
+ case level_light:
+ req_set_sensor_light(len, data);
+ break;
+ case level_gyro:
+ req_set_sensor_gyro(len, data);
+ break;
+ case level_geo:
+ req_set_sensor_geo(len, data);
+ break;
+ case level_tilt:
+ req_set_sensor_tilt(len, data);
+ break;
+ case level_magnetic:
+ req_set_sensor_mag(len, data);
+ break;
+ default:
+ break;
+ }
+}
+
--- /dev/null
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C_NO_DEPRECATED
+#define PROTOBUF_C_NO_DEPRECATED
+#endif
+
+#include "ecs.pb-c.h"
+void ecs__check_version_req__init
+ (ECS__CheckVersionReq *message)
+{
+ static ECS__CheckVersionReq init_value = ECS__CHECK_VERSION_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__check_version_req__get_packed_size
+ (const ECS__CheckVersionReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__check_version_req__pack
+ (const ECS__CheckVersionReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__check_version_req__pack_to_buffer
+ (const ECS__CheckVersionReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__CheckVersionReq *
+ ecs__check_version_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__CheckVersionReq *)
+ protobuf_c_message_unpack (&ecs__check_version_req__descriptor,
+ allocator, len, data);
+}
+void ecs__check_version_req__free_unpacked
+ (ECS__CheckVersionReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__check_version_ans__init
+ (ECS__CheckVersionAns *message)
+{
+ static ECS__CheckVersionAns init_value = ECS__CHECK_VERSION_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__check_version_ans__get_packed_size
+ (const ECS__CheckVersionAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__check_version_ans__pack
+ (const ECS__CheckVersionAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__check_version_ans__pack_to_buffer
+ (const ECS__CheckVersionAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__CheckVersionAns *
+ ecs__check_version_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__CheckVersionAns *)
+ protobuf_c_message_unpack (&ecs__check_version_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__check_version_ans__free_unpacked
+ (ECS__CheckVersionAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__keep_alive_req__init
+ (ECS__KeepAliveReq *message)
+{
+ static ECS__KeepAliveReq init_value = ECS__KEEP_ALIVE_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__keep_alive_req__get_packed_size
+ (const ECS__KeepAliveReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__keep_alive_req__pack
+ (const ECS__KeepAliveReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__keep_alive_req__pack_to_buffer
+ (const ECS__KeepAliveReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__KeepAliveReq *
+ ecs__keep_alive_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__KeepAliveReq *)
+ protobuf_c_message_unpack (&ecs__keep_alive_req__descriptor,
+ allocator, len, data);
+}
+void ecs__keep_alive_req__free_unpacked
+ (ECS__KeepAliveReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__keep_alive_ans__init
+ (ECS__KeepAliveAns *message)
+{
+ static ECS__KeepAliveAns init_value = ECS__KEEP_ALIVE_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__keep_alive_ans__get_packed_size
+ (const ECS__KeepAliveAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__keep_alive_ans__pack
+ (const ECS__KeepAliveAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__keep_alive_ans__pack_to_buffer
+ (const ECS__KeepAliveAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__KeepAliveAns *
+ ecs__keep_alive_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__KeepAliveAns *)
+ protobuf_c_message_unpack (&ecs__keep_alive_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__keep_alive_ans__free_unpacked
+ (ECS__KeepAliveAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__start_req__init
+ (ECS__StartReq *message)
+{
+ static ECS__StartReq init_value = ECS__START_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__start_req__get_packed_size
+ (const ECS__StartReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__start_req__pack
+ (const ECS__StartReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__start_req__pack_to_buffer
+ (const ECS__StartReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__StartReq *
+ ecs__start_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__StartReq *)
+ protobuf_c_message_unpack (&ecs__start_req__descriptor,
+ allocator, len, data);
+}
+void ecs__start_req__free_unpacked
+ (ECS__StartReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__start_ans__init
+ (ECS__StartAns *message)
+{
+ static ECS__StartAns init_value = ECS__START_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__start_ans__get_packed_size
+ (const ECS__StartAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__start_ans__pack
+ (const ECS__StartAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__start_ans__pack_to_buffer
+ (const ECS__StartAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__StartAns *
+ ecs__start_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__StartAns *)
+ protobuf_c_message_unpack (&ecs__start_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__start_ans__free_unpacked
+ (ECS__StartAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__injector_req__init
+ (ECS__InjectorReq *message)
+{
+ static ECS__InjectorReq init_value = ECS__INJECTOR_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__injector_req__get_packed_size
+ (const ECS__InjectorReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__injector_req__pack
+ (const ECS__InjectorReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__injector_req__pack_to_buffer
+ (const ECS__InjectorReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__InjectorReq *
+ ecs__injector_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__InjectorReq *)
+ protobuf_c_message_unpack (&ecs__injector_req__descriptor,
+ allocator, len, data);
+}
+void ecs__injector_req__free_unpacked
+ (ECS__InjectorReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__injector_ans__init
+ (ECS__InjectorAns *message)
+{
+ static ECS__InjectorAns init_value = ECS__INJECTOR_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__injector_ans__get_packed_size
+ (const ECS__InjectorAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__injector_ans__pack
+ (const ECS__InjectorAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__injector_ans__pack_to_buffer
+ (const ECS__InjectorAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__InjectorAns *
+ ecs__injector_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__InjectorAns *)
+ protobuf_c_message_unpack (&ecs__injector_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__injector_ans__free_unpacked
+ (ECS__InjectorAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__injector_ntf__init
+ (ECS__InjectorNtf *message)
+{
+ static ECS__InjectorNtf init_value = ECS__INJECTOR_NTF__INIT;
+ *message = init_value;
+}
+size_t ecs__injector_ntf__get_packed_size
+ (const ECS__InjectorNtf *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__injector_ntf__pack
+ (const ECS__InjectorNtf *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__injector_ntf__pack_to_buffer
+ (const ECS__InjectorNtf *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__InjectorNtf *
+ ecs__injector_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__InjectorNtf *)
+ protobuf_c_message_unpack (&ecs__injector_ntf__descriptor,
+ allocator, len, data);
+}
+void ecs__injector_ntf__free_unpacked
+ (ECS__InjectorNtf *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__device_req__init
+ (ECS__DeviceReq *message)
+{
+ static ECS__DeviceReq init_value = ECS__DEVICE_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__device_req__get_packed_size
+ (const ECS__DeviceReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__device_req__pack
+ (const ECS__DeviceReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__device_req__pack_to_buffer
+ (const ECS__DeviceReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__DeviceReq *
+ ecs__device_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__DeviceReq *)
+ protobuf_c_message_unpack (&ecs__device_req__descriptor,
+ allocator, len, data);
+}
+void ecs__device_req__free_unpacked
+ (ECS__DeviceReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__device_ans__init
+ (ECS__DeviceAns *message)
+{
+ static ECS__DeviceAns init_value = ECS__DEVICE_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__device_ans__get_packed_size
+ (const ECS__DeviceAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__device_ans__pack
+ (const ECS__DeviceAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__device_ans__pack_to_buffer
+ (const ECS__DeviceAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__DeviceAns *
+ ecs__device_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__DeviceAns *)
+ protobuf_c_message_unpack (&ecs__device_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__device_ans__free_unpacked
+ (ECS__DeviceAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__device_ntf__init
+ (ECS__DeviceNtf *message)
+{
+ static ECS__DeviceNtf init_value = ECS__DEVICE_NTF__INIT;
+ *message = init_value;
+}
+size_t ecs__device_ntf__get_packed_size
+ (const ECS__DeviceNtf *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__device_ntf__pack
+ (const ECS__DeviceNtf *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__device_ntf__pack_to_buffer
+ (const ECS__DeviceNtf *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__DeviceNtf *
+ ecs__device_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__DeviceNtf *)
+ protobuf_c_message_unpack (&ecs__device_ntf__descriptor,
+ allocator, len, data);
+}
+void ecs__device_ntf__free_unpacked
+ (ECS__DeviceNtf *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__host_keyboard_req__init
+ (ECS__HostKeyboardReq *message)
+{
+ static ECS__HostKeyboardReq init_value = ECS__HOST_KEYBOARD_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__host_keyboard_req__get_packed_size
+ (const ECS__HostKeyboardReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__host_keyboard_req__pack
+ (const ECS__HostKeyboardReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__host_keyboard_req__pack_to_buffer
+ (const ECS__HostKeyboardReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__HostKeyboardReq *
+ ecs__host_keyboard_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__HostKeyboardReq *)
+ protobuf_c_message_unpack (&ecs__host_keyboard_req__descriptor,
+ allocator, len, data);
+}
+void ecs__host_keyboard_req__free_unpacked
+ (ECS__HostKeyboardReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__host_keyboard_ntf__init
+ (ECS__HostKeyboardNtf *message)
+{
+ static ECS__HostKeyboardNtf init_value = ECS__HOST_KEYBOARD_NTF__INIT;
+ *message = init_value;
+}
+size_t ecs__host_keyboard_ntf__get_packed_size
+ (const ECS__HostKeyboardNtf *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__host_keyboard_ntf__pack
+ (const ECS__HostKeyboardNtf *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__host_keyboard_ntf__pack_to_buffer
+ (const ECS__HostKeyboardNtf *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__HostKeyboardNtf *
+ ecs__host_keyboard_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__HostKeyboardNtf *)
+ protobuf_c_message_unpack (&ecs__host_keyboard_ntf__descriptor,
+ allocator, len, data);
+}
+void ecs__host_keyboard_ntf__free_unpacked
+ (ECS__HostKeyboardNtf *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__control_msg__init
+ (ECS__ControlMsg *message)
+{
+ static ECS__ControlMsg init_value = ECS__CONTROL_MSG__INIT;
+ *message = init_value;
+}
+size_t ecs__control_msg__get_packed_size
+ (const ECS__ControlMsg *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__control_msg__pack
+ (const ECS__ControlMsg *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__control_msg__pack_to_buffer
+ (const ECS__ControlMsg *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__ControlMsg *
+ ecs__control_msg__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__ControlMsg *)
+ protobuf_c_message_unpack (&ecs__control_msg__descriptor,
+ allocator, len, data);
+}
+void ecs__control_msg__free_unpacked
+ (ECS__ControlMsg *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__control_ans__init
+ (ECS__ControlAns *message)
+{
+ static ECS__ControlAns init_value = ECS__CONTROL_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__control_ans__get_packed_size
+ (const ECS__ControlAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__control_ans__pack
+ (const ECS__ControlAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__control_ans__pack_to_buffer
+ (const ECS__ControlAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__ControlAns *
+ ecs__control_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__ControlAns *)
+ protobuf_c_message_unpack (&ecs__control_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__control_ans__free_unpacked
+ (ECS__ControlAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__control_ntf__init
+ (ECS__ControlNtf *message)
+{
+ static ECS__ControlNtf init_value = ECS__CONTROL_NTF__INIT;
+ *message = init_value;
+}
+size_t ecs__control_ntf__get_packed_size
+ (const ECS__ControlNtf *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__control_ntf__pack
+ (const ECS__ControlNtf *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__control_ntf__pack_to_buffer
+ (const ECS__ControlNtf *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__ControlNtf *
+ ecs__control_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__ControlNtf *)
+ protobuf_c_message_unpack (&ecs__control_ntf__descriptor,
+ allocator, len, data);
+}
+void ecs__control_ntf__free_unpacked
+ (ECS__ControlNtf *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__monitor_req__init
+ (ECS__MonitorReq *message)
+{
+ static ECS__MonitorReq init_value = ECS__MONITOR_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__monitor_req__get_packed_size
+ (const ECS__MonitorReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__monitor_req__pack
+ (const ECS__MonitorReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__monitor_req__pack_to_buffer
+ (const ECS__MonitorReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__MonitorReq *
+ ecs__monitor_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__MonitorReq *)
+ protobuf_c_message_unpack (&ecs__monitor_req__descriptor,
+ allocator, len, data);
+}
+void ecs__monitor_req__free_unpacked
+ (ECS__MonitorReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__monitor_ans__init
+ (ECS__MonitorAns *message)
+{
+ static ECS__MonitorAns init_value = ECS__MONITOR_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__monitor_ans__get_packed_size
+ (const ECS__MonitorAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__monitor_ans__pack
+ (const ECS__MonitorAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__monitor_ans__pack_to_buffer
+ (const ECS__MonitorAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__MonitorAns *
+ ecs__monitor_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__MonitorAns *)
+ protobuf_c_message_unpack (&ecs__monitor_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__monitor_ans__free_unpacked
+ (ECS__MonitorAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__monitor_ntf__init
+ (ECS__MonitorNtf *message)
+{
+ static ECS__MonitorNtf init_value = ECS__MONITOR_NTF__INIT;
+ *message = init_value;
+}
+size_t ecs__monitor_ntf__get_packed_size
+ (const ECS__MonitorNtf *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__monitor_ntf__pack
+ (const ECS__MonitorNtf *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__monitor_ntf__pack_to_buffer
+ (const ECS__MonitorNtf *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__MonitorNtf *
+ ecs__monitor_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__MonitorNtf *)
+ protobuf_c_message_unpack (&ecs__monitor_ntf__descriptor,
+ allocator, len, data);
+}
+void ecs__monitor_ntf__free_unpacked
+ (ECS__MonitorNtf *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__screen_dump_req__init
+ (ECS__ScreenDumpReq *message)
+{
+ static ECS__ScreenDumpReq init_value = ECS__SCREEN_DUMP_REQ__INIT;
+ *message = init_value;
+}
+size_t ecs__screen_dump_req__get_packed_size
+ (const ECS__ScreenDumpReq *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__screen_dump_req__pack
+ (const ECS__ScreenDumpReq *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__screen_dump_req__pack_to_buffer
+ (const ECS__ScreenDumpReq *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__ScreenDumpReq *
+ ecs__screen_dump_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__ScreenDumpReq *)
+ protobuf_c_message_unpack (&ecs__screen_dump_req__descriptor,
+ allocator, len, data);
+}
+void ecs__screen_dump_req__free_unpacked
+ (ECS__ScreenDumpReq *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__screen_dump_ans__init
+ (ECS__ScreenDumpAns *message)
+{
+ static ECS__ScreenDumpAns init_value = ECS__SCREEN_DUMP_ANS__INIT;
+ *message = init_value;
+}
+size_t ecs__screen_dump_ans__get_packed_size
+ (const ECS__ScreenDumpAns *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__screen_dump_ans__pack
+ (const ECS__ScreenDumpAns *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__screen_dump_ans__pack_to_buffer
+ (const ECS__ScreenDumpAns *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__ScreenDumpAns *
+ ecs__screen_dump_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__ScreenDumpAns *)
+ protobuf_c_message_unpack (&ecs__screen_dump_ans__descriptor,
+ allocator, len, data);
+}
+void ecs__screen_dump_ans__free_unpacked
+ (ECS__ScreenDumpAns *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void ecs__master__init
+ (ECS__Master *message)
+{
+ static ECS__Master init_value = ECS__MASTER__INIT;
+ *message = init_value;
+}
+size_t ecs__master__get_packed_size
+ (const ECS__Master *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t ecs__master__pack
+ (const ECS__Master *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t ecs__master__pack_to_buffer
+ (const ECS__Master *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+ECS__Master *
+ ecs__master__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (ECS__Master *)
+ protobuf_c_message_unpack (&ecs__master__descriptor,
+ allocator, len, data);
+}
+void ecs__master__free_unpacked
+ (ECS__Master *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor ecs__check_version_req__field_descriptors[1] =
+{
+ {
+ "version_str",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__CheckVersionReq, version_str),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__check_version_req__field_indices_by_name[] = {
+ 0, /* field[0] = version_str */
+};
+static const ProtobufCIntRange ecs__check_version_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__check_version_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.CheckVersionReq",
+ "CheckVersionReq",
+ "ECS__CheckVersionReq",
+ "ECS",
+ sizeof(ECS__CheckVersionReq),
+ 1,
+ ecs__check_version_req__field_descriptors,
+ ecs__check_version_req__field_indices_by_name,
+ 1, ecs__check_version_req__number_ranges,
+ (ProtobufCMessageInit) ecs__check_version_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__check_version_ans__field_descriptors[2] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__CheckVersionAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "version_str",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__CheckVersionAns, version_str),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__check_version_ans__field_indices_by_name[] = {
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = version_str */
+};
+static const ProtobufCIntRange ecs__check_version_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor ecs__check_version_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.CheckVersionAns",
+ "CheckVersionAns",
+ "ECS__CheckVersionAns",
+ "ECS",
+ sizeof(ECS__CheckVersionAns),
+ 2,
+ ecs__check_version_ans__field_descriptors,
+ ecs__check_version_ans__field_indices_by_name,
+ 1, ecs__check_version_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__check_version_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__keep_alive_req__field_descriptors[1] =
+{
+ {
+ "time_str",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__KeepAliveReq, time_str),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__keep_alive_req__field_indices_by_name[] = {
+ 0, /* field[0] = time_str */
+};
+static const ProtobufCIntRange ecs__keep_alive_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__keep_alive_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.KeepAliveReq",
+ "KeepAliveReq",
+ "ECS__KeepAliveReq",
+ "ECS",
+ sizeof(ECS__KeepAliveReq),
+ 1,
+ ecs__keep_alive_req__field_descriptors,
+ ecs__keep_alive_req__field_indices_by_name,
+ 1, ecs__keep_alive_req__number_ranges,
+ (ProtobufCMessageInit) ecs__keep_alive_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__keep_alive_ans__field_descriptors[1] =
+{
+ {
+ "time_str",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__KeepAliveAns, time_str),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__keep_alive_ans__field_indices_by_name[] = {
+ 0, /* field[0] = time_str */
+};
+static const ProtobufCIntRange ecs__keep_alive_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__keep_alive_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.KeepAliveAns",
+ "KeepAliveAns",
+ "ECS__KeepAliveAns",
+ "ECS",
+ sizeof(ECS__KeepAliveAns),
+ 1,
+ ecs__keep_alive_ans__field_descriptors,
+ ecs__keep_alive_ans__field_indices_by_name,
+ 1, ecs__keep_alive_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__keep_alive_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__start_req__field_descriptors[0] =
+{
+};
+static const unsigned ecs__start_req__field_indices_by_name[] = {
+};
+#define ecs__start_req__number_ranges NULL
+const ProtobufCMessageDescriptor ecs__start_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.StartReq",
+ "StartReq",
+ "ECS__StartReq",
+ "ECS",
+ sizeof(ECS__StartReq),
+ 0,
+ ecs__start_req__field_descriptors,
+ ecs__start_req__field_indices_by_name,
+ 0, ecs__start_req__number_ranges,
+ (ProtobufCMessageInit) ecs__start_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__start_ans__field_descriptors[3] =
+{
+ {
+ "host_keyboard_onoff",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, has_host_keyboard_onoff),
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, host_keyboard_onoff),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "earjack_onoff",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, has_earjack_onoff),
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, earjack_onoff),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "camera_onoff",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, has_camera_onoff),
+ PROTOBUF_C_OFFSETOF(ECS__StartAns, camera_onoff),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__start_ans__field_indices_by_name[] = {
+ 2, /* field[2] = camera_onoff */
+ 1, /* field[1] = earjack_onoff */
+ 0, /* field[0] = host_keyboard_onoff */
+};
+static const ProtobufCIntRange ecs__start_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor ecs__start_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.StartAns",
+ "StartAns",
+ "ECS__StartAns",
+ "ECS",
+ sizeof(ECS__StartAns),
+ 3,
+ ecs__start_ans__field_descriptors,
+ ecs__start_ans__field_indices_by_name,
+ 1, ecs__start_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__start_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__injector_req__field_descriptors[5] =
+{
+ {
+ "category",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__InjectorReq, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__injector_req__field_indices_by_name[] = {
+ 3, /* field[3] = action */
+ 0, /* field[0] = category */
+ 4, /* field[4] = data */
+ 2, /* field[2] = group */
+ 1, /* field[1] = length */
+};
+static const ProtobufCIntRange ecs__injector_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 5 }
+};
+const ProtobufCMessageDescriptor ecs__injector_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.InjectorReq",
+ "InjectorReq",
+ "ECS__InjectorReq",
+ "ECS",
+ sizeof(ECS__InjectorReq),
+ 5,
+ ecs__injector_req__field_descriptors,
+ ecs__injector_req__field_indices_by_name,
+ 1, ecs__injector_req__number_ranges,
+ (ProtobufCMessageInit) ecs__injector_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__injector_ans__field_descriptors[7] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errstr",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, errstr),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "category",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 5,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 6,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__InjectorAns, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__injector_ans__field_indices_by_name[] = {
+ 5, /* field[5] = action */
+ 2, /* field[2] = category */
+ 6, /* field[6] = data */
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errstr */
+ 4, /* field[4] = group */
+ 3, /* field[3] = length */
+};
+static const ProtobufCIntRange ecs__injector_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 7 }
+};
+const ProtobufCMessageDescriptor ecs__injector_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.InjectorAns",
+ "InjectorAns",
+ "ECS__InjectorAns",
+ "ECS",
+ sizeof(ECS__InjectorAns),
+ 7,
+ ecs__injector_ans__field_descriptors,
+ ecs__injector_ans__field_indices_by_name,
+ 1, ecs__injector_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__injector_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__injector_ntf__field_descriptors[5] =
+{
+ {
+ "category",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__injector_ntf__field_indices_by_name[] = {
+ 3, /* field[3] = action */
+ 0, /* field[0] = category */
+ 4, /* field[4] = data */
+ 2, /* field[2] = group */
+ 1, /* field[1] = length */
+};
+static const ProtobufCIntRange ecs__injector_ntf__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 5 }
+};
+const ProtobufCMessageDescriptor ecs__injector_ntf__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.InjectorNtf",
+ "InjectorNtf",
+ "ECS__InjectorNtf",
+ "ECS",
+ sizeof(ECS__InjectorNtf),
+ 5,
+ ecs__injector_ntf__field_descriptors,
+ ecs__injector_ntf__field_indices_by_name,
+ 1, ecs__injector_ntf__number_ranges,
+ (ProtobufCMessageInit) ecs__injector_ntf__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__device_req__field_descriptors[5] =
+{
+ {
+ "category",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__DeviceReq, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__device_req__field_indices_by_name[] = {
+ 3, /* field[3] = action */
+ 0, /* field[0] = category */
+ 4, /* field[4] = data */
+ 2, /* field[2] = group */
+ 1, /* field[1] = length */
+};
+static const ProtobufCIntRange ecs__device_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 5 }
+};
+const ProtobufCMessageDescriptor ecs__device_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.DeviceReq",
+ "DeviceReq",
+ "ECS__DeviceReq",
+ "ECS",
+ sizeof(ECS__DeviceReq),
+ 5,
+ ecs__device_req__field_descriptors,
+ ecs__device_req__field_indices_by_name,
+ 1, ecs__device_req__number_ranges,
+ (ProtobufCMessageInit) ecs__device_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__device_ans__field_descriptors[7] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errstr",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, errstr),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "category",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 5,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 6,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__DeviceAns, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__device_ans__field_indices_by_name[] = {
+ 5, /* field[5] = action */
+ 2, /* field[2] = category */
+ 6, /* field[6] = data */
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errstr */
+ 4, /* field[4] = group */
+ 3, /* field[3] = length */
+};
+static const ProtobufCIntRange ecs__device_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 7 }
+};
+const ProtobufCMessageDescriptor ecs__device_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.DeviceAns",
+ "DeviceAns",
+ "ECS__DeviceAns",
+ "ECS",
+ sizeof(ECS__DeviceAns),
+ 7,
+ ecs__device_ans__field_descriptors,
+ ecs__device_ans__field_indices_by_name,
+ 1, ecs__device_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__device_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__device_ntf__field_descriptors[5] =
+{
+ {
+ "category",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "length",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, length),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "group",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, group),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "action",
+ 4,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, action),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__device_ntf__field_indices_by_name[] = {
+ 3, /* field[3] = action */
+ 0, /* field[0] = category */
+ 4, /* field[4] = data */
+ 2, /* field[2] = group */
+ 1, /* field[1] = length */
+};
+static const ProtobufCIntRange ecs__device_ntf__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 5 }
+};
+const ProtobufCMessageDescriptor ecs__device_ntf__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.DeviceNtf",
+ "DeviceNtf",
+ "ECS__DeviceNtf",
+ "ECS",
+ sizeof(ECS__DeviceNtf),
+ 5,
+ ecs__device_ntf__field_descriptors,
+ ecs__device_ntf__field_indices_by_name,
+ 1, ecs__device_ntf__number_ranges,
+ (ProtobufCMessageInit) ecs__device_ntf__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__host_keyboard_req__field_descriptors[1] =
+{
+ {
+ "ison",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardReq, has_ison),
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardReq, ison),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__host_keyboard_req__field_indices_by_name[] = {
+ 0, /* field[0] = ison */
+};
+static const ProtobufCIntRange ecs__host_keyboard_req__number_ranges[1 + 1] =
+{
+ { 3, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__host_keyboard_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.HostKeyboardReq",
+ "HostKeyboardReq",
+ "ECS__HostKeyboardReq",
+ "ECS",
+ sizeof(ECS__HostKeyboardReq),
+ 1,
+ ecs__host_keyboard_req__field_descriptors,
+ ecs__host_keyboard_req__field_indices_by_name,
+ 1, ecs__host_keyboard_req__number_ranges,
+ (ProtobufCMessageInit) ecs__host_keyboard_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__host_keyboard_ntf__field_descriptors[3] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errstr",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, errstr),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ison",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, has_ison),
+ PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, ison),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__host_keyboard_ntf__field_indices_by_name[] = {
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errstr */
+ 2, /* field[2] = ison */
+};
+static const ProtobufCIntRange ecs__host_keyboard_ntf__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor ecs__host_keyboard_ntf__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.HostKeyboardNtf",
+ "HostKeyboardNtf",
+ "ECS__HostKeyboardNtf",
+ "ECS",
+ sizeof(ECS__HostKeyboardNtf),
+ 3,
+ ecs__host_keyboard_ntf__field_descriptors,
+ ecs__host_keyboard_ntf__field_indices_by_name,
+ 1, ecs__host_keyboard_ntf__number_ranges,
+ (ProtobufCMessageInit) ecs__host_keyboard_ntf__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+const ProtobufCEnumValue ecs__control_msg__control_type__enum_values_by_number[2] =
+{
+ { "HOSTKEYBOARD_REQ", "ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ", 2 },
+ { "HOSTKEYBOARD_NTF", "ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF", 3 },
+};
+static const ProtobufCIntRange ecs__control_msg__control_type__value_ranges[] = {
+{2, 0},{0, 2}
+};
+const ProtobufCEnumValueIndex ecs__control_msg__control_type__enum_values_by_name[2] =
+{
+ { "HOSTKEYBOARD_NTF", 1 },
+ { "HOSTKEYBOARD_REQ", 0 },
+};
+const ProtobufCEnumDescriptor ecs__control_msg__control_type__descriptor =
+{
+ PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,
+ "ECS.ControlMsg.ControlType",
+ "ControlType",
+ "ECS__ControlMsg__ControlType",
+ "ECS",
+ 2,
+ ecs__control_msg__control_type__enum_values_by_number,
+ 2,
+ ecs__control_msg__control_type__enum_values_by_name,
+ 1,
+ ecs__control_msg__control_type__value_ranges,
+ NULL,NULL,NULL,NULL /* reserved[1234] */
+};
+static const ProtobufCFieldDescriptor ecs__control_msg__field_descriptors[3] =
+{
+ {
+ "type",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_ENUM,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlMsg, type),
+ &ecs__control_msg__control_type__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "hostkeyboard_req",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlMsg, hostkeyboard_req),
+ &ecs__host_keyboard_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "hostkeyboard_ntf",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlMsg, hostkeyboard_ntf),
+ &ecs__host_keyboard_ntf__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__control_msg__field_indices_by_name[] = {
+ 2, /* field[2] = hostkeyboard_ntf */
+ 1, /* field[1] = hostkeyboard_req */
+ 0, /* field[0] = type */
+};
+static const ProtobufCIntRange ecs__control_msg__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor ecs__control_msg__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.ControlMsg",
+ "ControlMsg",
+ "ECS__ControlMsg",
+ "ECS",
+ sizeof(ECS__ControlMsg),
+ 3,
+ ecs__control_msg__field_descriptors,
+ ecs__control_msg__field_indices_by_name,
+ 1, ecs__control_msg__number_ranges,
+ (ProtobufCMessageInit) ecs__control_msg__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__control_ans__field_descriptors[2] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errmsg",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlAns, errmsg),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__control_ans__field_indices_by_name[] = {
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errmsg */
+};
+static const ProtobufCIntRange ecs__control_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor ecs__control_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.ControlAns",
+ "ControlAns",
+ "ECS__ControlAns",
+ "ECS",
+ sizeof(ECS__ControlAns),
+ 2,
+ ecs__control_ans__field_descriptors,
+ ecs__control_ans__field_indices_by_name,
+ 1, ecs__control_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__control_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__control_ntf__field_descriptors[3] =
+{
+ {
+ "category",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlNtf, category),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "command",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ControlNtf, command),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__ControlNtf, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__ControlNtf, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__control_ntf__field_indices_by_name[] = {
+ 0, /* field[0] = category */
+ 1, /* field[1] = command */
+ 2, /* field[2] = data */
+};
+static const ProtobufCIntRange ecs__control_ntf__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 3 }
+};
+const ProtobufCMessageDescriptor ecs__control_ntf__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.ControlNtf",
+ "ControlNtf",
+ "ECS__ControlNtf",
+ "ECS",
+ sizeof(ECS__ControlNtf),
+ 3,
+ ecs__control_ntf__field_descriptors,
+ ecs__control_ntf__field_indices_by_name,
+ 1, ecs__control_ntf__number_ranges,
+ (ProtobufCMessageInit) ecs__control_ntf__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__monitor_req__field_descriptors[1] =
+{
+ {
+ "command",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__MonitorReq, command),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__monitor_req__field_indices_by_name[] = {
+ 0, /* field[0] = command */
+};
+static const ProtobufCIntRange ecs__monitor_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__monitor_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.MonitorReq",
+ "MonitorReq",
+ "ECS__MonitorReq",
+ "ECS",
+ sizeof(ECS__MonitorReq),
+ 1,
+ ecs__monitor_req__field_descriptors,
+ ecs__monitor_req__field_indices_by_name,
+ 1, ecs__monitor_req__number_ranges,
+ (ProtobufCMessageInit) ecs__monitor_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__monitor_ans__field_descriptors[4] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__MonitorAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errmsg",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__MonitorAns, errmsg),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "command",
+ 3,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__MonitorAns, command),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__MonitorAns, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__MonitorAns, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__monitor_ans__field_indices_by_name[] = {
+ 2, /* field[2] = command */
+ 3, /* field[3] = data */
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errmsg */
+};
+static const ProtobufCIntRange ecs__monitor_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 4 }
+};
+const ProtobufCMessageDescriptor ecs__monitor_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.MonitorAns",
+ "MonitorAns",
+ "ECS__MonitorAns",
+ "ECS",
+ sizeof(ECS__MonitorAns),
+ 4,
+ ecs__monitor_ans__field_descriptors,
+ ecs__monitor_ans__field_indices_by_name,
+ 1, ecs__monitor_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__monitor_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__monitor_ntf__field_descriptors[2] =
+{
+ {
+ "command",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, command),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "data",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_BYTES,
+ PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, has_data),
+ PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, data),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__monitor_ntf__field_indices_by_name[] = {
+ 0, /* field[0] = command */
+ 1, /* field[1] = data */
+};
+static const ProtobufCIntRange ecs__monitor_ntf__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor ecs__monitor_ntf__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.MonitorNtf",
+ "MonitorNtf",
+ "ECS__MonitorNtf",
+ "ECS",
+ sizeof(ECS__MonitorNtf),
+ 2,
+ ecs__monitor_ntf__field_descriptors,
+ ecs__monitor_ntf__field_indices_by_name,
+ 1, ecs__monitor_ntf__number_ranges,
+ (ProtobufCMessageInit) ecs__monitor_ntf__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__screen_dump_req__field_descriptors[1] =
+{
+ {
+ "output_path",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ScreenDumpReq, output_path),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__screen_dump_req__field_indices_by_name[] = {
+ 0, /* field[0] = output_path */
+};
+static const ProtobufCIntRange ecs__screen_dump_req__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor ecs__screen_dump_req__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.ScreenDumpReq",
+ "ScreenDumpReq",
+ "ECS__ScreenDumpReq",
+ "ECS",
+ sizeof(ECS__ScreenDumpReq),
+ 1,
+ ecs__screen_dump_req__field_descriptors,
+ ecs__screen_dump_req__field_indices_by_name,
+ 1, ecs__screen_dump_req__number_ranges,
+ (ProtobufCMessageInit) ecs__screen_dump_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+static const ProtobufCFieldDescriptor ecs__screen_dump_ans__field_descriptors[2] =
+{
+ {
+ "errcode",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_INT32,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ScreenDumpAns, errcode),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "errmsg",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__ScreenDumpAns, errmsg),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__screen_dump_ans__field_indices_by_name[] = {
+ 0, /* field[0] = errcode */
+ 1, /* field[1] = errmsg */
+};
+static const ProtobufCIntRange ecs__screen_dump_ans__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor ecs__screen_dump_ans__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.ScreenDumpAns",
+ "ScreenDumpAns",
+ "ECS__ScreenDumpAns",
+ "ECS",
+ sizeof(ECS__ScreenDumpAns),
+ 2,
+ ecs__screen_dump_ans__field_descriptors,
+ ecs__screen_dump_ans__field_indices_by_name,
+ 1, ecs__screen_dump_ans__number_ranges,
+ (ProtobufCMessageInit) ecs__screen_dump_ans__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+const ProtobufCEnumValue ecs__master__type__enum_values_by_number[20] =
+{
+ { "CHECKVERSION_REQ", "ECS__MASTER__TYPE__CHECKVERSION_REQ", 2 },
+ { "CHECKVERSION_ANS", "ECS__MASTER__TYPE__CHECKVERSION_ANS", 3 },
+ { "KEEPALIVE_REQ", "ECS__MASTER__TYPE__KEEPALIVE_REQ", 4 },
+ { "KEEPALIVE_ANS", "ECS__MASTER__TYPE__KEEPALIVE_ANS", 5 },
+ { "START_REQ", "ECS__MASTER__TYPE__START_REQ", 6 },
+ { "START_ANS", "ECS__MASTER__TYPE__START_ANS", 7 },
+ { "INJECTOR_REQ", "ECS__MASTER__TYPE__INJECTOR_REQ", 8 },
+ { "INJECTOR_ANS", "ECS__MASTER__TYPE__INJECTOR_ANS", 9 },
+ { "INJECTOR_NTF", "ECS__MASTER__TYPE__INJECTOR_NTF", 10 },
+ { "DEVICE_REQ", "ECS__MASTER__TYPE__DEVICE_REQ", 11 },
+ { "DEVICE_ANS", "ECS__MASTER__TYPE__DEVICE_ANS", 12 },
+ { "DEVICE_NTF", "ECS__MASTER__TYPE__DEVICE_NTF", 13 },
+ { "CONTROL_MSG", "ECS__MASTER__TYPE__CONTROL_MSG", 14 },
+ { "CONTROL_ANS", "ECS__MASTER__TYPE__CONTROL_ANS", 15 },
+ { "CONTROL_NTF", "ECS__MASTER__TYPE__CONTROL_NTF", 16 },
+ { "MONITOR_REQ", "ECS__MASTER__TYPE__MONITOR_REQ", 17 },
+ { "MONITOR_ANS", "ECS__MASTER__TYPE__MONITOR_ANS", 18 },
+ { "MONITOR_NTF", "ECS__MASTER__TYPE__MONITOR_NTF", 19 },
+ { "SCREEN_DUMP_REQ", "ECS__MASTER__TYPE__SCREEN_DUMP_REQ", 20 },
+ { "SCREEN_DUMP_ANS", "ECS__MASTER__TYPE__SCREEN_DUMP_ANS", 21 },
+};
+static const ProtobufCIntRange ecs__master__type__value_ranges[] = {
+{2, 0},{0, 20}
+};
+const ProtobufCEnumValueIndex ecs__master__type__enum_values_by_name[20] =
+{
+ { "CHECKVERSION_ANS", 1 },
+ { "CHECKVERSION_REQ", 0 },
+ { "CONTROL_ANS", 13 },
+ { "CONTROL_MSG", 12 },
+ { "CONTROL_NTF", 14 },
+ { "DEVICE_ANS", 10 },
+ { "DEVICE_NTF", 11 },
+ { "DEVICE_REQ", 9 },
+ { "INJECTOR_ANS", 7 },
+ { "INJECTOR_NTF", 8 },
+ { "INJECTOR_REQ", 6 },
+ { "KEEPALIVE_ANS", 3 },
+ { "KEEPALIVE_REQ", 2 },
+ { "MONITOR_ANS", 16 },
+ { "MONITOR_NTF", 17 },
+ { "MONITOR_REQ", 15 },
+ { "SCREEN_DUMP_ANS", 19 },
+ { "SCREEN_DUMP_REQ", 18 },
+ { "START_ANS", 5 },
+ { "START_REQ", 4 },
+};
+const ProtobufCEnumDescriptor ecs__master__type__descriptor =
+{
+ PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,
+ "ECS.Master.Type",
+ "Type",
+ "ECS__Master__Type",
+ "ECS",
+ 20,
+ ecs__master__type__enum_values_by_number,
+ 20,
+ ecs__master__type__enum_values_by_name,
+ 1,
+ ecs__master__type__value_ranges,
+ NULL,NULL,NULL,NULL /* reserved[1234] */
+};
+static const ProtobufCFieldDescriptor ecs__master__field_descriptors[21] =
+{
+ {
+ "type",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_ENUM,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, type),
+ &ecs__master__type__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "checkversion_req",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, checkversion_req),
+ &ecs__check_version_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "checkversion_ans",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, checkversion_ans),
+ &ecs__check_version_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "keepalive_req",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, keepalive_req),
+ &ecs__keep_alive_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "keepalive_ans",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, keepalive_ans),
+ &ecs__keep_alive_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "start_req",
+ 6,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, start_req),
+ &ecs__start_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "start_ans",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, start_ans),
+ &ecs__start_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "injector_req",
+ 8,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, injector_req),
+ &ecs__injector_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "injector_ans",
+ 9,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, injector_ans),
+ &ecs__injector_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "injector_ntf",
+ 10,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, injector_ntf),
+ &ecs__injector_ntf__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "device_req",
+ 11,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, device_req),
+ &ecs__device_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "device_ans",
+ 12,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, device_ans),
+ &ecs__device_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "device_ntf",
+ 13,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, device_ntf),
+ &ecs__device_ntf__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "control_msg",
+ 14,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, control_msg),
+ &ecs__control_msg__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "control_ans",
+ 15,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, control_ans),
+ &ecs__control_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "control_ntf",
+ 16,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, control_ntf),
+ &ecs__control_ntf__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "monitor_req",
+ 17,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, monitor_req),
+ &ecs__monitor_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "monitor_ans",
+ 18,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, monitor_ans),
+ &ecs__monitor_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "monitor_ntf",
+ 19,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, monitor_ntf),
+ &ecs__monitor_ntf__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "screen_dump_req",
+ 20,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, screen_dump_req),
+ &ecs__screen_dump_req__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "screen_dump_ans",
+ 21,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_MESSAGE,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(ECS__Master, screen_dump_ans),
+ &ecs__screen_dump_ans__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned ecs__master__field_indices_by_name[] = {
+ 2, /* field[2] = checkversion_ans */
+ 1, /* field[1] = checkversion_req */
+ 14, /* field[14] = control_ans */
+ 13, /* field[13] = control_msg */
+ 15, /* field[15] = control_ntf */
+ 11, /* field[11] = device_ans */
+ 12, /* field[12] = device_ntf */
+ 10, /* field[10] = device_req */
+ 8, /* field[8] = injector_ans */
+ 9, /* field[9] = injector_ntf */
+ 7, /* field[7] = injector_req */
+ 4, /* field[4] = keepalive_ans */
+ 3, /* field[3] = keepalive_req */
+ 17, /* field[17] = monitor_ans */
+ 18, /* field[18] = monitor_ntf */
+ 16, /* field[16] = monitor_req */
+ 20, /* field[20] = screen_dump_ans */
+ 19, /* field[19] = screen_dump_req */
+ 6, /* field[6] = start_ans */
+ 5, /* field[5] = start_req */
+ 0, /* field[0] = type */
+};
+static const ProtobufCIntRange ecs__master__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 21 }
+};
+const ProtobufCMessageDescriptor ecs__master__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "ECS.Master",
+ "Master",
+ "ECS__Master",
+ "ECS",
+ sizeof(ECS__Master),
+ 21,
+ ecs__master__field_descriptors,
+ ecs__master__field_indices_by_name,
+ 1, ecs__master__number_ranges,
+ (ProtobufCMessageInit) ecs__master__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
--- /dev/null
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+
+#ifndef PROTOBUF_C_ecs_2eproto__INCLUDED
+#define PROTOBUF_C_ecs_2eproto__INCLUDED
+
+#include "../../../distrib/protobuf/protobuf-c.h"
+
+PROTOBUF_C_BEGIN_DECLS
+
+
+typedef struct _ECS__CheckVersionReq ECS__CheckVersionReq;
+typedef struct _ECS__CheckVersionAns ECS__CheckVersionAns;
+typedef struct _ECS__KeepAliveReq ECS__KeepAliveReq;
+typedef struct _ECS__KeepAliveAns ECS__KeepAliveAns;
+typedef struct _ECS__StartReq ECS__StartReq;
+typedef struct _ECS__StartAns ECS__StartAns;
+typedef struct _ECS__InjectorReq ECS__InjectorReq;
+typedef struct _ECS__InjectorAns ECS__InjectorAns;
+typedef struct _ECS__InjectorNtf ECS__InjectorNtf;
+typedef struct _ECS__DeviceReq ECS__DeviceReq;
+typedef struct _ECS__DeviceAns ECS__DeviceAns;
+typedef struct _ECS__DeviceNtf ECS__DeviceNtf;
+typedef struct _ECS__HostKeyboardReq ECS__HostKeyboardReq;
+typedef struct _ECS__HostKeyboardNtf ECS__HostKeyboardNtf;
+typedef struct _ECS__ControlMsg ECS__ControlMsg;
+typedef struct _ECS__ControlAns ECS__ControlAns;
+typedef struct _ECS__ControlNtf ECS__ControlNtf;
+typedef struct _ECS__MonitorReq ECS__MonitorReq;
+typedef struct _ECS__MonitorAns ECS__MonitorAns;
+typedef struct _ECS__MonitorNtf ECS__MonitorNtf;
+typedef struct _ECS__ScreenDumpReq ECS__ScreenDumpReq;
+typedef struct _ECS__ScreenDumpAns ECS__ScreenDumpAns;
+typedef struct _ECS__Master ECS__Master;
+
+
+/* --- enums --- */
+
+typedef enum _ECS__ControlMsg__ControlType {
+ ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ = 2,
+ ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF = 3
+} ECS__ControlMsg__ControlType;
+typedef enum _ECS__Master__Type {
+ ECS__MASTER__TYPE__CHECKVERSION_REQ = 2,
+ ECS__MASTER__TYPE__CHECKVERSION_ANS = 3,
+ ECS__MASTER__TYPE__KEEPALIVE_REQ = 4,
+ ECS__MASTER__TYPE__KEEPALIVE_ANS = 5,
+ ECS__MASTER__TYPE__START_REQ = 6,
+ ECS__MASTER__TYPE__START_ANS = 7,
+ ECS__MASTER__TYPE__INJECTOR_REQ = 8,
+ ECS__MASTER__TYPE__INJECTOR_ANS = 9,
+ ECS__MASTER__TYPE__INJECTOR_NTF = 10,
+ ECS__MASTER__TYPE__DEVICE_REQ = 11,
+ ECS__MASTER__TYPE__DEVICE_ANS = 12,
+ ECS__MASTER__TYPE__DEVICE_NTF = 13,
+ ECS__MASTER__TYPE__CONTROL_MSG = 14,
+ ECS__MASTER__TYPE__CONTROL_ANS = 15,
+ ECS__MASTER__TYPE__CONTROL_NTF = 16,
+ ECS__MASTER__TYPE__MONITOR_REQ = 17,
+ ECS__MASTER__TYPE__MONITOR_ANS = 18,
+ ECS__MASTER__TYPE__MONITOR_NTF = 19,
+ ECS__MASTER__TYPE__SCREEN_DUMP_REQ = 20,
+ ECS__MASTER__TYPE__SCREEN_DUMP_ANS = 21
+} ECS__Master__Type;
+
+/* --- messages --- */
+
+struct _ECS__CheckVersionReq
+{
+ ProtobufCMessage base;
+ char *version_str;
+};
+#define ECS__CHECK_VERSION_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__check_version_req__descriptor) \
+ , NULL }
+
+
+struct _ECS__CheckVersionAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *version_str;
+};
+#define ECS__CHECK_VERSION_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__check_version_ans__descriptor) \
+ , 0, NULL }
+
+
+struct _ECS__KeepAliveReq
+{
+ ProtobufCMessage base;
+ char *time_str;
+};
+#define ECS__KEEP_ALIVE_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__keep_alive_req__descriptor) \
+ , NULL }
+
+
+struct _ECS__KeepAliveAns
+{
+ ProtobufCMessage base;
+ char *time_str;
+};
+#define ECS__KEEP_ALIVE_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__keep_alive_ans__descriptor) \
+ , NULL }
+
+
+struct _ECS__StartReq
+{
+ ProtobufCMessage base;
+};
+#define ECS__START_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__start_req__descriptor) \
+ }
+
+
+struct _ECS__StartAns
+{
+ ProtobufCMessage base;
+ protobuf_c_boolean has_host_keyboard_onoff;
+ int32_t host_keyboard_onoff;
+ protobuf_c_boolean has_earjack_onoff;
+ int32_t earjack_onoff;
+ protobuf_c_boolean has_camera_onoff;
+ int32_t camera_onoff;
+};
+#define ECS__START_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__start_ans__descriptor) \
+ , 0,0, 0,0, 0,0 }
+
+
+struct _ECS__InjectorReq
+{
+ ProtobufCMessage base;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__INJECTOR_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_req__descriptor) \
+ , NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__InjectorAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errstr;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__INJECTOR_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_ans__descriptor) \
+ , 0, NULL, NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__InjectorNtf
+{
+ ProtobufCMessage base;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__INJECTOR_NTF__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_ntf__descriptor) \
+ , NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__DeviceReq
+{
+ ProtobufCMessage base;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__DEVICE_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__device_req__descriptor) \
+ , NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__DeviceAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errstr;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__DEVICE_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__device_ans__descriptor) \
+ , 0, NULL, NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__DeviceNtf
+{
+ ProtobufCMessage base;
+ char *category;
+ int32_t length;
+ int32_t group;
+ int32_t action;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__DEVICE_NTF__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__device_ntf__descriptor) \
+ , NULL, 0, 0, 0, 0,{0,NULL} }
+
+
+struct _ECS__HostKeyboardReq
+{
+ ProtobufCMessage base;
+ protobuf_c_boolean has_ison;
+ int32_t ison;
+};
+#define ECS__HOST_KEYBOARD_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__host_keyboard_req__descriptor) \
+ , 0,0 }
+
+
+struct _ECS__HostKeyboardNtf
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errstr;
+ protobuf_c_boolean has_ison;
+ int32_t ison;
+};
+#define ECS__HOST_KEYBOARD_NTF__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__host_keyboard_ntf__descriptor) \
+ , 0, NULL, 0,0 }
+
+
+struct _ECS__ControlMsg
+{
+ ProtobufCMessage base;
+ ECS__ControlMsg__ControlType type;
+ ECS__HostKeyboardReq *hostkeyboard_req;
+ ECS__HostKeyboardNtf *hostkeyboard_ntf;
+};
+#define ECS__CONTROL_MSG__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__control_msg__descriptor) \
+ , 0, NULL, NULL }
+
+
+struct _ECS__ControlAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errmsg;
+};
+#define ECS__CONTROL_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__control_ans__descriptor) \
+ , 0, NULL }
+
+
+struct _ECS__ControlNtf
+{
+ ProtobufCMessage base;
+ char *category;
+ char *command;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__CONTROL_NTF__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__control_ntf__descriptor) \
+ , NULL, NULL, 0,{0,NULL} }
+
+
+struct _ECS__MonitorReq
+{
+ ProtobufCMessage base;
+ char *command;
+};
+#define ECS__MONITOR_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_req__descriptor) \
+ , NULL }
+
+
+struct _ECS__MonitorAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errmsg;
+ char *command;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__MONITOR_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_ans__descriptor) \
+ , 0, NULL, NULL, 0,{0,NULL} }
+
+
+struct _ECS__MonitorNtf
+{
+ ProtobufCMessage base;
+ char *command;
+ protobuf_c_boolean has_data;
+ ProtobufCBinaryData data;
+};
+#define ECS__MONITOR_NTF__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_ntf__descriptor) \
+ , NULL, 0,{0,NULL} }
+
+
+struct _ECS__ScreenDumpReq
+{
+ ProtobufCMessage base;
+ char *output_path;
+};
+#define ECS__SCREEN_DUMP_REQ__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__screen_dump_req__descriptor) \
+ , NULL }
+
+
+struct _ECS__ScreenDumpAns
+{
+ ProtobufCMessage base;
+ int32_t errcode;
+ char *errmsg;
+};
+#define ECS__SCREEN_DUMP_ANS__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__screen_dump_ans__descriptor) \
+ , 0, NULL }
+
+
+struct _ECS__Master
+{
+ ProtobufCMessage base;
+ ECS__Master__Type type;
+ ECS__CheckVersionReq *checkversion_req;
+ ECS__CheckVersionAns *checkversion_ans;
+ ECS__KeepAliveReq *keepalive_req;
+ ECS__KeepAliveAns *keepalive_ans;
+ ECS__StartReq *start_req;
+ ECS__StartAns *start_ans;
+ ECS__InjectorReq *injector_req;
+ ECS__InjectorAns *injector_ans;
+ ECS__InjectorNtf *injector_ntf;
+ ECS__DeviceReq *device_req;
+ ECS__DeviceAns *device_ans;
+ ECS__DeviceNtf *device_ntf;
+ ECS__ControlMsg *control_msg;
+ ECS__ControlAns *control_ans;
+ ECS__ControlNtf *control_ntf;
+ ECS__MonitorReq *monitor_req;
+ ECS__MonitorAns *monitor_ans;
+ ECS__MonitorNtf *monitor_ntf;
+ ECS__ScreenDumpReq *screen_dump_req;
+ ECS__ScreenDumpAns *screen_dump_ans;
+};
+#define ECS__MASTER__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&ecs__master__descriptor) \
+ , 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
+
+
+/* ECS__CheckVersionReq methods */
+void ecs__check_version_req__init
+ (ECS__CheckVersionReq *message);
+size_t ecs__check_version_req__get_packed_size
+ (const ECS__CheckVersionReq *message);
+size_t ecs__check_version_req__pack
+ (const ECS__CheckVersionReq *message,
+ uint8_t *out);
+size_t ecs__check_version_req__pack_to_buffer
+ (const ECS__CheckVersionReq *message,
+ ProtobufCBuffer *buffer);
+ECS__CheckVersionReq *
+ ecs__check_version_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__check_version_req__free_unpacked
+ (ECS__CheckVersionReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__CheckVersionAns methods */
+void ecs__check_version_ans__init
+ (ECS__CheckVersionAns *message);
+size_t ecs__check_version_ans__get_packed_size
+ (const ECS__CheckVersionAns *message);
+size_t ecs__check_version_ans__pack
+ (const ECS__CheckVersionAns *message,
+ uint8_t *out);
+size_t ecs__check_version_ans__pack_to_buffer
+ (const ECS__CheckVersionAns *message,
+ ProtobufCBuffer *buffer);
+ECS__CheckVersionAns *
+ ecs__check_version_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__check_version_ans__free_unpacked
+ (ECS__CheckVersionAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__KeepAliveReq methods */
+void ecs__keep_alive_req__init
+ (ECS__KeepAliveReq *message);
+size_t ecs__keep_alive_req__get_packed_size
+ (const ECS__KeepAliveReq *message);
+size_t ecs__keep_alive_req__pack
+ (const ECS__KeepAliveReq *message,
+ uint8_t *out);
+size_t ecs__keep_alive_req__pack_to_buffer
+ (const ECS__KeepAliveReq *message,
+ ProtobufCBuffer *buffer);
+ECS__KeepAliveReq *
+ ecs__keep_alive_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__keep_alive_req__free_unpacked
+ (ECS__KeepAliveReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__KeepAliveAns methods */
+void ecs__keep_alive_ans__init
+ (ECS__KeepAliveAns *message);
+size_t ecs__keep_alive_ans__get_packed_size
+ (const ECS__KeepAliveAns *message);
+size_t ecs__keep_alive_ans__pack
+ (const ECS__KeepAliveAns *message,
+ uint8_t *out);
+size_t ecs__keep_alive_ans__pack_to_buffer
+ (const ECS__KeepAliveAns *message,
+ ProtobufCBuffer *buffer);
+ECS__KeepAliveAns *
+ ecs__keep_alive_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__keep_alive_ans__free_unpacked
+ (ECS__KeepAliveAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__StartReq methods */
+void ecs__start_req__init
+ (ECS__StartReq *message);
+size_t ecs__start_req__get_packed_size
+ (const ECS__StartReq *message);
+size_t ecs__start_req__pack
+ (const ECS__StartReq *message,
+ uint8_t *out);
+size_t ecs__start_req__pack_to_buffer
+ (const ECS__StartReq *message,
+ ProtobufCBuffer *buffer);
+ECS__StartReq *
+ ecs__start_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__start_req__free_unpacked
+ (ECS__StartReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__StartAns methods */
+void ecs__start_ans__init
+ (ECS__StartAns *message);
+size_t ecs__start_ans__get_packed_size
+ (const ECS__StartAns *message);
+size_t ecs__start_ans__pack
+ (const ECS__StartAns *message,
+ uint8_t *out);
+size_t ecs__start_ans__pack_to_buffer
+ (const ECS__StartAns *message,
+ ProtobufCBuffer *buffer);
+ECS__StartAns *
+ ecs__start_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__start_ans__free_unpacked
+ (ECS__StartAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__InjectorReq methods */
+void ecs__injector_req__init
+ (ECS__InjectorReq *message);
+size_t ecs__injector_req__get_packed_size
+ (const ECS__InjectorReq *message);
+size_t ecs__injector_req__pack
+ (const ECS__InjectorReq *message,
+ uint8_t *out);
+size_t ecs__injector_req__pack_to_buffer
+ (const ECS__InjectorReq *message,
+ ProtobufCBuffer *buffer);
+ECS__InjectorReq *
+ ecs__injector_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__injector_req__free_unpacked
+ (ECS__InjectorReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__InjectorAns methods */
+void ecs__injector_ans__init
+ (ECS__InjectorAns *message);
+size_t ecs__injector_ans__get_packed_size
+ (const ECS__InjectorAns *message);
+size_t ecs__injector_ans__pack
+ (const ECS__InjectorAns *message,
+ uint8_t *out);
+size_t ecs__injector_ans__pack_to_buffer
+ (const ECS__InjectorAns *message,
+ ProtobufCBuffer *buffer);
+ECS__InjectorAns *
+ ecs__injector_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__injector_ans__free_unpacked
+ (ECS__InjectorAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__InjectorNtf methods */
+void ecs__injector_ntf__init
+ (ECS__InjectorNtf *message);
+size_t ecs__injector_ntf__get_packed_size
+ (const ECS__InjectorNtf *message);
+size_t ecs__injector_ntf__pack
+ (const ECS__InjectorNtf *message,
+ uint8_t *out);
+size_t ecs__injector_ntf__pack_to_buffer
+ (const ECS__InjectorNtf *message,
+ ProtobufCBuffer *buffer);
+ECS__InjectorNtf *
+ ecs__injector_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__injector_ntf__free_unpacked
+ (ECS__InjectorNtf *message,
+ ProtobufCAllocator *allocator);
+/* ECS__DeviceReq methods */
+void ecs__device_req__init
+ (ECS__DeviceReq *message);
+size_t ecs__device_req__get_packed_size
+ (const ECS__DeviceReq *message);
+size_t ecs__device_req__pack
+ (const ECS__DeviceReq *message,
+ uint8_t *out);
+size_t ecs__device_req__pack_to_buffer
+ (const ECS__DeviceReq *message,
+ ProtobufCBuffer *buffer);
+ECS__DeviceReq *
+ ecs__device_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__device_req__free_unpacked
+ (ECS__DeviceReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__DeviceAns methods */
+void ecs__device_ans__init
+ (ECS__DeviceAns *message);
+size_t ecs__device_ans__get_packed_size
+ (const ECS__DeviceAns *message);
+size_t ecs__device_ans__pack
+ (const ECS__DeviceAns *message,
+ uint8_t *out);
+size_t ecs__device_ans__pack_to_buffer
+ (const ECS__DeviceAns *message,
+ ProtobufCBuffer *buffer);
+ECS__DeviceAns *
+ ecs__device_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__device_ans__free_unpacked
+ (ECS__DeviceAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__DeviceNtf methods */
+void ecs__device_ntf__init
+ (ECS__DeviceNtf *message);
+size_t ecs__device_ntf__get_packed_size
+ (const ECS__DeviceNtf *message);
+size_t ecs__device_ntf__pack
+ (const ECS__DeviceNtf *message,
+ uint8_t *out);
+size_t ecs__device_ntf__pack_to_buffer
+ (const ECS__DeviceNtf *message,
+ ProtobufCBuffer *buffer);
+ECS__DeviceNtf *
+ ecs__device_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__device_ntf__free_unpacked
+ (ECS__DeviceNtf *message,
+ ProtobufCAllocator *allocator);
+/* ECS__HostKeyboardReq methods */
+void ecs__host_keyboard_req__init
+ (ECS__HostKeyboardReq *message);
+size_t ecs__host_keyboard_req__get_packed_size
+ (const ECS__HostKeyboardReq *message);
+size_t ecs__host_keyboard_req__pack
+ (const ECS__HostKeyboardReq *message,
+ uint8_t *out);
+size_t ecs__host_keyboard_req__pack_to_buffer
+ (const ECS__HostKeyboardReq *message,
+ ProtobufCBuffer *buffer);
+ECS__HostKeyboardReq *
+ ecs__host_keyboard_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__host_keyboard_req__free_unpacked
+ (ECS__HostKeyboardReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__HostKeyboardNtf methods */
+void ecs__host_keyboard_ntf__init
+ (ECS__HostKeyboardNtf *message);
+size_t ecs__host_keyboard_ntf__get_packed_size
+ (const ECS__HostKeyboardNtf *message);
+size_t ecs__host_keyboard_ntf__pack
+ (const ECS__HostKeyboardNtf *message,
+ uint8_t *out);
+size_t ecs__host_keyboard_ntf__pack_to_buffer
+ (const ECS__HostKeyboardNtf *message,
+ ProtobufCBuffer *buffer);
+ECS__HostKeyboardNtf *
+ ecs__host_keyboard_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__host_keyboard_ntf__free_unpacked
+ (ECS__HostKeyboardNtf *message,
+ ProtobufCAllocator *allocator);
+/* ECS__ControlMsg methods */
+void ecs__control_msg__init
+ (ECS__ControlMsg *message);
+size_t ecs__control_msg__get_packed_size
+ (const ECS__ControlMsg *message);
+size_t ecs__control_msg__pack
+ (const ECS__ControlMsg *message,
+ uint8_t *out);
+size_t ecs__control_msg__pack_to_buffer
+ (const ECS__ControlMsg *message,
+ ProtobufCBuffer *buffer);
+ECS__ControlMsg *
+ ecs__control_msg__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__control_msg__free_unpacked
+ (ECS__ControlMsg *message,
+ ProtobufCAllocator *allocator);
+/* ECS__ControlAns methods */
+void ecs__control_ans__init
+ (ECS__ControlAns *message);
+size_t ecs__control_ans__get_packed_size
+ (const ECS__ControlAns *message);
+size_t ecs__control_ans__pack
+ (const ECS__ControlAns *message,
+ uint8_t *out);
+size_t ecs__control_ans__pack_to_buffer
+ (const ECS__ControlAns *message,
+ ProtobufCBuffer *buffer);
+ECS__ControlAns *
+ ecs__control_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__control_ans__free_unpacked
+ (ECS__ControlAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__ControlNtf methods */
+void ecs__control_ntf__init
+ (ECS__ControlNtf *message);
+size_t ecs__control_ntf__get_packed_size
+ (const ECS__ControlNtf *message);
+size_t ecs__control_ntf__pack
+ (const ECS__ControlNtf *message,
+ uint8_t *out);
+size_t ecs__control_ntf__pack_to_buffer
+ (const ECS__ControlNtf *message,
+ ProtobufCBuffer *buffer);
+ECS__ControlNtf *
+ ecs__control_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__control_ntf__free_unpacked
+ (ECS__ControlNtf *message,
+ ProtobufCAllocator *allocator);
+/* ECS__MonitorReq methods */
+void ecs__monitor_req__init
+ (ECS__MonitorReq *message);
+size_t ecs__monitor_req__get_packed_size
+ (const ECS__MonitorReq *message);
+size_t ecs__monitor_req__pack
+ (const ECS__MonitorReq *message,
+ uint8_t *out);
+size_t ecs__monitor_req__pack_to_buffer
+ (const ECS__MonitorReq *message,
+ ProtobufCBuffer *buffer);
+ECS__MonitorReq *
+ ecs__monitor_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__monitor_req__free_unpacked
+ (ECS__MonitorReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__MonitorAns methods */
+void ecs__monitor_ans__init
+ (ECS__MonitorAns *message);
+size_t ecs__monitor_ans__get_packed_size
+ (const ECS__MonitorAns *message);
+size_t ecs__monitor_ans__pack
+ (const ECS__MonitorAns *message,
+ uint8_t *out);
+size_t ecs__monitor_ans__pack_to_buffer
+ (const ECS__MonitorAns *message,
+ ProtobufCBuffer *buffer);
+ECS__MonitorAns *
+ ecs__monitor_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__monitor_ans__free_unpacked
+ (ECS__MonitorAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__MonitorNtf methods */
+void ecs__monitor_ntf__init
+ (ECS__MonitorNtf *message);
+size_t ecs__monitor_ntf__get_packed_size
+ (const ECS__MonitorNtf *message);
+size_t ecs__monitor_ntf__pack
+ (const ECS__MonitorNtf *message,
+ uint8_t *out);
+size_t ecs__monitor_ntf__pack_to_buffer
+ (const ECS__MonitorNtf *message,
+ ProtobufCBuffer *buffer);
+ECS__MonitorNtf *
+ ecs__monitor_ntf__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__monitor_ntf__free_unpacked
+ (ECS__MonitorNtf *message,
+ ProtobufCAllocator *allocator);
+/* ECS__ScreenDumpReq methods */
+void ecs__screen_dump_req__init
+ (ECS__ScreenDumpReq *message);
+size_t ecs__screen_dump_req__get_packed_size
+ (const ECS__ScreenDumpReq *message);
+size_t ecs__screen_dump_req__pack
+ (const ECS__ScreenDumpReq *message,
+ uint8_t *out);
+size_t ecs__screen_dump_req__pack_to_buffer
+ (const ECS__ScreenDumpReq *message,
+ ProtobufCBuffer *buffer);
+ECS__ScreenDumpReq *
+ ecs__screen_dump_req__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__screen_dump_req__free_unpacked
+ (ECS__ScreenDumpReq *message,
+ ProtobufCAllocator *allocator);
+/* ECS__ScreenDumpAns methods */
+void ecs__screen_dump_ans__init
+ (ECS__ScreenDumpAns *message);
+size_t ecs__screen_dump_ans__get_packed_size
+ (const ECS__ScreenDumpAns *message);
+size_t ecs__screen_dump_ans__pack
+ (const ECS__ScreenDumpAns *message,
+ uint8_t *out);
+size_t ecs__screen_dump_ans__pack_to_buffer
+ (const ECS__ScreenDumpAns *message,
+ ProtobufCBuffer *buffer);
+ECS__ScreenDumpAns *
+ ecs__screen_dump_ans__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__screen_dump_ans__free_unpacked
+ (ECS__ScreenDumpAns *message,
+ ProtobufCAllocator *allocator);
+/* ECS__Master methods */
+void ecs__master__init
+ (ECS__Master *message);
+size_t ecs__master__get_packed_size
+ (const ECS__Master *message);
+size_t ecs__master__pack
+ (const ECS__Master *message,
+ uint8_t *out);
+size_t ecs__master__pack_to_buffer
+ (const ECS__Master *message,
+ ProtobufCBuffer *buffer);
+ECS__Master *
+ ecs__master__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void ecs__master__free_unpacked
+ (ECS__Master *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*ECS__CheckVersionReq_Closure)
+ (const ECS__CheckVersionReq *message,
+ void *closure_data);
+typedef void (*ECS__CheckVersionAns_Closure)
+ (const ECS__CheckVersionAns *message,
+ void *closure_data);
+typedef void (*ECS__KeepAliveReq_Closure)
+ (const ECS__KeepAliveReq *message,
+ void *closure_data);
+typedef void (*ECS__KeepAliveAns_Closure)
+ (const ECS__KeepAliveAns *message,
+ void *closure_data);
+typedef void (*ECS__StartReq_Closure)
+ (const ECS__StartReq *message,
+ void *closure_data);
+typedef void (*ECS__StartAns_Closure)
+ (const ECS__StartAns *message,
+ void *closure_data);
+typedef void (*ECS__InjectorReq_Closure)
+ (const ECS__InjectorReq *message,
+ void *closure_data);
+typedef void (*ECS__InjectorAns_Closure)
+ (const ECS__InjectorAns *message,
+ void *closure_data);
+typedef void (*ECS__InjectorNtf_Closure)
+ (const ECS__InjectorNtf *message,
+ void *closure_data);
+typedef void (*ECS__DeviceReq_Closure)
+ (const ECS__DeviceReq *message,
+ void *closure_data);
+typedef void (*ECS__DeviceAns_Closure)
+ (const ECS__DeviceAns *message,
+ void *closure_data);
+typedef void (*ECS__DeviceNtf_Closure)
+ (const ECS__DeviceNtf *message,
+ void *closure_data);
+typedef void (*ECS__HostKeyboardReq_Closure)
+ (const ECS__HostKeyboardReq *message,
+ void *closure_data);
+typedef void (*ECS__HostKeyboardNtf_Closure)
+ (const ECS__HostKeyboardNtf *message,
+ void *closure_data);
+typedef void (*ECS__ControlMsg_Closure)
+ (const ECS__ControlMsg *message,
+ void *closure_data);
+typedef void (*ECS__ControlAns_Closure)
+ (const ECS__ControlAns *message,
+ void *closure_data);
+typedef void (*ECS__ControlNtf_Closure)
+ (const ECS__ControlNtf *message,
+ void *closure_data);
+typedef void (*ECS__MonitorReq_Closure)
+ (const ECS__MonitorReq *message,
+ void *closure_data);
+typedef void (*ECS__MonitorAns_Closure)
+ (const ECS__MonitorAns *message,
+ void *closure_data);
+typedef void (*ECS__MonitorNtf_Closure)
+ (const ECS__MonitorNtf *message,
+ void *closure_data);
+typedef void (*ECS__ScreenDumpReq_Closure)
+ (const ECS__ScreenDumpReq *message,
+ void *closure_data);
+typedef void (*ECS__ScreenDumpAns_Closure)
+ (const ECS__ScreenDumpAns *message,
+ void *closure_data);
+typedef void (*ECS__Master_Closure)
+ (const ECS__Master *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor ecs__check_version_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__check_version_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__keep_alive_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__keep_alive_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__start_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__start_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__injector_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__injector_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__injector_ntf__descriptor;
+extern const ProtobufCMessageDescriptor ecs__device_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__device_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__device_ntf__descriptor;
+extern const ProtobufCMessageDescriptor ecs__host_keyboard_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__host_keyboard_ntf__descriptor;
+extern const ProtobufCMessageDescriptor ecs__control_msg__descriptor;
+extern const ProtobufCEnumDescriptor ecs__control_msg__control_type__descriptor;
+extern const ProtobufCMessageDescriptor ecs__control_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__control_ntf__descriptor;
+extern const ProtobufCMessageDescriptor ecs__monitor_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__monitor_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__monitor_ntf__descriptor;
+extern const ProtobufCMessageDescriptor ecs__screen_dump_req__descriptor;
+extern const ProtobufCMessageDescriptor ecs__screen_dump_ans__descriptor;
+extern const ProtobufCMessageDescriptor ecs__master__descriptor;
+extern const ProtobufCEnumDescriptor ecs__master__type__descriptor;
+
+PROTOBUF_C_END_DECLS
+
+
+#endif /* PROTOBUF_ecs_2eproto__INCLUDED */
--- /dev/null
+package ECS;
+
+
+option java_package = "org.tizen.ecp.msg.genmsg.ecs";
+
+
+message CheckVersionReq {
+ required string version_str = 1;
+}
+
+message CheckVersionAns {
+ required int32 errcode = 1;
+ required string version_str = 2;
+}
+
+message KeepAliveReq {
+ optional string time_str = 1;
+
+}
+
+message KeepAliveAns {
+ optional string time_str = 1;
+}
+
+
+message StartReq {
+
+}
+
+message StartAns {
+ optional int32 host_keyboard_onoff = 1;
+ optional int32 earjack_onoff = 2;
+ optional int32 camera_onoff = 3;
+}
+
+message InjectorReq {
+ required string category = 1;
+ required int32 length = 2;
+ required int32 group = 3;
+ required int32 action = 4;
+ optional bytes data = 5;
+}
+
+message InjectorAns {
+ required int32 errcode = 1;
+ optional string errstr = 2;
+ required string category = 3;
+ required int32 length = 4;
+ required int32 group = 5;
+ required int32 action = 6;
+ optional bytes data = 7;
+}
+
+message InjectorNtf {
+ required string category = 1;
+ required int32 length = 2;
+ required int32 group = 3;
+ required int32 action = 4;
+ optional bytes data = 5;
+}
+
+message DeviceReq {
+ required string category = 1;
+ required int32 length = 2;
+ required int32 group = 3;
+ required int32 action = 4;
+ optional bytes data = 5;
+}
+
+message DeviceAns {
+ required int32 errcode = 1;
+ optional string errstr = 2;
+ required string category = 3;
+ required int32 length = 4;
+ required int32 group = 5;
+ required int32 action = 6;
+ optional bytes data = 7;
+}
+
+message DeviceNtf {
+ required string category = 1;
+ required int32 length = 2;
+ required int32 group = 3;
+ required int32 action = 4;
+ optional bytes data = 5;
+}
+
+
+
+// control message
+
+message HostKeyboardReq {
+ optional int32 ison = 3;
+}
+
+message HostKeyboardNtf {
+
+ required int32 errcode = 1;
+ optional string errstr = 2;
+ optional int32 ison = 3;
+}
+
+message ControlMsg {
+
+ enum ControlType {
+ HOSTKEYBOARD_REQ = 2; HOSTKEYBOARD_NTF = 3;
+ }
+
+ required ControlType type = 1;
+
+ optional HostKeyboardReq hostkeyboard_req = 2;
+ optional HostKeyboardNtf hostkeyboard_ntf = 3;
+}
+
+//
+
+message ControlAns {
+ required int32 errcode = 1;
+ optional string errmsg = 2;
+}
+
+message ControlNtf {
+ required string category = 1;
+ required string command = 2;
+ optional bytes data = 3;
+}
+
+message MonitorReq {
+ required string command = 1;
+}
+
+message MonitorAns {
+ required int32 errcode = 1;
+ optional string errmsg = 2;
+ required string command = 3;
+ optional bytes data = 4;
+}
+
+message MonitorNtf {
+ required string command = 1;
+ optional bytes data = 2;
+}
+
+message ScreenDumpReq {
+ required string output_path = 1;
+}
+
+message ScreenDumpAns {
+ required int32 errcode = 1;
+ optional string errmsg = 2;
+}
+
+
+message Master {
+ enum Type {
+ CHECKVERSION_REQ = 2; CHECKVERSION_ANS = 3;
+ KEEPALIVE_REQ = 4; KEEPALIVE_ANS = 5;
+ START_REQ = 6; START_ANS = 7;
+ INJECTOR_REQ = 8; INJECTOR_ANS = 9; INJECTOR_NTF = 10;
+ DEVICE_REQ = 11; DEVICE_ANS = 12; DEVICE_NTF = 13;
+ CONTROL_MSG = 14; CONTROL_ANS = 15; CONTROL_NTF = 16;
+ MONITOR_REQ = 17; MONITOR_ANS = 18; MONITOR_NTF = 19;
+ SCREEN_DUMP_REQ = 20; SCREEN_DUMP_ANS = 21;
+ }
+
+ required Type type = 1;
+
+ optional CheckVersionReq checkversion_req = 2;
+ optional CheckVersionAns checkversion_ans = 3;
+
+ optional KeepAliveReq keepalive_req = 4;
+ optional KeepAliveAns keepalive_ans = 5;
+
+ optional StartReq start_req = 6;
+ optional StartAns start_ans = 7;
+
+ optional InjectorReq injector_req = 8;
+ optional InjectorAns injector_ans = 9;
+ optional InjectorNtf injector_ntf = 10;
+
+ optional DeviceReq device_req = 11;
+ optional DeviceAns device_ans = 12;
+ optional DeviceNtf device_ntf = 13;
+
+ optional ControlMsg control_msg = 14;
+ optional ControlAns control_ans = 15;
+ optional ControlNtf control_ntf = 16;
+
+ optional MonitorReq monitor_req = 17;
+ optional MonitorAns monitor_ans = 18;
+ optional MonitorNtf monitor_ntf = 19;
+
+ optional ScreenDumpReq screen_dump_req = 20;
+ optional ScreenDumpAns screen_dump_ans = 21;
+
+}
+
+
--- /dev/null
+#!/bin/sh
+
+
+protoc-c --c_out=../genmsg ecs.proto
+++ /dev/null
-#include <stdbool.h>
-#include <pthread.h>
-
-#include "hw/qdev.h"
-#include "net/net.h"
-#include "ui/console.h"
-#include "migration/migration.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qjson.h"
-#include "qapi/qmp/json-parser.h"
-#include "ui/qemu-spice.h"
-#include "qemu/queue.h"
-#include "qemu/option.h"
-#include "sysemu/char.h"
-#include "qemu/main-loop.h"
-
-#ifdef CONFIG_LINUX
-#include <sys/epoll.h>
-#endif
-
-#include "qemu-common.h"
-//#include "qemu_socket.h"
-#include "sdb.h"
-#include "ecs-json-streamer.h"
-#include "qmp-commands.h"
-
-#include "ecs.h"
-#include "base64.h"
-#include "mloop_event.h"
-#include "hw/maru_virtio_evdi.h"
-#include "hw/maru_virtio_sensor.h"
-#include "hw/maru_virtio_nfc.h"
-#include "skin/maruskin_operation.h"
-
-// utility functions
-
-static void* build_master(ECS__Master* master, int* payloadsize)
-{
- int len_pack = ecs__master__get_packed_size(master);
- *payloadsize = len_pack + 4;
- LOG("pack size=%d", len_pack);
- void* buf = g_malloc(len_pack + 4);
- if (!buf)
- return NULL;
-
- ecs__master__pack(master, buf + 4);
-
- len_pack = htonl(len_pack);
- memcpy(buf, &len_pack, 4);
-
- return buf;
-}
-
-bool send_to_ecp(ECS__Master* master)
-{
- int payloadsize = 0;
- void* buf = build_master(master, &payloadsize);
- if (!buf)
- {
- LOG("invalid buf");
- return false;
- }
-
- if (!send_to_all_client(buf, payloadsize))
- return false;
-
- if (buf)
- {
- g_free(buf);
- }
- return true;
-}
-
-
-// message handlers
-
-
-bool msgproc_start_req(ECS_Client* ccli, ECS__StartReq* msg)
-{
- LOG("ecs_startinfo_req");
-
- int hostkbd_status = mloop_evcmd_get_hostkbd_status();
-
- LOG("hostkbd_status = %d", hostkbd_status);
-
- send_start_ans(hostkbd_status);
-
- return true;
-}
-
-bool msgproc_injector_req(ECS_Client* ccli, ECS__InjectorReq* msg)
-{
- char cmd[10];
- memset(cmd, 0, 10);
- strcpy(cmd, msg->category);
- type_length length = (type_length) msg->length;
- type_group group = (type_group) (msg->group & 0xff);
- type_action action = (type_action) (msg->action & 0xff);
-
-
- int datalen = 0;
- if (msg->has_data)
- {
- datalen = msg->data.len;
- }
- //LOG(">> count= %d", ++ijcount);
-
- LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
- action, group);
-
-
- int sndlen = datalen + 14;
- char* sndbuf = (char*) g_malloc(sndlen + 1);
- if (!sndbuf) {
- return false;
- }
-
- memset(sndbuf, 0, sndlen + 1);
-
- // set data
- memcpy(sndbuf, cmd, 10);
- memcpy(sndbuf + 10, &length, 2);
- memcpy(sndbuf + 12, &group, 1);
- memcpy(sndbuf + 13, &action, 1);
-
-
- if (msg->has_data)
- {
- if (msg->data.data && msg->data.len > 0)
- {
- const char* data = (const char*)msg->data.data;
- memcpy(sndbuf + 14, data, datalen);
- LOG(">> print len = %d, data\" %s\"", strlen(data), data);
- }
- }
-
- send_to_evdi(route_ij, sndbuf, sndlen);
-
- g_free(sndbuf);
-
- return true;
-}
-
-bool msgproc_control_msg(ECS_Client *cli, ECS__ControlMsg* msg)
-{
- if (msg->type == ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ)
- {
- ECS__HostKeyboardReq* hkr = msg->hostkeyboard_req;
- if (!hkr)
- return false;
- msgproc_control_hostkeyboard_req(cli, hkr);
- }
-
- return true;
-}
-
-bool msgproc_monitor_req(ECS_Client *ccli, ECS__MonitorReq* msg)
-{
-
- return true;
-}
-
-bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg)
-{
- char cmd[10];
- char* data = NULL;
- memset(cmd, 0, 10);
- strcpy(cmd, msg->category);
- type_length length = (type_length) msg->length;
- type_group group = (type_group) (msg->group & 0xff);
- type_action action = (type_action) (msg->action & 0xff);
-
- if (msg->has_data && msg->data.len > 0)
- {
- data = (char*)msg->data.data;
- }
-
- LOG(">> header = cmd = %s, length = %d, action=%d, group=%d", cmd, length,
- action, group);
-
- if (!strncmp(cmd, MSG_TYPE_SENSOR, 6)) {
- if (group == MSG_GROUP_STATUS) {
- if (action ==MSG_ACTION_ACCEL) {
- get_sensor_accel();
- } else if (action == MSG_ACTION_GYRO) {
- get_sensor_gyro();
- } else if (action == MSG_ACTION_MAG) {
- get_sensor_mag();
- } else if (action == MSG_ACTION_LIGHT) {
- get_sensor_light();
- } else if (action == MSG_ACTION_PROXI) {
- get_sensor_proxi();
- }
- } else {
- set_sensor_data(length, data);
- }
- }
- else if (!strncmp(cmd, MSG_TYPE_NFC, 3)) {
- if (group == MSG_GROUP_STATUS) {
- send_to_nfc(request_get, data, length);
- }
- else
- {
- send_to_nfc(request_set, data, length);
- }
- }
-
- return true;
-}
-
-bool msgproc_screen_dump_req(ECS_Client *ccli, ECS__ScreenDumpReq* msg)
-{
-
- return true;
-}
-
-
-// begin control command
-
-void msgproc_control_hostkeyboard_req(ECS_Client *clii, ECS__HostKeyboardReq* req)
-{
- int64_t is_on = req->ison;
- onoff_host_kbd(is_on);
-}
-
-// end control command
-
-
-//
-
-bool ntf_to_injector(const char* data, const int len) {
- type_length length = 0;
- type_group group = 0;
- type_action action = 0;
-
- const int catsize = 10;
- char cat[catsize + 1];
- memset(cat, 0, catsize + 1);
-
- read_val_str(data, cat, catsize);
- read_val_short(data + catsize, &length);
- read_val_char(data + catsize + 2, &group);
- read_val_char(data + catsize + 2 + 1, &action);
-
-
- const char* ijdata = (data + catsize + 2 + 1 + 1);
-
- char *encoded_ijdata = NULL;
- LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,
- action, group);
-
- if(!strcmp(cat, "telephony")) {
- base64_encode(ijdata, length, &encoded_ijdata);
- }
-
- QDict* obj_header = qdict_new();
- ecs_make_header(obj_header, length, group, action);
-
- QDict* objData = qdict_new();
- qobject_incref(QOBJECT(obj_header));
-
- qdict_put(objData, "cat", qstring_from_str(cat));
- qdict_put(objData, "header", obj_header);
- if(!strcmp(cat, "telephony")) {
- qdict_put(objData, "ijdata", qstring_from_str(encoded_ijdata));
- } else {
- qdict_put(objData, "ijdata", qstring_from_str(ijdata));
- }
-
- QDict* objMsg = qdict_new();
- qobject_incref(QOBJECT(objData));
-
- qdict_put(objMsg, "type", qstring_from_str("injector"));
- qdict_put(objMsg, "result", qstring_from_str("success"));
- qdict_put(objMsg, "data", objData);
-
- QString *json;
- json = qobject_to_json(QOBJECT(objMsg));
-
- assert(json != NULL);
-
- qstring_append_chr(json, '\n');
- const char* snddata = qstring_get_str(json);
-
- LOG("<< json str = %s", snddata);
-
- send_to_all_client(snddata, strlen(snddata));
-
- QDECREF(json);
-
- QDECREF(obj_header);
- QDECREF(objData);
- QDECREF(objMsg);
-
- return true;
-}
-
-bool send_start_ans(int host_keyboard_onff)
-{
- ECS__Master master = ECS__MASTER__INIT;
- ECS__StartAns ans = ECS__START_ANS__INIT;
-
- ans.has_host_keyboard_onoff = 1;
- ans.host_keyboard_onoff = host_keyboard_onff;
-
- ans.has_camera_onoff = 1;
- ans.camera_onoff = 1;
-
- ans.has_earjack_onoff = 1;
- ans.earjack_onoff = 1;
-
- master.type = ECS__MASTER__TYPE__START_ANS;
- master.start_ans = &ans;
-
- return send_to_ecp(&master);
-}
-
-bool send_injector_ntf(const char* data, const int len)
-{
- type_length length = 0;
- type_group group = 0;
- type_action action = 0;
-
- const int catsize = 10;
- char cat[catsize + 1];
- memset(cat, 0, catsize + 1);
-
- read_val_str(data, cat, catsize);
- read_val_short(data + catsize, &length);
- read_val_char(data + catsize + 2, &group);
- read_val_char(data + catsize + 2 + 1, &action);
-
-
- const char* ijdata = (data + catsize + 2 + 1 + 1);
-
- LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,action, group);
-
- ECS__Master master = ECS__MASTER__INIT;
- ECS__InjectorNtf ntf = ECS__INJECTOR_NTF__INIT;
-
- ntf.category = (char*) g_malloc(catsize + 1);
- strncpy(ntf.category, cat, 10);
-
-
- ntf.length = length;
- ntf.group = group;
- ntf.action = action;
-
- if (length > 0)
- {
- ntf.has_data = 1;
-
- ntf.data.data = g_malloc(length);
- ntf.data.len = length;
- memcpy(ntf.data.data, ijdata, length);
- }
-
- master.type = ECS__MASTER__TYPE__INJECTOR_NTF;
- master.injector_ntf = &ntf;
-
- send_to_ecp(&master);
-
- if (ntf.data.data && ntf.data.len > 0)
- {
- g_free(ntf.data.data);
- }
-
- if (ntf.category)
- g_free(ntf.category);
-
- return true;
-}
-
-
-bool send_hostkeyboard_ntf(int is_on)
-{
- ECS__Master master = ECS__MASTER__INIT;
- ECS__ControlMsg ctl = ECS__CONTROL_MSG__INIT;
-
- ECS__HostKeyboardNtf ntf = ECS__HOST_KEYBOARD_NTF__INIT;
-
- ntf.has_ison = 1;
- ntf.ison = is_on;
-
- ctl.type = ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF;
- ctl.hostkeyboard_ntf = &ntf;
-
- master.type = ECS__MASTER__TYPE__CONTROL_MSG;
- master.control_msg = &ctl;
-
- return send_to_ecp(&master);
-}
-
-
-bool send_device_ntf(const char* data, const int len)
-{
- type_length length = 0;
- type_group group = 0;
- type_action action = 0;
-
- const int catsize = 10;
- char cat[catsize + 1];
- memset(cat, 0, catsize + 1);
-
- read_val_str(data, cat, catsize);
- read_val_short(data + catsize, &length);
- read_val_char(data + catsize + 2, &group);
- read_val_char(data + catsize + 2 + 1, &action);
-
-
- const char* ijdata = (data + catsize + 2 + 1 + 1);
-
- LOG("<< header cat = %s, length = %d, action=%d, group=%d", cat, length,action, group);
-
- ECS__Master master = ECS__MASTER__INIT;
- ECS__DeviceNtf ntf = ECS__DEVICE_NTF__INIT;
-
- ntf.category = (char*) g_malloc(catsize + 1);
- strncpy(ntf.category, cat, 10);
-
-
- ntf.length = length;
- ntf.group = group;
- ntf.action = action;
-
- if (length > 0)
- {
- ntf.has_data = 1;
-
- ntf.data.data = g_malloc(length);
- ntf.data.len = length;
- memcpy(ntf.data.data, ijdata, length);
- }
-
- master.type = ECS__MASTER__TYPE__DEVICE_NTF;
- master.device_ntf = &ntf;
-
- send_to_ecp(&master);
-
- if (ntf.data.data && ntf.data.len > 0)
- {
- g_free(ntf.data.data);
- }
-
- if (ntf.category)
- g_free(ntf.category);
-
- return true;
-}
-
+++ /dev/null
-/*
- * Emulator Control Server - Sensor Device Handler
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Contact:
- * Jinhyung choi <jinhyung2.choi@samsung.com>
- * Daiyoung Kim <daiyoung777.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-#include "qemu-common.h"
-//#include "qemu_socket.h"
-//#include "qemu-queue.h"
-//#include "qemu-option.h"
-//#include "qemu-config.h"
-//#include "qemu-timer.h"
-
-#include "ecs.h"
-#include "hw/maru_virtio_sensor.h"
-
-#define TEMP_BUF_SIZE 255
-#define MAX_VAL_LENGTH 40
-
-#define ACCEL_ADJUST 100000
-#define ACCEL_MAX 1961330
-
-#define GYRO_ADJUST 17.50
-
-static int parse_val(const char *buff, unsigned char data, char *parsbuf)
-{
- int count=0;
-
- while(1)
- {
- if(count > MAX_VAL_LENGTH)
- return -1;
- if(buff[count] == data)
- {
- count++;
- strncpy(parsbuf, buff, count);
- return count;
- }
- count++;
- }
-
- return 0;
-}
-
-static int get_parse_val (const char* buf, char* tmp)
-{
- int index = 0;
-
- memset(tmp, 0, sizeof(TEMP_BUF_SIZE));
-
- index = parse_val(buf, 0x0a, tmp);
-
- return index;
-}
-
-static int accel_min_max(char* tmp)
-{
- int value = (int)(atof(tmp) * ACCEL_ADJUST);
-
- if (value > ACCEL_MAX)
- value = ACCEL_MAX;
-
- if (value < -ACCEL_MAX)
- value = -ACCEL_MAX;
-
- return value;
-}
-
-static void req_set_sensor_accel(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x, y, z;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = accel_min_max(tmp);
-
- // y
- len += get_parse_val(data + len, tmp);
- y = accel_min_max(tmp);
-
- // z
- len += get_parse_val(data + len, tmp);
- z = accel_min_max(tmp);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d, %d, %d", x, y, z);
-
- set_sensor_accel(tmp, strlen(tmp));
-}
-
-static void req_set_sensor_proxi(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // vo
- len += get_parse_val(data + len, tmp);
-
- set_sensor_proxi(tmp, strlen(tmp));
-}
-
-static void req_set_sensor_light(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = atoi(tmp);
-
- if (x == 2) {
- // y
- len += get_parse_val(data + len, tmp);
-
- set_sensor_light(tmp, strlen(tmp));
- }
-}
-
-static void req_set_sensor_gyro(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x, y, z;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = (int)(atoi(tmp) / GYRO_ADJUST);
-
- // y
- len += get_parse_val(data + len, tmp);
- y = (int)(atoi(tmp) / GYRO_ADJUST);
-
- // z
- len += get_parse_val(data + len, tmp);
- z = (int)(atoi(tmp) / GYRO_ADJUST);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d %d %d", x, y, z);
-
- set_sensor_gyro(tmp, strlen(tmp));
-}
-
-static void req_set_sensor_geo(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x, y, z, accuracy, t_north, t_east, t_vertical;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = atoi(tmp);
-
- // y
- len += get_parse_val(data + len, tmp);
- y = atoi(tmp);
-
- // z
- len += get_parse_val(data + len, tmp);
- z = atoi(tmp);
-
- len += get_parse_val(data + len, tmp);
- accuracy = atoi(tmp);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d %d %d %d", x, y, z, accuracy);
-
- set_sensor_tilt(tmp, strlen(tmp));
-
- // tesla_north
- len += get_parse_val(data + len, tmp);
- t_north = atoi(tmp);
-
- // tesla_east
- len += get_parse_val(data + len, tmp);
- t_east = atoi(tmp);
-
- // tesla_vertical
- len += get_parse_val(data + len, tmp);
- t_vertical = atoi(tmp);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d %d %d", t_north, t_east, t_vertical);
-
- set_sensor_mag(tmp, strlen(tmp));
-}
-
-static void req_set_sensor_tilt(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x, y, z, accuracy = 3;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = atoi(tmp);
-
- // y
- len += get_parse_val(data + len, tmp);
- y = atoi(tmp);
-
- // z
- len += get_parse_val(data + len, tmp);
- z = atoi(tmp);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d %d %d %d", x, y, z, accuracy);
-
- set_sensor_tilt(tmp, strlen(tmp));
-}
-
-static void req_set_sensor_mag(int len, const char* data)
-{
- char tmp[TEMP_BUF_SIZE];
- int x, y, z;
-
- // get sensor level
- len += get_parse_val(data + len, tmp);
-
- // x
- len += get_parse_val(data + len, tmp);
- x = atoi(tmp);
-
- // y
- len += get_parse_val(data + len, tmp);
- y = atoi(tmp);
-
- // z
- len += get_parse_val(data + len, tmp);
- z = atoi(tmp);
-
- memset(tmp, 0, TEMP_BUF_SIZE);
-
- sprintf(tmp, "%d %d %d", x, y, z);
-
- set_sensor_mag(tmp, strlen(tmp));
-}
-
-void set_sensor_data(int length, const char* data)
-{
- char tmpbuf[TEMP_BUF_SIZE];
- int len = get_parse_val(data, tmpbuf);
-
- switch(atoi(tmpbuf)) {
- case level_accel:
- req_set_sensor_accel(len, data);
- break;
- case level_proxi:
- req_set_sensor_proxi(len, data);
- break;
- case level_light:
- req_set_sensor_light(len, data);
- break;
- case level_gyro:
- req_set_sensor_gyro(len, data);
- break;
- case level_geo:
- req_set_sensor_geo(len, data);
- break;
- case level_tilt:
- req_set_sensor_tilt(len, data);
- break;
- case level_magnetic:
- req_set_sensor_mag(len, data);
- break;
- default:
- break;
- }
-}
-
#include "skin/maruskin_server.h"
#include "skin/maruskin_client.h"
#include "debug_ch.h"
-#include "ecs.h"
+#include "ecs/ecs.h"
#ifdef CONFIG_SDL
#include <SDL.h>
+++ /dev/null
-/* Generated by the protocol buffer compiler. DO NOT EDIT! */
-
-/* Do not generate deprecated warnings for self */
-#ifndef PROTOBUF_C_NO_DEPRECATED
-#define PROTOBUF_C_NO_DEPRECATED
-#endif
-
-#include "ecs.pb-c.h"
-void ecs__check_version_req__init
- (ECS__CheckVersionReq *message)
-{
- static ECS__CheckVersionReq init_value = ECS__CHECK_VERSION_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__check_version_req__get_packed_size
- (const ECS__CheckVersionReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__check_version_req__pack
- (const ECS__CheckVersionReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__check_version_req__pack_to_buffer
- (const ECS__CheckVersionReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__CheckVersionReq *
- ecs__check_version_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__CheckVersionReq *)
- protobuf_c_message_unpack (&ecs__check_version_req__descriptor,
- allocator, len, data);
-}
-void ecs__check_version_req__free_unpacked
- (ECS__CheckVersionReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__check_version_ans__init
- (ECS__CheckVersionAns *message)
-{
- static ECS__CheckVersionAns init_value = ECS__CHECK_VERSION_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__check_version_ans__get_packed_size
- (const ECS__CheckVersionAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__check_version_ans__pack
- (const ECS__CheckVersionAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__check_version_ans__pack_to_buffer
- (const ECS__CheckVersionAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__CheckVersionAns *
- ecs__check_version_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__CheckVersionAns *)
- protobuf_c_message_unpack (&ecs__check_version_ans__descriptor,
- allocator, len, data);
-}
-void ecs__check_version_ans__free_unpacked
- (ECS__CheckVersionAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__check_version_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__keep_alive_req__init
- (ECS__KeepAliveReq *message)
-{
- static ECS__KeepAliveReq init_value = ECS__KEEP_ALIVE_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__keep_alive_req__get_packed_size
- (const ECS__KeepAliveReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__keep_alive_req__pack
- (const ECS__KeepAliveReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__keep_alive_req__pack_to_buffer
- (const ECS__KeepAliveReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__KeepAliveReq *
- ecs__keep_alive_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__KeepAliveReq *)
- protobuf_c_message_unpack (&ecs__keep_alive_req__descriptor,
- allocator, len, data);
-}
-void ecs__keep_alive_req__free_unpacked
- (ECS__KeepAliveReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__keep_alive_ans__init
- (ECS__KeepAliveAns *message)
-{
- static ECS__KeepAliveAns init_value = ECS__KEEP_ALIVE_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__keep_alive_ans__get_packed_size
- (const ECS__KeepAliveAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__keep_alive_ans__pack
- (const ECS__KeepAliveAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__keep_alive_ans__pack_to_buffer
- (const ECS__KeepAliveAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__KeepAliveAns *
- ecs__keep_alive_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__KeepAliveAns *)
- protobuf_c_message_unpack (&ecs__keep_alive_ans__descriptor,
- allocator, len, data);
-}
-void ecs__keep_alive_ans__free_unpacked
- (ECS__KeepAliveAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__keep_alive_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__start_req__init
- (ECS__StartReq *message)
-{
- static ECS__StartReq init_value = ECS__START_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__start_req__get_packed_size
- (const ECS__StartReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__start_req__pack
- (const ECS__StartReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__start_req__pack_to_buffer
- (const ECS__StartReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__StartReq *
- ecs__start_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__StartReq *)
- protobuf_c_message_unpack (&ecs__start_req__descriptor,
- allocator, len, data);
-}
-void ecs__start_req__free_unpacked
- (ECS__StartReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__start_ans__init
- (ECS__StartAns *message)
-{
- static ECS__StartAns init_value = ECS__START_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__start_ans__get_packed_size
- (const ECS__StartAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__start_ans__pack
- (const ECS__StartAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__start_ans__pack_to_buffer
- (const ECS__StartAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__StartAns *
- ecs__start_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__StartAns *)
- protobuf_c_message_unpack (&ecs__start_ans__descriptor,
- allocator, len, data);
-}
-void ecs__start_ans__free_unpacked
- (ECS__StartAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__start_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__injector_req__init
- (ECS__InjectorReq *message)
-{
- static ECS__InjectorReq init_value = ECS__INJECTOR_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__injector_req__get_packed_size
- (const ECS__InjectorReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__injector_req__pack
- (const ECS__InjectorReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__injector_req__pack_to_buffer
- (const ECS__InjectorReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__InjectorReq *
- ecs__injector_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__InjectorReq *)
- protobuf_c_message_unpack (&ecs__injector_req__descriptor,
- allocator, len, data);
-}
-void ecs__injector_req__free_unpacked
- (ECS__InjectorReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__injector_ans__init
- (ECS__InjectorAns *message)
-{
- static ECS__InjectorAns init_value = ECS__INJECTOR_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__injector_ans__get_packed_size
- (const ECS__InjectorAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__injector_ans__pack
- (const ECS__InjectorAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__injector_ans__pack_to_buffer
- (const ECS__InjectorAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__InjectorAns *
- ecs__injector_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__InjectorAns *)
- protobuf_c_message_unpack (&ecs__injector_ans__descriptor,
- allocator, len, data);
-}
-void ecs__injector_ans__free_unpacked
- (ECS__InjectorAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__injector_ntf__init
- (ECS__InjectorNtf *message)
-{
- static ECS__InjectorNtf init_value = ECS__INJECTOR_NTF__INIT;
- *message = init_value;
-}
-size_t ecs__injector_ntf__get_packed_size
- (const ECS__InjectorNtf *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__injector_ntf__pack
- (const ECS__InjectorNtf *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__injector_ntf__pack_to_buffer
- (const ECS__InjectorNtf *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__InjectorNtf *
- ecs__injector_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__InjectorNtf *)
- protobuf_c_message_unpack (&ecs__injector_ntf__descriptor,
- allocator, len, data);
-}
-void ecs__injector_ntf__free_unpacked
- (ECS__InjectorNtf *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__injector_ntf__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__device_req__init
- (ECS__DeviceReq *message)
-{
- static ECS__DeviceReq init_value = ECS__DEVICE_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__device_req__get_packed_size
- (const ECS__DeviceReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__device_req__pack
- (const ECS__DeviceReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__device_req__pack_to_buffer
- (const ECS__DeviceReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__DeviceReq *
- ecs__device_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__DeviceReq *)
- protobuf_c_message_unpack (&ecs__device_req__descriptor,
- allocator, len, data);
-}
-void ecs__device_req__free_unpacked
- (ECS__DeviceReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__device_ans__init
- (ECS__DeviceAns *message)
-{
- static ECS__DeviceAns init_value = ECS__DEVICE_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__device_ans__get_packed_size
- (const ECS__DeviceAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__device_ans__pack
- (const ECS__DeviceAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__device_ans__pack_to_buffer
- (const ECS__DeviceAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__DeviceAns *
- ecs__device_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__DeviceAns *)
- protobuf_c_message_unpack (&ecs__device_ans__descriptor,
- allocator, len, data);
-}
-void ecs__device_ans__free_unpacked
- (ECS__DeviceAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__device_ntf__init
- (ECS__DeviceNtf *message)
-{
- static ECS__DeviceNtf init_value = ECS__DEVICE_NTF__INIT;
- *message = init_value;
-}
-size_t ecs__device_ntf__get_packed_size
- (const ECS__DeviceNtf *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__device_ntf__pack
- (const ECS__DeviceNtf *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__device_ntf__pack_to_buffer
- (const ECS__DeviceNtf *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__DeviceNtf *
- ecs__device_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__DeviceNtf *)
- protobuf_c_message_unpack (&ecs__device_ntf__descriptor,
- allocator, len, data);
-}
-void ecs__device_ntf__free_unpacked
- (ECS__DeviceNtf *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__device_ntf__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__host_keyboard_req__init
- (ECS__HostKeyboardReq *message)
-{
- static ECS__HostKeyboardReq init_value = ECS__HOST_KEYBOARD_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__host_keyboard_req__get_packed_size
- (const ECS__HostKeyboardReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__host_keyboard_req__pack
- (const ECS__HostKeyboardReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__host_keyboard_req__pack_to_buffer
- (const ECS__HostKeyboardReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__HostKeyboardReq *
- ecs__host_keyboard_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__HostKeyboardReq *)
- protobuf_c_message_unpack (&ecs__host_keyboard_req__descriptor,
- allocator, len, data);
-}
-void ecs__host_keyboard_req__free_unpacked
- (ECS__HostKeyboardReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__host_keyboard_ntf__init
- (ECS__HostKeyboardNtf *message)
-{
- static ECS__HostKeyboardNtf init_value = ECS__HOST_KEYBOARD_NTF__INIT;
- *message = init_value;
-}
-size_t ecs__host_keyboard_ntf__get_packed_size
- (const ECS__HostKeyboardNtf *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__host_keyboard_ntf__pack
- (const ECS__HostKeyboardNtf *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__host_keyboard_ntf__pack_to_buffer
- (const ECS__HostKeyboardNtf *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__HostKeyboardNtf *
- ecs__host_keyboard_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__HostKeyboardNtf *)
- protobuf_c_message_unpack (&ecs__host_keyboard_ntf__descriptor,
- allocator, len, data);
-}
-void ecs__host_keyboard_ntf__free_unpacked
- (ECS__HostKeyboardNtf *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__host_keyboard_ntf__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__control_msg__init
- (ECS__ControlMsg *message)
-{
- static ECS__ControlMsg init_value = ECS__CONTROL_MSG__INIT;
- *message = init_value;
-}
-size_t ecs__control_msg__get_packed_size
- (const ECS__ControlMsg *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__control_msg__pack
- (const ECS__ControlMsg *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__control_msg__pack_to_buffer
- (const ECS__ControlMsg *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__ControlMsg *
- ecs__control_msg__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__ControlMsg *)
- protobuf_c_message_unpack (&ecs__control_msg__descriptor,
- allocator, len, data);
-}
-void ecs__control_msg__free_unpacked
- (ECS__ControlMsg *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_msg__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__control_ans__init
- (ECS__ControlAns *message)
-{
- static ECS__ControlAns init_value = ECS__CONTROL_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__control_ans__get_packed_size
- (const ECS__ControlAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__control_ans__pack
- (const ECS__ControlAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__control_ans__pack_to_buffer
- (const ECS__ControlAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__ControlAns *
- ecs__control_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__ControlAns *)
- protobuf_c_message_unpack (&ecs__control_ans__descriptor,
- allocator, len, data);
-}
-void ecs__control_ans__free_unpacked
- (ECS__ControlAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__control_ntf__init
- (ECS__ControlNtf *message)
-{
- static ECS__ControlNtf init_value = ECS__CONTROL_NTF__INIT;
- *message = init_value;
-}
-size_t ecs__control_ntf__get_packed_size
- (const ECS__ControlNtf *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__control_ntf__pack
- (const ECS__ControlNtf *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__control_ntf__pack_to_buffer
- (const ECS__ControlNtf *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__ControlNtf *
- ecs__control_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__ControlNtf *)
- protobuf_c_message_unpack (&ecs__control_ntf__descriptor,
- allocator, len, data);
-}
-void ecs__control_ntf__free_unpacked
- (ECS__ControlNtf *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_ntf__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__monitor_req__init
- (ECS__MonitorReq *message)
-{
- static ECS__MonitorReq init_value = ECS__MONITOR_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__monitor_req__get_packed_size
- (const ECS__MonitorReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__monitor_req__pack
- (const ECS__MonitorReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__monitor_req__pack_to_buffer
- (const ECS__MonitorReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__MonitorReq *
- ecs__monitor_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__MonitorReq *)
- protobuf_c_message_unpack (&ecs__monitor_req__descriptor,
- allocator, len, data);
-}
-void ecs__monitor_req__free_unpacked
- (ECS__MonitorReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__monitor_ans__init
- (ECS__MonitorAns *message)
-{
- static ECS__MonitorAns init_value = ECS__MONITOR_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__monitor_ans__get_packed_size
- (const ECS__MonitorAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__monitor_ans__pack
- (const ECS__MonitorAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__monitor_ans__pack_to_buffer
- (const ECS__MonitorAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__MonitorAns *
- ecs__monitor_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__MonitorAns *)
- protobuf_c_message_unpack (&ecs__monitor_ans__descriptor,
- allocator, len, data);
-}
-void ecs__monitor_ans__free_unpacked
- (ECS__MonitorAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__monitor_ntf__init
- (ECS__MonitorNtf *message)
-{
- static ECS__MonitorNtf init_value = ECS__MONITOR_NTF__INIT;
- *message = init_value;
-}
-size_t ecs__monitor_ntf__get_packed_size
- (const ECS__MonitorNtf *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__monitor_ntf__pack
- (const ECS__MonitorNtf *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__monitor_ntf__pack_to_buffer
- (const ECS__MonitorNtf *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__MonitorNtf *
- ecs__monitor_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__MonitorNtf *)
- protobuf_c_message_unpack (&ecs__monitor_ntf__descriptor,
- allocator, len, data);
-}
-void ecs__monitor_ntf__free_unpacked
- (ECS__MonitorNtf *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__monitor_ntf__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__screen_dump_req__init
- (ECS__ScreenDumpReq *message)
-{
- static ECS__ScreenDumpReq init_value = ECS__SCREEN_DUMP_REQ__INIT;
- *message = init_value;
-}
-size_t ecs__screen_dump_req__get_packed_size
- (const ECS__ScreenDumpReq *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__screen_dump_req__pack
- (const ECS__ScreenDumpReq *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__screen_dump_req__pack_to_buffer
- (const ECS__ScreenDumpReq *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__ScreenDumpReq *
- ecs__screen_dump_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__ScreenDumpReq *)
- protobuf_c_message_unpack (&ecs__screen_dump_req__descriptor,
- allocator, len, data);
-}
-void ecs__screen_dump_req__free_unpacked
- (ECS__ScreenDumpReq *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_req__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__screen_dump_ans__init
- (ECS__ScreenDumpAns *message)
-{
- static ECS__ScreenDumpAns init_value = ECS__SCREEN_DUMP_ANS__INIT;
- *message = init_value;
-}
-size_t ecs__screen_dump_ans__get_packed_size
- (const ECS__ScreenDumpAns *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__screen_dump_ans__pack
- (const ECS__ScreenDumpAns *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__screen_dump_ans__pack_to_buffer
- (const ECS__ScreenDumpAns *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__ScreenDumpAns *
- ecs__screen_dump_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__ScreenDumpAns *)
- protobuf_c_message_unpack (&ecs__screen_dump_ans__descriptor,
- allocator, len, data);
-}
-void ecs__screen_dump_ans__free_unpacked
- (ECS__ScreenDumpAns *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__screen_dump_ans__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-void ecs__master__init
- (ECS__Master *message)
-{
- static ECS__Master init_value = ECS__MASTER__INIT;
- *message = init_value;
-}
-size_t ecs__master__get_packed_size
- (const ECS__Master *message)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
- return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
-}
-size_t ecs__master__pack
- (const ECS__Master *message,
- uint8_t *out)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
- return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
-}
-size_t ecs__master__pack_to_buffer
- (const ECS__Master *message,
- ProtobufCBuffer *buffer)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
- return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
-}
-ECS__Master *
- ecs__master__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data)
-{
- return (ECS__Master *)
- protobuf_c_message_unpack (&ecs__master__descriptor,
- allocator, len, data);
-}
-void ecs__master__free_unpacked
- (ECS__Master *message,
- ProtobufCAllocator *allocator)
-{
- PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__master__descriptor);
- protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
-}
-static const ProtobufCFieldDescriptor ecs__check_version_req__field_descriptors[1] =
-{
- {
- "version_str",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__CheckVersionReq, version_str),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__check_version_req__field_indices_by_name[] = {
- 0, /* field[0] = version_str */
-};
-static const ProtobufCIntRange ecs__check_version_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__check_version_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.CheckVersionReq",
- "CheckVersionReq",
- "ECS__CheckVersionReq",
- "ECS",
- sizeof(ECS__CheckVersionReq),
- 1,
- ecs__check_version_req__field_descriptors,
- ecs__check_version_req__field_indices_by_name,
- 1, ecs__check_version_req__number_ranges,
- (ProtobufCMessageInit) ecs__check_version_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__check_version_ans__field_descriptors[2] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__CheckVersionAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "version_str",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__CheckVersionAns, version_str),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__check_version_ans__field_indices_by_name[] = {
- 0, /* field[0] = errcode */
- 1, /* field[1] = version_str */
-};
-static const ProtobufCIntRange ecs__check_version_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 2 }
-};
-const ProtobufCMessageDescriptor ecs__check_version_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.CheckVersionAns",
- "CheckVersionAns",
- "ECS__CheckVersionAns",
- "ECS",
- sizeof(ECS__CheckVersionAns),
- 2,
- ecs__check_version_ans__field_descriptors,
- ecs__check_version_ans__field_indices_by_name,
- 1, ecs__check_version_ans__number_ranges,
- (ProtobufCMessageInit) ecs__check_version_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__keep_alive_req__field_descriptors[1] =
-{
- {
- "time_str",
- 1,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__KeepAliveReq, time_str),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__keep_alive_req__field_indices_by_name[] = {
- 0, /* field[0] = time_str */
-};
-static const ProtobufCIntRange ecs__keep_alive_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__keep_alive_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.KeepAliveReq",
- "KeepAliveReq",
- "ECS__KeepAliveReq",
- "ECS",
- sizeof(ECS__KeepAliveReq),
- 1,
- ecs__keep_alive_req__field_descriptors,
- ecs__keep_alive_req__field_indices_by_name,
- 1, ecs__keep_alive_req__number_ranges,
- (ProtobufCMessageInit) ecs__keep_alive_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__keep_alive_ans__field_descriptors[1] =
-{
- {
- "time_str",
- 1,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__KeepAliveAns, time_str),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__keep_alive_ans__field_indices_by_name[] = {
- 0, /* field[0] = time_str */
-};
-static const ProtobufCIntRange ecs__keep_alive_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__keep_alive_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.KeepAliveAns",
- "KeepAliveAns",
- "ECS__KeepAliveAns",
- "ECS",
- sizeof(ECS__KeepAliveAns),
- 1,
- ecs__keep_alive_ans__field_descriptors,
- ecs__keep_alive_ans__field_indices_by_name,
- 1, ecs__keep_alive_ans__number_ranges,
- (ProtobufCMessageInit) ecs__keep_alive_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__start_req__field_descriptors[0] =
-{
-};
-static const unsigned ecs__start_req__field_indices_by_name[] = {
-};
-#define ecs__start_req__number_ranges NULL
-const ProtobufCMessageDescriptor ecs__start_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.StartReq",
- "StartReq",
- "ECS__StartReq",
- "ECS",
- sizeof(ECS__StartReq),
- 0,
- ecs__start_req__field_descriptors,
- ecs__start_req__field_indices_by_name,
- 0, ecs__start_req__number_ranges,
- (ProtobufCMessageInit) ecs__start_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__start_ans__field_descriptors[3] =
-{
- {
- "host_keyboard_onoff",
- 1,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_INT32,
- PROTOBUF_C_OFFSETOF(ECS__StartAns, has_host_keyboard_onoff),
- PROTOBUF_C_OFFSETOF(ECS__StartAns, host_keyboard_onoff),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "earjack_onoff",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_INT32,
- PROTOBUF_C_OFFSETOF(ECS__StartAns, has_earjack_onoff),
- PROTOBUF_C_OFFSETOF(ECS__StartAns, earjack_onoff),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "camera_onoff",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_INT32,
- PROTOBUF_C_OFFSETOF(ECS__StartAns, has_camera_onoff),
- PROTOBUF_C_OFFSETOF(ECS__StartAns, camera_onoff),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__start_ans__field_indices_by_name[] = {
- 2, /* field[2] = camera_onoff */
- 1, /* field[1] = earjack_onoff */
- 0, /* field[0] = host_keyboard_onoff */
-};
-static const ProtobufCIntRange ecs__start_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 3 }
-};
-const ProtobufCMessageDescriptor ecs__start_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.StartAns",
- "StartAns",
- "ECS__StartAns",
- "ECS",
- sizeof(ECS__StartAns),
- 3,
- ecs__start_ans__field_descriptors,
- ecs__start_ans__field_indices_by_name,
- 1, ecs__start_ans__number_ranges,
- (ProtobufCMessageInit) ecs__start_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__injector_req__field_descriptors[5] =
-{
- {
- "category",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 5,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, has_data),
- PROTOBUF_C_OFFSETOF(ECS__InjectorReq, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__injector_req__field_indices_by_name[] = {
- 3, /* field[3] = action */
- 0, /* field[0] = category */
- 4, /* field[4] = data */
- 2, /* field[2] = group */
- 1, /* field[1] = length */
-};
-static const ProtobufCIntRange ecs__injector_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 5 }
-};
-const ProtobufCMessageDescriptor ecs__injector_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.InjectorReq",
- "InjectorReq",
- "ECS__InjectorReq",
- "ECS",
- sizeof(ECS__InjectorReq),
- 5,
- ecs__injector_req__field_descriptors,
- ecs__injector_req__field_indices_by_name,
- 1, ecs__injector_req__number_ranges,
- (ProtobufCMessageInit) ecs__injector_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__injector_ans__field_descriptors[7] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errstr",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, errstr),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "category",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 5,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 6,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 7,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, has_data),
- PROTOBUF_C_OFFSETOF(ECS__InjectorAns, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__injector_ans__field_indices_by_name[] = {
- 5, /* field[5] = action */
- 2, /* field[2] = category */
- 6, /* field[6] = data */
- 0, /* field[0] = errcode */
- 1, /* field[1] = errstr */
- 4, /* field[4] = group */
- 3, /* field[3] = length */
-};
-static const ProtobufCIntRange ecs__injector_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 7 }
-};
-const ProtobufCMessageDescriptor ecs__injector_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.InjectorAns",
- "InjectorAns",
- "ECS__InjectorAns",
- "ECS",
- sizeof(ECS__InjectorAns),
- 7,
- ecs__injector_ans__field_descriptors,
- ecs__injector_ans__field_indices_by_name,
- 1, ecs__injector_ans__number_ranges,
- (ProtobufCMessageInit) ecs__injector_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__injector_ntf__field_descriptors[5] =
-{
- {
- "category",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 5,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, has_data),
- PROTOBUF_C_OFFSETOF(ECS__InjectorNtf, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__injector_ntf__field_indices_by_name[] = {
- 3, /* field[3] = action */
- 0, /* field[0] = category */
- 4, /* field[4] = data */
- 2, /* field[2] = group */
- 1, /* field[1] = length */
-};
-static const ProtobufCIntRange ecs__injector_ntf__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 5 }
-};
-const ProtobufCMessageDescriptor ecs__injector_ntf__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.InjectorNtf",
- "InjectorNtf",
- "ECS__InjectorNtf",
- "ECS",
- sizeof(ECS__InjectorNtf),
- 5,
- ecs__injector_ntf__field_descriptors,
- ecs__injector_ntf__field_indices_by_name,
- 1, ecs__injector_ntf__number_ranges,
- (ProtobufCMessageInit) ecs__injector_ntf__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__device_req__field_descriptors[5] =
-{
- {
- "category",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 5,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, has_data),
- PROTOBUF_C_OFFSETOF(ECS__DeviceReq, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__device_req__field_indices_by_name[] = {
- 3, /* field[3] = action */
- 0, /* field[0] = category */
- 4, /* field[4] = data */
- 2, /* field[2] = group */
- 1, /* field[1] = length */
-};
-static const ProtobufCIntRange ecs__device_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 5 }
-};
-const ProtobufCMessageDescriptor ecs__device_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.DeviceReq",
- "DeviceReq",
- "ECS__DeviceReq",
- "ECS",
- sizeof(ECS__DeviceReq),
- 5,
- ecs__device_req__field_descriptors,
- ecs__device_req__field_indices_by_name,
- 1, ecs__device_req__number_ranges,
- (ProtobufCMessageInit) ecs__device_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__device_ans__field_descriptors[7] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errstr",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, errstr),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "category",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 5,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 6,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 7,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, has_data),
- PROTOBUF_C_OFFSETOF(ECS__DeviceAns, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__device_ans__field_indices_by_name[] = {
- 5, /* field[5] = action */
- 2, /* field[2] = category */
- 6, /* field[6] = data */
- 0, /* field[0] = errcode */
- 1, /* field[1] = errstr */
- 4, /* field[4] = group */
- 3, /* field[3] = length */
-};
-static const ProtobufCIntRange ecs__device_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 7 }
-};
-const ProtobufCMessageDescriptor ecs__device_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.DeviceAns",
- "DeviceAns",
- "ECS__DeviceAns",
- "ECS",
- sizeof(ECS__DeviceAns),
- 7,
- ecs__device_ans__field_descriptors,
- ecs__device_ans__field_indices_by_name,
- 1, ecs__device_ans__number_ranges,
- (ProtobufCMessageInit) ecs__device_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__device_ntf__field_descriptors[5] =
-{
- {
- "category",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "length",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, length),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "group",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, group),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "action",
- 4,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, action),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 5,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, has_data),
- PROTOBUF_C_OFFSETOF(ECS__DeviceNtf, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__device_ntf__field_indices_by_name[] = {
- 3, /* field[3] = action */
- 0, /* field[0] = category */
- 4, /* field[4] = data */
- 2, /* field[2] = group */
- 1, /* field[1] = length */
-};
-static const ProtobufCIntRange ecs__device_ntf__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 5 }
-};
-const ProtobufCMessageDescriptor ecs__device_ntf__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.DeviceNtf",
- "DeviceNtf",
- "ECS__DeviceNtf",
- "ECS",
- sizeof(ECS__DeviceNtf),
- 5,
- ecs__device_ntf__field_descriptors,
- ecs__device_ntf__field_indices_by_name,
- 1, ecs__device_ntf__number_ranges,
- (ProtobufCMessageInit) ecs__device_ntf__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__host_keyboard_req__field_descriptors[1] =
-{
- {
- "ison",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_INT32,
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardReq, has_ison),
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardReq, ison),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__host_keyboard_req__field_indices_by_name[] = {
- 0, /* field[0] = ison */
-};
-static const ProtobufCIntRange ecs__host_keyboard_req__number_ranges[1 + 1] =
-{
- { 3, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__host_keyboard_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.HostKeyboardReq",
- "HostKeyboardReq",
- "ECS__HostKeyboardReq",
- "ECS",
- sizeof(ECS__HostKeyboardReq),
- 1,
- ecs__host_keyboard_req__field_descriptors,
- ecs__host_keyboard_req__field_indices_by_name,
- 1, ecs__host_keyboard_req__number_ranges,
- (ProtobufCMessageInit) ecs__host_keyboard_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__host_keyboard_ntf__field_descriptors[3] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errstr",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, errstr),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "ison",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_INT32,
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, has_ison),
- PROTOBUF_C_OFFSETOF(ECS__HostKeyboardNtf, ison),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__host_keyboard_ntf__field_indices_by_name[] = {
- 0, /* field[0] = errcode */
- 1, /* field[1] = errstr */
- 2, /* field[2] = ison */
-};
-static const ProtobufCIntRange ecs__host_keyboard_ntf__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 3 }
-};
-const ProtobufCMessageDescriptor ecs__host_keyboard_ntf__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.HostKeyboardNtf",
- "HostKeyboardNtf",
- "ECS__HostKeyboardNtf",
- "ECS",
- sizeof(ECS__HostKeyboardNtf),
- 3,
- ecs__host_keyboard_ntf__field_descriptors,
- ecs__host_keyboard_ntf__field_indices_by_name,
- 1, ecs__host_keyboard_ntf__number_ranges,
- (ProtobufCMessageInit) ecs__host_keyboard_ntf__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-const ProtobufCEnumValue ecs__control_msg__control_type__enum_values_by_number[2] =
-{
- { "HOSTKEYBOARD_REQ", "ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ", 2 },
- { "HOSTKEYBOARD_NTF", "ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF", 3 },
-};
-static const ProtobufCIntRange ecs__control_msg__control_type__value_ranges[] = {
-{2, 0},{0, 2}
-};
-const ProtobufCEnumValueIndex ecs__control_msg__control_type__enum_values_by_name[2] =
-{
- { "HOSTKEYBOARD_NTF", 1 },
- { "HOSTKEYBOARD_REQ", 0 },
-};
-const ProtobufCEnumDescriptor ecs__control_msg__control_type__descriptor =
-{
- PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,
- "ECS.ControlMsg.ControlType",
- "ControlType",
- "ECS__ControlMsg__ControlType",
- "ECS",
- 2,
- ecs__control_msg__control_type__enum_values_by_number,
- 2,
- ecs__control_msg__control_type__enum_values_by_name,
- 1,
- ecs__control_msg__control_type__value_ranges,
- NULL,NULL,NULL,NULL /* reserved[1234] */
-};
-static const ProtobufCFieldDescriptor ecs__control_msg__field_descriptors[3] =
-{
- {
- "type",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_ENUM,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlMsg, type),
- &ecs__control_msg__control_type__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "hostkeyboard_req",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlMsg, hostkeyboard_req),
- &ecs__host_keyboard_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "hostkeyboard_ntf",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlMsg, hostkeyboard_ntf),
- &ecs__host_keyboard_ntf__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__control_msg__field_indices_by_name[] = {
- 2, /* field[2] = hostkeyboard_ntf */
- 1, /* field[1] = hostkeyboard_req */
- 0, /* field[0] = type */
-};
-static const ProtobufCIntRange ecs__control_msg__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 3 }
-};
-const ProtobufCMessageDescriptor ecs__control_msg__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.ControlMsg",
- "ControlMsg",
- "ECS__ControlMsg",
- "ECS",
- sizeof(ECS__ControlMsg),
- 3,
- ecs__control_msg__field_descriptors,
- ecs__control_msg__field_indices_by_name,
- 1, ecs__control_msg__number_ranges,
- (ProtobufCMessageInit) ecs__control_msg__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__control_ans__field_descriptors[2] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errmsg",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlAns, errmsg),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__control_ans__field_indices_by_name[] = {
- 0, /* field[0] = errcode */
- 1, /* field[1] = errmsg */
-};
-static const ProtobufCIntRange ecs__control_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 2 }
-};
-const ProtobufCMessageDescriptor ecs__control_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.ControlAns",
- "ControlAns",
- "ECS__ControlAns",
- "ECS",
- sizeof(ECS__ControlAns),
- 2,
- ecs__control_ans__field_descriptors,
- ecs__control_ans__field_indices_by_name,
- 1, ecs__control_ans__number_ranges,
- (ProtobufCMessageInit) ecs__control_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__control_ntf__field_descriptors[3] =
-{
- {
- "category",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlNtf, category),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "command",
- 2,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ControlNtf, command),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__ControlNtf, has_data),
- PROTOBUF_C_OFFSETOF(ECS__ControlNtf, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__control_ntf__field_indices_by_name[] = {
- 0, /* field[0] = category */
- 1, /* field[1] = command */
- 2, /* field[2] = data */
-};
-static const ProtobufCIntRange ecs__control_ntf__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 3 }
-};
-const ProtobufCMessageDescriptor ecs__control_ntf__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.ControlNtf",
- "ControlNtf",
- "ECS__ControlNtf",
- "ECS",
- sizeof(ECS__ControlNtf),
- 3,
- ecs__control_ntf__field_descriptors,
- ecs__control_ntf__field_indices_by_name,
- 1, ecs__control_ntf__number_ranges,
- (ProtobufCMessageInit) ecs__control_ntf__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__monitor_req__field_descriptors[1] =
-{
- {
- "command",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__MonitorReq, command),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__monitor_req__field_indices_by_name[] = {
- 0, /* field[0] = command */
-};
-static const ProtobufCIntRange ecs__monitor_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__monitor_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.MonitorReq",
- "MonitorReq",
- "ECS__MonitorReq",
- "ECS",
- sizeof(ECS__MonitorReq),
- 1,
- ecs__monitor_req__field_descriptors,
- ecs__monitor_req__field_indices_by_name,
- 1, ecs__monitor_req__number_ranges,
- (ProtobufCMessageInit) ecs__monitor_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__monitor_ans__field_descriptors[4] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__MonitorAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errmsg",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__MonitorAns, errmsg),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "command",
- 3,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__MonitorAns, command),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 4,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__MonitorAns, has_data),
- PROTOBUF_C_OFFSETOF(ECS__MonitorAns, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__monitor_ans__field_indices_by_name[] = {
- 2, /* field[2] = command */
- 3, /* field[3] = data */
- 0, /* field[0] = errcode */
- 1, /* field[1] = errmsg */
-};
-static const ProtobufCIntRange ecs__monitor_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 4 }
-};
-const ProtobufCMessageDescriptor ecs__monitor_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.MonitorAns",
- "MonitorAns",
- "ECS__MonitorAns",
- "ECS",
- sizeof(ECS__MonitorAns),
- 4,
- ecs__monitor_ans__field_descriptors,
- ecs__monitor_ans__field_indices_by_name,
- 1, ecs__monitor_ans__number_ranges,
- (ProtobufCMessageInit) ecs__monitor_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__monitor_ntf__field_descriptors[2] =
-{
- {
- "command",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, command),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "data",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BYTES,
- PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, has_data),
- PROTOBUF_C_OFFSETOF(ECS__MonitorNtf, data),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__monitor_ntf__field_indices_by_name[] = {
- 0, /* field[0] = command */
- 1, /* field[1] = data */
-};
-static const ProtobufCIntRange ecs__monitor_ntf__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 2 }
-};
-const ProtobufCMessageDescriptor ecs__monitor_ntf__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.MonitorNtf",
- "MonitorNtf",
- "ECS__MonitorNtf",
- "ECS",
- sizeof(ECS__MonitorNtf),
- 2,
- ecs__monitor_ntf__field_descriptors,
- ecs__monitor_ntf__field_indices_by_name,
- 1, ecs__monitor_ntf__number_ranges,
- (ProtobufCMessageInit) ecs__monitor_ntf__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__screen_dump_req__field_descriptors[1] =
-{
- {
- "output_path",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ScreenDumpReq, output_path),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__screen_dump_req__field_indices_by_name[] = {
- 0, /* field[0] = output_path */
-};
-static const ProtobufCIntRange ecs__screen_dump_req__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 1 }
-};
-const ProtobufCMessageDescriptor ecs__screen_dump_req__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.ScreenDumpReq",
- "ScreenDumpReq",
- "ECS__ScreenDumpReq",
- "ECS",
- sizeof(ECS__ScreenDumpReq),
- 1,
- ecs__screen_dump_req__field_descriptors,
- ecs__screen_dump_req__field_indices_by_name,
- 1, ecs__screen_dump_req__number_ranges,
- (ProtobufCMessageInit) ecs__screen_dump_req__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-static const ProtobufCFieldDescriptor ecs__screen_dump_ans__field_descriptors[2] =
-{
- {
- "errcode",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_INT32,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ScreenDumpAns, errcode),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "errmsg",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_STRING,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__ScreenDumpAns, errmsg),
- NULL,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__screen_dump_ans__field_indices_by_name[] = {
- 0, /* field[0] = errcode */
- 1, /* field[1] = errmsg */
-};
-static const ProtobufCIntRange ecs__screen_dump_ans__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 2 }
-};
-const ProtobufCMessageDescriptor ecs__screen_dump_ans__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.ScreenDumpAns",
- "ScreenDumpAns",
- "ECS__ScreenDumpAns",
- "ECS",
- sizeof(ECS__ScreenDumpAns),
- 2,
- ecs__screen_dump_ans__field_descriptors,
- ecs__screen_dump_ans__field_indices_by_name,
- 1, ecs__screen_dump_ans__number_ranges,
- (ProtobufCMessageInit) ecs__screen_dump_ans__init,
- NULL,NULL,NULL /* reserved[123] */
-};
-const ProtobufCEnumValue ecs__master__type__enum_values_by_number[20] =
-{
- { "CHECKVERSION_REQ", "ECS__MASTER__TYPE__CHECKVERSION_REQ", 2 },
- { "CHECKVERSION_ANS", "ECS__MASTER__TYPE__CHECKVERSION_ANS", 3 },
- { "KEEPALIVE_REQ", "ECS__MASTER__TYPE__KEEPALIVE_REQ", 4 },
- { "KEEPALIVE_ANS", "ECS__MASTER__TYPE__KEEPALIVE_ANS", 5 },
- { "START_REQ", "ECS__MASTER__TYPE__START_REQ", 6 },
- { "START_ANS", "ECS__MASTER__TYPE__START_ANS", 7 },
- { "INJECTOR_REQ", "ECS__MASTER__TYPE__INJECTOR_REQ", 8 },
- { "INJECTOR_ANS", "ECS__MASTER__TYPE__INJECTOR_ANS", 9 },
- { "INJECTOR_NTF", "ECS__MASTER__TYPE__INJECTOR_NTF", 10 },
- { "DEVICE_REQ", "ECS__MASTER__TYPE__DEVICE_REQ", 11 },
- { "DEVICE_ANS", "ECS__MASTER__TYPE__DEVICE_ANS", 12 },
- { "DEVICE_NTF", "ECS__MASTER__TYPE__DEVICE_NTF", 13 },
- { "CONTROL_MSG", "ECS__MASTER__TYPE__CONTROL_MSG", 14 },
- { "CONTROL_ANS", "ECS__MASTER__TYPE__CONTROL_ANS", 15 },
- { "CONTROL_NTF", "ECS__MASTER__TYPE__CONTROL_NTF", 16 },
- { "MONITOR_REQ", "ECS__MASTER__TYPE__MONITOR_REQ", 17 },
- { "MONITOR_ANS", "ECS__MASTER__TYPE__MONITOR_ANS", 18 },
- { "MONITOR_NTF", "ECS__MASTER__TYPE__MONITOR_NTF", 19 },
- { "SCREEN_DUMP_REQ", "ECS__MASTER__TYPE__SCREEN_DUMP_REQ", 20 },
- { "SCREEN_DUMP_ANS", "ECS__MASTER__TYPE__SCREEN_DUMP_ANS", 21 },
-};
-static const ProtobufCIntRange ecs__master__type__value_ranges[] = {
-{2, 0},{0, 20}
-};
-const ProtobufCEnumValueIndex ecs__master__type__enum_values_by_name[20] =
-{
- { "CHECKVERSION_ANS", 1 },
- { "CHECKVERSION_REQ", 0 },
- { "CONTROL_ANS", 13 },
- { "CONTROL_MSG", 12 },
- { "CONTROL_NTF", 14 },
- { "DEVICE_ANS", 10 },
- { "DEVICE_NTF", 11 },
- { "DEVICE_REQ", 9 },
- { "INJECTOR_ANS", 7 },
- { "INJECTOR_NTF", 8 },
- { "INJECTOR_REQ", 6 },
- { "KEEPALIVE_ANS", 3 },
- { "KEEPALIVE_REQ", 2 },
- { "MONITOR_ANS", 16 },
- { "MONITOR_NTF", 17 },
- { "MONITOR_REQ", 15 },
- { "SCREEN_DUMP_ANS", 19 },
- { "SCREEN_DUMP_REQ", 18 },
- { "START_ANS", 5 },
- { "START_REQ", 4 },
-};
-const ProtobufCEnumDescriptor ecs__master__type__descriptor =
-{
- PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,
- "ECS.Master.Type",
- "Type",
- "ECS__Master__Type",
- "ECS",
- 20,
- ecs__master__type__enum_values_by_number,
- 20,
- ecs__master__type__enum_values_by_name,
- 1,
- ecs__master__type__value_ranges,
- NULL,NULL,NULL,NULL /* reserved[1234] */
-};
-static const ProtobufCFieldDescriptor ecs__master__field_descriptors[21] =
-{
- {
- "type",
- 1,
- PROTOBUF_C_LABEL_REQUIRED,
- PROTOBUF_C_TYPE_ENUM,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, type),
- &ecs__master__type__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "checkversion_req",
- 2,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, checkversion_req),
- &ecs__check_version_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "checkversion_ans",
- 3,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, checkversion_ans),
- &ecs__check_version_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "keepalive_req",
- 4,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, keepalive_req),
- &ecs__keep_alive_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "keepalive_ans",
- 5,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, keepalive_ans),
- &ecs__keep_alive_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "start_req",
- 6,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, start_req),
- &ecs__start_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "start_ans",
- 7,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, start_ans),
- &ecs__start_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "injector_req",
- 8,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, injector_req),
- &ecs__injector_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "injector_ans",
- 9,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, injector_ans),
- &ecs__injector_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "injector_ntf",
- 10,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, injector_ntf),
- &ecs__injector_ntf__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "device_req",
- 11,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, device_req),
- &ecs__device_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "device_ans",
- 12,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, device_ans),
- &ecs__device_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "device_ntf",
- 13,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, device_ntf),
- &ecs__device_ntf__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "control_msg",
- 14,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, control_msg),
- &ecs__control_msg__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "control_ans",
- 15,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, control_ans),
- &ecs__control_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "control_ntf",
- 16,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, control_ntf),
- &ecs__control_ntf__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "monitor_req",
- 17,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, monitor_req),
- &ecs__monitor_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "monitor_ans",
- 18,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, monitor_ans),
- &ecs__monitor_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "monitor_ntf",
- 19,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, monitor_ntf),
- &ecs__monitor_ntf__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "screen_dump_req",
- 20,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, screen_dump_req),
- &ecs__screen_dump_req__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
- {
- "screen_dump_ans",
- 21,
- PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_MESSAGE,
- 0, /* quantifier_offset */
- PROTOBUF_C_OFFSETOF(ECS__Master, screen_dump_ans),
- &ecs__screen_dump_ans__descriptor,
- NULL,
- 0, /* packed */
- 0,NULL,NULL /* reserved1,reserved2, etc */
- },
-};
-static const unsigned ecs__master__field_indices_by_name[] = {
- 2, /* field[2] = checkversion_ans */
- 1, /* field[1] = checkversion_req */
- 14, /* field[14] = control_ans */
- 13, /* field[13] = control_msg */
- 15, /* field[15] = control_ntf */
- 11, /* field[11] = device_ans */
- 12, /* field[12] = device_ntf */
- 10, /* field[10] = device_req */
- 8, /* field[8] = injector_ans */
- 9, /* field[9] = injector_ntf */
- 7, /* field[7] = injector_req */
- 4, /* field[4] = keepalive_ans */
- 3, /* field[3] = keepalive_req */
- 17, /* field[17] = monitor_ans */
- 18, /* field[18] = monitor_ntf */
- 16, /* field[16] = monitor_req */
- 20, /* field[20] = screen_dump_ans */
- 19, /* field[19] = screen_dump_req */
- 6, /* field[6] = start_ans */
- 5, /* field[5] = start_req */
- 0, /* field[0] = type */
-};
-static const ProtobufCIntRange ecs__master__number_ranges[1 + 1] =
-{
- { 1, 0 },
- { 0, 21 }
-};
-const ProtobufCMessageDescriptor ecs__master__descriptor =
-{
- PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
- "ECS.Master",
- "Master",
- "ECS__Master",
- "ECS",
- sizeof(ECS__Master),
- 21,
- ecs__master__field_descriptors,
- ecs__master__field_indices_by_name,
- 1, ecs__master__number_ranges,
- (ProtobufCMessageInit) ecs__master__init,
- NULL,NULL,NULL /* reserved[123] */
-};
+++ /dev/null
-/* Generated by the protocol buffer compiler. DO NOT EDIT! */
-
-#ifndef PROTOBUF_C_ecs_2eproto__INCLUDED
-#define PROTOBUF_C_ecs_2eproto__INCLUDED
-
-#include "../../distrib/protobuf/protobuf-c.h"
-
-PROTOBUF_C_BEGIN_DECLS
-
-
-typedef struct _ECS__CheckVersionReq ECS__CheckVersionReq;
-typedef struct _ECS__CheckVersionAns ECS__CheckVersionAns;
-typedef struct _ECS__KeepAliveReq ECS__KeepAliveReq;
-typedef struct _ECS__KeepAliveAns ECS__KeepAliveAns;
-typedef struct _ECS__StartReq ECS__StartReq;
-typedef struct _ECS__StartAns ECS__StartAns;
-typedef struct _ECS__InjectorReq ECS__InjectorReq;
-typedef struct _ECS__InjectorAns ECS__InjectorAns;
-typedef struct _ECS__InjectorNtf ECS__InjectorNtf;
-typedef struct _ECS__DeviceReq ECS__DeviceReq;
-typedef struct _ECS__DeviceAns ECS__DeviceAns;
-typedef struct _ECS__DeviceNtf ECS__DeviceNtf;
-typedef struct _ECS__HostKeyboardReq ECS__HostKeyboardReq;
-typedef struct _ECS__HostKeyboardNtf ECS__HostKeyboardNtf;
-typedef struct _ECS__ControlMsg ECS__ControlMsg;
-typedef struct _ECS__ControlAns ECS__ControlAns;
-typedef struct _ECS__ControlNtf ECS__ControlNtf;
-typedef struct _ECS__MonitorReq ECS__MonitorReq;
-typedef struct _ECS__MonitorAns ECS__MonitorAns;
-typedef struct _ECS__MonitorNtf ECS__MonitorNtf;
-typedef struct _ECS__ScreenDumpReq ECS__ScreenDumpReq;
-typedef struct _ECS__ScreenDumpAns ECS__ScreenDumpAns;
-typedef struct _ECS__Master ECS__Master;
-
-
-/* --- enums --- */
-
-typedef enum _ECS__ControlMsg__ControlType {
- ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_REQ = 2,
- ECS__CONTROL_MSG__CONTROL_TYPE__HOSTKEYBOARD_NTF = 3
-} ECS__ControlMsg__ControlType;
-typedef enum _ECS__Master__Type {
- ECS__MASTER__TYPE__CHECKVERSION_REQ = 2,
- ECS__MASTER__TYPE__CHECKVERSION_ANS = 3,
- ECS__MASTER__TYPE__KEEPALIVE_REQ = 4,
- ECS__MASTER__TYPE__KEEPALIVE_ANS = 5,
- ECS__MASTER__TYPE__START_REQ = 6,
- ECS__MASTER__TYPE__START_ANS = 7,
- ECS__MASTER__TYPE__INJECTOR_REQ = 8,
- ECS__MASTER__TYPE__INJECTOR_ANS = 9,
- ECS__MASTER__TYPE__INJECTOR_NTF = 10,
- ECS__MASTER__TYPE__DEVICE_REQ = 11,
- ECS__MASTER__TYPE__DEVICE_ANS = 12,
- ECS__MASTER__TYPE__DEVICE_NTF = 13,
- ECS__MASTER__TYPE__CONTROL_MSG = 14,
- ECS__MASTER__TYPE__CONTROL_ANS = 15,
- ECS__MASTER__TYPE__CONTROL_NTF = 16,
- ECS__MASTER__TYPE__MONITOR_REQ = 17,
- ECS__MASTER__TYPE__MONITOR_ANS = 18,
- ECS__MASTER__TYPE__MONITOR_NTF = 19,
- ECS__MASTER__TYPE__SCREEN_DUMP_REQ = 20,
- ECS__MASTER__TYPE__SCREEN_DUMP_ANS = 21
-} ECS__Master__Type;
-
-/* --- messages --- */
-
-struct _ECS__CheckVersionReq
-{
- ProtobufCMessage base;
- char *version_str;
-};
-#define ECS__CHECK_VERSION_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__check_version_req__descriptor) \
- , NULL }
-
-
-struct _ECS__CheckVersionAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *version_str;
-};
-#define ECS__CHECK_VERSION_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__check_version_ans__descriptor) \
- , 0, NULL }
-
-
-struct _ECS__KeepAliveReq
-{
- ProtobufCMessage base;
- char *time_str;
-};
-#define ECS__KEEP_ALIVE_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__keep_alive_req__descriptor) \
- , NULL }
-
-
-struct _ECS__KeepAliveAns
-{
- ProtobufCMessage base;
- char *time_str;
-};
-#define ECS__KEEP_ALIVE_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__keep_alive_ans__descriptor) \
- , NULL }
-
-
-struct _ECS__StartReq
-{
- ProtobufCMessage base;
-};
-#define ECS__START_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__start_req__descriptor) \
- }
-
-
-struct _ECS__StartAns
-{
- ProtobufCMessage base;
- protobuf_c_boolean has_host_keyboard_onoff;
- int32_t host_keyboard_onoff;
- protobuf_c_boolean has_earjack_onoff;
- int32_t earjack_onoff;
- protobuf_c_boolean has_camera_onoff;
- int32_t camera_onoff;
-};
-#define ECS__START_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__start_ans__descriptor) \
- , 0,0, 0,0, 0,0 }
-
-
-struct _ECS__InjectorReq
-{
- ProtobufCMessage base;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__INJECTOR_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_req__descriptor) \
- , NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__InjectorAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errstr;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__INJECTOR_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_ans__descriptor) \
- , 0, NULL, NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__InjectorNtf
-{
- ProtobufCMessage base;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__INJECTOR_NTF__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__injector_ntf__descriptor) \
- , NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__DeviceReq
-{
- ProtobufCMessage base;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__DEVICE_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__device_req__descriptor) \
- , NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__DeviceAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errstr;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__DEVICE_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__device_ans__descriptor) \
- , 0, NULL, NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__DeviceNtf
-{
- ProtobufCMessage base;
- char *category;
- int32_t length;
- int32_t group;
- int32_t action;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__DEVICE_NTF__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__device_ntf__descriptor) \
- , NULL, 0, 0, 0, 0,{0,NULL} }
-
-
-struct _ECS__HostKeyboardReq
-{
- ProtobufCMessage base;
- protobuf_c_boolean has_ison;
- int32_t ison;
-};
-#define ECS__HOST_KEYBOARD_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__host_keyboard_req__descriptor) \
- , 0,0 }
-
-
-struct _ECS__HostKeyboardNtf
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errstr;
- protobuf_c_boolean has_ison;
- int32_t ison;
-};
-#define ECS__HOST_KEYBOARD_NTF__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__host_keyboard_ntf__descriptor) \
- , 0, NULL, 0,0 }
-
-
-struct _ECS__ControlMsg
-{
- ProtobufCMessage base;
- ECS__ControlMsg__ControlType type;
- ECS__HostKeyboardReq *hostkeyboard_req;
- ECS__HostKeyboardNtf *hostkeyboard_ntf;
-};
-#define ECS__CONTROL_MSG__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__control_msg__descriptor) \
- , 0, NULL, NULL }
-
-
-struct _ECS__ControlAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errmsg;
-};
-#define ECS__CONTROL_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__control_ans__descriptor) \
- , 0, NULL }
-
-
-struct _ECS__ControlNtf
-{
- ProtobufCMessage base;
- char *category;
- char *command;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__CONTROL_NTF__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__control_ntf__descriptor) \
- , NULL, NULL, 0,{0,NULL} }
-
-
-struct _ECS__MonitorReq
-{
- ProtobufCMessage base;
- char *command;
-};
-#define ECS__MONITOR_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_req__descriptor) \
- , NULL }
-
-
-struct _ECS__MonitorAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errmsg;
- char *command;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__MONITOR_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_ans__descriptor) \
- , 0, NULL, NULL, 0,{0,NULL} }
-
-
-struct _ECS__MonitorNtf
-{
- ProtobufCMessage base;
- char *command;
- protobuf_c_boolean has_data;
- ProtobufCBinaryData data;
-};
-#define ECS__MONITOR_NTF__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__monitor_ntf__descriptor) \
- , NULL, 0,{0,NULL} }
-
-
-struct _ECS__ScreenDumpReq
-{
- ProtobufCMessage base;
- char *output_path;
-};
-#define ECS__SCREEN_DUMP_REQ__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__screen_dump_req__descriptor) \
- , NULL }
-
-
-struct _ECS__ScreenDumpAns
-{
- ProtobufCMessage base;
- int32_t errcode;
- char *errmsg;
-};
-#define ECS__SCREEN_DUMP_ANS__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__screen_dump_ans__descriptor) \
- , 0, NULL }
-
-
-struct _ECS__Master
-{
- ProtobufCMessage base;
- ECS__Master__Type type;
- ECS__CheckVersionReq *checkversion_req;
- ECS__CheckVersionAns *checkversion_ans;
- ECS__KeepAliveReq *keepalive_req;
- ECS__KeepAliveAns *keepalive_ans;
- ECS__StartReq *start_req;
- ECS__StartAns *start_ans;
- ECS__InjectorReq *injector_req;
- ECS__InjectorAns *injector_ans;
- ECS__InjectorNtf *injector_ntf;
- ECS__DeviceReq *device_req;
- ECS__DeviceAns *device_ans;
- ECS__DeviceNtf *device_ntf;
- ECS__ControlMsg *control_msg;
- ECS__ControlAns *control_ans;
- ECS__ControlNtf *control_ntf;
- ECS__MonitorReq *monitor_req;
- ECS__MonitorAns *monitor_ans;
- ECS__MonitorNtf *monitor_ntf;
- ECS__ScreenDumpReq *screen_dump_req;
- ECS__ScreenDumpAns *screen_dump_ans;
-};
-#define ECS__MASTER__INIT \
- { PROTOBUF_C_MESSAGE_INIT (&ecs__master__descriptor) \
- , 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-
-
-/* ECS__CheckVersionReq methods */
-void ecs__check_version_req__init
- (ECS__CheckVersionReq *message);
-size_t ecs__check_version_req__get_packed_size
- (const ECS__CheckVersionReq *message);
-size_t ecs__check_version_req__pack
- (const ECS__CheckVersionReq *message,
- uint8_t *out);
-size_t ecs__check_version_req__pack_to_buffer
- (const ECS__CheckVersionReq *message,
- ProtobufCBuffer *buffer);
-ECS__CheckVersionReq *
- ecs__check_version_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__check_version_req__free_unpacked
- (ECS__CheckVersionReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__CheckVersionAns methods */
-void ecs__check_version_ans__init
- (ECS__CheckVersionAns *message);
-size_t ecs__check_version_ans__get_packed_size
- (const ECS__CheckVersionAns *message);
-size_t ecs__check_version_ans__pack
- (const ECS__CheckVersionAns *message,
- uint8_t *out);
-size_t ecs__check_version_ans__pack_to_buffer
- (const ECS__CheckVersionAns *message,
- ProtobufCBuffer *buffer);
-ECS__CheckVersionAns *
- ecs__check_version_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__check_version_ans__free_unpacked
- (ECS__CheckVersionAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__KeepAliveReq methods */
-void ecs__keep_alive_req__init
- (ECS__KeepAliveReq *message);
-size_t ecs__keep_alive_req__get_packed_size
- (const ECS__KeepAliveReq *message);
-size_t ecs__keep_alive_req__pack
- (const ECS__KeepAliveReq *message,
- uint8_t *out);
-size_t ecs__keep_alive_req__pack_to_buffer
- (const ECS__KeepAliveReq *message,
- ProtobufCBuffer *buffer);
-ECS__KeepAliveReq *
- ecs__keep_alive_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__keep_alive_req__free_unpacked
- (ECS__KeepAliveReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__KeepAliveAns methods */
-void ecs__keep_alive_ans__init
- (ECS__KeepAliveAns *message);
-size_t ecs__keep_alive_ans__get_packed_size
- (const ECS__KeepAliveAns *message);
-size_t ecs__keep_alive_ans__pack
- (const ECS__KeepAliveAns *message,
- uint8_t *out);
-size_t ecs__keep_alive_ans__pack_to_buffer
- (const ECS__KeepAliveAns *message,
- ProtobufCBuffer *buffer);
-ECS__KeepAliveAns *
- ecs__keep_alive_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__keep_alive_ans__free_unpacked
- (ECS__KeepAliveAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__StartReq methods */
-void ecs__start_req__init
- (ECS__StartReq *message);
-size_t ecs__start_req__get_packed_size
- (const ECS__StartReq *message);
-size_t ecs__start_req__pack
- (const ECS__StartReq *message,
- uint8_t *out);
-size_t ecs__start_req__pack_to_buffer
- (const ECS__StartReq *message,
- ProtobufCBuffer *buffer);
-ECS__StartReq *
- ecs__start_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__start_req__free_unpacked
- (ECS__StartReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__StartAns methods */
-void ecs__start_ans__init
- (ECS__StartAns *message);
-size_t ecs__start_ans__get_packed_size
- (const ECS__StartAns *message);
-size_t ecs__start_ans__pack
- (const ECS__StartAns *message,
- uint8_t *out);
-size_t ecs__start_ans__pack_to_buffer
- (const ECS__StartAns *message,
- ProtobufCBuffer *buffer);
-ECS__StartAns *
- ecs__start_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__start_ans__free_unpacked
- (ECS__StartAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__InjectorReq methods */
-void ecs__injector_req__init
- (ECS__InjectorReq *message);
-size_t ecs__injector_req__get_packed_size
- (const ECS__InjectorReq *message);
-size_t ecs__injector_req__pack
- (const ECS__InjectorReq *message,
- uint8_t *out);
-size_t ecs__injector_req__pack_to_buffer
- (const ECS__InjectorReq *message,
- ProtobufCBuffer *buffer);
-ECS__InjectorReq *
- ecs__injector_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__injector_req__free_unpacked
- (ECS__InjectorReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__InjectorAns methods */
-void ecs__injector_ans__init
- (ECS__InjectorAns *message);
-size_t ecs__injector_ans__get_packed_size
- (const ECS__InjectorAns *message);
-size_t ecs__injector_ans__pack
- (const ECS__InjectorAns *message,
- uint8_t *out);
-size_t ecs__injector_ans__pack_to_buffer
- (const ECS__InjectorAns *message,
- ProtobufCBuffer *buffer);
-ECS__InjectorAns *
- ecs__injector_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__injector_ans__free_unpacked
- (ECS__InjectorAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__InjectorNtf methods */
-void ecs__injector_ntf__init
- (ECS__InjectorNtf *message);
-size_t ecs__injector_ntf__get_packed_size
- (const ECS__InjectorNtf *message);
-size_t ecs__injector_ntf__pack
- (const ECS__InjectorNtf *message,
- uint8_t *out);
-size_t ecs__injector_ntf__pack_to_buffer
- (const ECS__InjectorNtf *message,
- ProtobufCBuffer *buffer);
-ECS__InjectorNtf *
- ecs__injector_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__injector_ntf__free_unpacked
- (ECS__InjectorNtf *message,
- ProtobufCAllocator *allocator);
-/* ECS__DeviceReq methods */
-void ecs__device_req__init
- (ECS__DeviceReq *message);
-size_t ecs__device_req__get_packed_size
- (const ECS__DeviceReq *message);
-size_t ecs__device_req__pack
- (const ECS__DeviceReq *message,
- uint8_t *out);
-size_t ecs__device_req__pack_to_buffer
- (const ECS__DeviceReq *message,
- ProtobufCBuffer *buffer);
-ECS__DeviceReq *
- ecs__device_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__device_req__free_unpacked
- (ECS__DeviceReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__DeviceAns methods */
-void ecs__device_ans__init
- (ECS__DeviceAns *message);
-size_t ecs__device_ans__get_packed_size
- (const ECS__DeviceAns *message);
-size_t ecs__device_ans__pack
- (const ECS__DeviceAns *message,
- uint8_t *out);
-size_t ecs__device_ans__pack_to_buffer
- (const ECS__DeviceAns *message,
- ProtobufCBuffer *buffer);
-ECS__DeviceAns *
- ecs__device_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__device_ans__free_unpacked
- (ECS__DeviceAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__DeviceNtf methods */
-void ecs__device_ntf__init
- (ECS__DeviceNtf *message);
-size_t ecs__device_ntf__get_packed_size
- (const ECS__DeviceNtf *message);
-size_t ecs__device_ntf__pack
- (const ECS__DeviceNtf *message,
- uint8_t *out);
-size_t ecs__device_ntf__pack_to_buffer
- (const ECS__DeviceNtf *message,
- ProtobufCBuffer *buffer);
-ECS__DeviceNtf *
- ecs__device_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__device_ntf__free_unpacked
- (ECS__DeviceNtf *message,
- ProtobufCAllocator *allocator);
-/* ECS__HostKeyboardReq methods */
-void ecs__host_keyboard_req__init
- (ECS__HostKeyboardReq *message);
-size_t ecs__host_keyboard_req__get_packed_size
- (const ECS__HostKeyboardReq *message);
-size_t ecs__host_keyboard_req__pack
- (const ECS__HostKeyboardReq *message,
- uint8_t *out);
-size_t ecs__host_keyboard_req__pack_to_buffer
- (const ECS__HostKeyboardReq *message,
- ProtobufCBuffer *buffer);
-ECS__HostKeyboardReq *
- ecs__host_keyboard_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__host_keyboard_req__free_unpacked
- (ECS__HostKeyboardReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__HostKeyboardNtf methods */
-void ecs__host_keyboard_ntf__init
- (ECS__HostKeyboardNtf *message);
-size_t ecs__host_keyboard_ntf__get_packed_size
- (const ECS__HostKeyboardNtf *message);
-size_t ecs__host_keyboard_ntf__pack
- (const ECS__HostKeyboardNtf *message,
- uint8_t *out);
-size_t ecs__host_keyboard_ntf__pack_to_buffer
- (const ECS__HostKeyboardNtf *message,
- ProtobufCBuffer *buffer);
-ECS__HostKeyboardNtf *
- ecs__host_keyboard_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__host_keyboard_ntf__free_unpacked
- (ECS__HostKeyboardNtf *message,
- ProtobufCAllocator *allocator);
-/* ECS__ControlMsg methods */
-void ecs__control_msg__init
- (ECS__ControlMsg *message);
-size_t ecs__control_msg__get_packed_size
- (const ECS__ControlMsg *message);
-size_t ecs__control_msg__pack
- (const ECS__ControlMsg *message,
- uint8_t *out);
-size_t ecs__control_msg__pack_to_buffer
- (const ECS__ControlMsg *message,
- ProtobufCBuffer *buffer);
-ECS__ControlMsg *
- ecs__control_msg__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__control_msg__free_unpacked
- (ECS__ControlMsg *message,
- ProtobufCAllocator *allocator);
-/* ECS__ControlAns methods */
-void ecs__control_ans__init
- (ECS__ControlAns *message);
-size_t ecs__control_ans__get_packed_size
- (const ECS__ControlAns *message);
-size_t ecs__control_ans__pack
- (const ECS__ControlAns *message,
- uint8_t *out);
-size_t ecs__control_ans__pack_to_buffer
- (const ECS__ControlAns *message,
- ProtobufCBuffer *buffer);
-ECS__ControlAns *
- ecs__control_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__control_ans__free_unpacked
- (ECS__ControlAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__ControlNtf methods */
-void ecs__control_ntf__init
- (ECS__ControlNtf *message);
-size_t ecs__control_ntf__get_packed_size
- (const ECS__ControlNtf *message);
-size_t ecs__control_ntf__pack
- (const ECS__ControlNtf *message,
- uint8_t *out);
-size_t ecs__control_ntf__pack_to_buffer
- (const ECS__ControlNtf *message,
- ProtobufCBuffer *buffer);
-ECS__ControlNtf *
- ecs__control_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__control_ntf__free_unpacked
- (ECS__ControlNtf *message,
- ProtobufCAllocator *allocator);
-/* ECS__MonitorReq methods */
-void ecs__monitor_req__init
- (ECS__MonitorReq *message);
-size_t ecs__monitor_req__get_packed_size
- (const ECS__MonitorReq *message);
-size_t ecs__monitor_req__pack
- (const ECS__MonitorReq *message,
- uint8_t *out);
-size_t ecs__monitor_req__pack_to_buffer
- (const ECS__MonitorReq *message,
- ProtobufCBuffer *buffer);
-ECS__MonitorReq *
- ecs__monitor_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__monitor_req__free_unpacked
- (ECS__MonitorReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__MonitorAns methods */
-void ecs__monitor_ans__init
- (ECS__MonitorAns *message);
-size_t ecs__monitor_ans__get_packed_size
- (const ECS__MonitorAns *message);
-size_t ecs__monitor_ans__pack
- (const ECS__MonitorAns *message,
- uint8_t *out);
-size_t ecs__monitor_ans__pack_to_buffer
- (const ECS__MonitorAns *message,
- ProtobufCBuffer *buffer);
-ECS__MonitorAns *
- ecs__monitor_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__monitor_ans__free_unpacked
- (ECS__MonitorAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__MonitorNtf methods */
-void ecs__monitor_ntf__init
- (ECS__MonitorNtf *message);
-size_t ecs__monitor_ntf__get_packed_size
- (const ECS__MonitorNtf *message);
-size_t ecs__monitor_ntf__pack
- (const ECS__MonitorNtf *message,
- uint8_t *out);
-size_t ecs__monitor_ntf__pack_to_buffer
- (const ECS__MonitorNtf *message,
- ProtobufCBuffer *buffer);
-ECS__MonitorNtf *
- ecs__monitor_ntf__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__monitor_ntf__free_unpacked
- (ECS__MonitorNtf *message,
- ProtobufCAllocator *allocator);
-/* ECS__ScreenDumpReq methods */
-void ecs__screen_dump_req__init
- (ECS__ScreenDumpReq *message);
-size_t ecs__screen_dump_req__get_packed_size
- (const ECS__ScreenDumpReq *message);
-size_t ecs__screen_dump_req__pack
- (const ECS__ScreenDumpReq *message,
- uint8_t *out);
-size_t ecs__screen_dump_req__pack_to_buffer
- (const ECS__ScreenDumpReq *message,
- ProtobufCBuffer *buffer);
-ECS__ScreenDumpReq *
- ecs__screen_dump_req__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__screen_dump_req__free_unpacked
- (ECS__ScreenDumpReq *message,
- ProtobufCAllocator *allocator);
-/* ECS__ScreenDumpAns methods */
-void ecs__screen_dump_ans__init
- (ECS__ScreenDumpAns *message);
-size_t ecs__screen_dump_ans__get_packed_size
- (const ECS__ScreenDumpAns *message);
-size_t ecs__screen_dump_ans__pack
- (const ECS__ScreenDumpAns *message,
- uint8_t *out);
-size_t ecs__screen_dump_ans__pack_to_buffer
- (const ECS__ScreenDumpAns *message,
- ProtobufCBuffer *buffer);
-ECS__ScreenDumpAns *
- ecs__screen_dump_ans__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__screen_dump_ans__free_unpacked
- (ECS__ScreenDumpAns *message,
- ProtobufCAllocator *allocator);
-/* ECS__Master methods */
-void ecs__master__init
- (ECS__Master *message);
-size_t ecs__master__get_packed_size
- (const ECS__Master *message);
-size_t ecs__master__pack
- (const ECS__Master *message,
- uint8_t *out);
-size_t ecs__master__pack_to_buffer
- (const ECS__Master *message,
- ProtobufCBuffer *buffer);
-ECS__Master *
- ecs__master__unpack
- (ProtobufCAllocator *allocator,
- size_t len,
- const uint8_t *data);
-void ecs__master__free_unpacked
- (ECS__Master *message,
- ProtobufCAllocator *allocator);
-/* --- per-message closures --- */
-
-typedef void (*ECS__CheckVersionReq_Closure)
- (const ECS__CheckVersionReq *message,
- void *closure_data);
-typedef void (*ECS__CheckVersionAns_Closure)
- (const ECS__CheckVersionAns *message,
- void *closure_data);
-typedef void (*ECS__KeepAliveReq_Closure)
- (const ECS__KeepAliveReq *message,
- void *closure_data);
-typedef void (*ECS__KeepAliveAns_Closure)
- (const ECS__KeepAliveAns *message,
- void *closure_data);
-typedef void (*ECS__StartReq_Closure)
- (const ECS__StartReq *message,
- void *closure_data);
-typedef void (*ECS__StartAns_Closure)
- (const ECS__StartAns *message,
- void *closure_data);
-typedef void (*ECS__InjectorReq_Closure)
- (const ECS__InjectorReq *message,
- void *closure_data);
-typedef void (*ECS__InjectorAns_Closure)
- (const ECS__InjectorAns *message,
- void *closure_data);
-typedef void (*ECS__InjectorNtf_Closure)
- (const ECS__InjectorNtf *message,
- void *closure_data);
-typedef void (*ECS__DeviceReq_Closure)
- (const ECS__DeviceReq *message,
- void *closure_data);
-typedef void (*ECS__DeviceAns_Closure)
- (const ECS__DeviceAns *message,
- void *closure_data);
-typedef void (*ECS__DeviceNtf_Closure)
- (const ECS__DeviceNtf *message,
- void *closure_data);
-typedef void (*ECS__HostKeyboardReq_Closure)
- (const ECS__HostKeyboardReq *message,
- void *closure_data);
-typedef void (*ECS__HostKeyboardNtf_Closure)
- (const ECS__HostKeyboardNtf *message,
- void *closure_data);
-typedef void (*ECS__ControlMsg_Closure)
- (const ECS__ControlMsg *message,
- void *closure_data);
-typedef void (*ECS__ControlAns_Closure)
- (const ECS__ControlAns *message,
- void *closure_data);
-typedef void (*ECS__ControlNtf_Closure)
- (const ECS__ControlNtf *message,
- void *closure_data);
-typedef void (*ECS__MonitorReq_Closure)
- (const ECS__MonitorReq *message,
- void *closure_data);
-typedef void (*ECS__MonitorAns_Closure)
- (const ECS__MonitorAns *message,
- void *closure_data);
-typedef void (*ECS__MonitorNtf_Closure)
- (const ECS__MonitorNtf *message,
- void *closure_data);
-typedef void (*ECS__ScreenDumpReq_Closure)
- (const ECS__ScreenDumpReq *message,
- void *closure_data);
-typedef void (*ECS__ScreenDumpAns_Closure)
- (const ECS__ScreenDumpAns *message,
- void *closure_data);
-typedef void (*ECS__Master_Closure)
- (const ECS__Master *message,
- void *closure_data);
-
-/* --- services --- */
-
-
-/* --- descriptors --- */
-
-extern const ProtobufCMessageDescriptor ecs__check_version_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__check_version_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__keep_alive_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__keep_alive_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__start_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__start_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__injector_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__injector_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__injector_ntf__descriptor;
-extern const ProtobufCMessageDescriptor ecs__device_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__device_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__device_ntf__descriptor;
-extern const ProtobufCMessageDescriptor ecs__host_keyboard_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__host_keyboard_ntf__descriptor;
-extern const ProtobufCMessageDescriptor ecs__control_msg__descriptor;
-extern const ProtobufCEnumDescriptor ecs__control_msg__control_type__descriptor;
-extern const ProtobufCMessageDescriptor ecs__control_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__control_ntf__descriptor;
-extern const ProtobufCMessageDescriptor ecs__monitor_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__monitor_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__monitor_ntf__descriptor;
-extern const ProtobufCMessageDescriptor ecs__screen_dump_req__descriptor;
-extern const ProtobufCMessageDescriptor ecs__screen_dump_ans__descriptor;
-extern const ProtobufCMessageDescriptor ecs__master__descriptor;
-extern const ProtobufCEnumDescriptor ecs__master__type__descriptor;
-
-PROTOBUF_C_END_DECLS
-
-
-#endif /* PROTOBUF_ecs_2eproto__INCLUDED */
#include "maru_device_ids.h"
#include "maru_virtio_evdi.h"
#include "debug_ch.h"
-#include "../ecs.h"
+#include "../ecs/ecs.h"
MULTI_DEBUG_CHANNEL(qemu, virtio-evdi);
#include "maru_device_ids.h"\r
#include "maru_virtio_nfc.h"\r
#include "debug_ch.h"\r
-#include "../ecs.h"\r
+#include "../ecs/ecs.h"\r
\r
MULTI_DEBUG_CHANNEL(qemu, virtio-nfc);\r
\r
#include "maru_device_ids.h"
#include "maru_virtio_sensor.h"
#include "debug_ch.h"
-#include "../ecs.h"
+#include "../ecs/ecs.h"
MULTI_DEBUG_CHANNEL(qemu, virtio-sensor);
+++ /dev/null
-package ECS;
-
-
-option java_package = "org.tizen.ecp.msg.genmsg.ecs";
-
-
-message CheckVersionReq {
- required string version_str = 1;
-}
-
-message CheckVersionAns {
- required int32 errcode = 1;
- required string version_str = 2;
-}
-
-message KeepAliveReq {
- optional string time_str = 1;
-
-}
-
-message KeepAliveAns {
- optional string time_str = 1;
-}
-
-
-message StartReq {
-
-}
-
-message StartAns {
- optional int32 host_keyboard_onoff = 1;
- optional int32 earjack_onoff = 2;
- optional int32 camera_onoff = 3;
-}
-
-message InjectorReq {
- required string category = 1;
- required int32 length = 2;
- required int32 group = 3;
- required int32 action = 4;
- optional bytes data = 5;
-}
-
-message InjectorAns {
- required int32 errcode = 1;
- optional string errstr = 2;
- required string category = 3;
- required int32 length = 4;
- required int32 group = 5;
- required int32 action = 6;
- optional bytes data = 7;
-}
-
-message InjectorNtf {
- required string category = 1;
- required int32 length = 2;
- required int32 group = 3;
- required int32 action = 4;
- optional bytes data = 5;
-}
-
-message DeviceReq {
- required string category = 1;
- required int32 length = 2;
- required int32 group = 3;
- required int32 action = 4;
- optional bytes data = 5;
-}
-
-message DeviceAns {
- required int32 errcode = 1;
- optional string errstr = 2;
- required string category = 3;
- required int32 length = 4;
- required int32 group = 5;
- required int32 action = 6;
- optional bytes data = 7;
-}
-
-message DeviceNtf {
- required string category = 1;
- required int32 length = 2;
- required int32 group = 3;
- required int32 action = 4;
- optional bytes data = 5;
-}
-
-
-
-// control message
-
-message HostKeyboardReq {
- optional int32 ison = 3;
-}
-
-message HostKeyboardNtf {
-
- required int32 errcode = 1;
- optional string errstr = 2;
- optional int32 ison = 3;
-}
-
-message ControlMsg {
-
- enum ControlType {
- HOSTKEYBOARD_REQ = 2; HOSTKEYBOARD_NTF = 3;
- }
-
- required ControlType type = 1;
-
- optional HostKeyboardReq hostkeyboard_req = 2;
- optional HostKeyboardNtf hostkeyboard_ntf = 3;
-}
-
-//
-
-message ControlAns {
- required int32 errcode = 1;
- optional string errmsg = 2;
-}
-
-message ControlNtf {
- required string category = 1;
- required string command = 2;
- optional bytes data = 3;
-}
-
-message MonitorReq {
- required string command = 1;
-}
-
-message MonitorAns {
- required int32 errcode = 1;
- optional string errmsg = 2;
- required string command = 3;
- optional bytes data = 4;
-}
-
-message MonitorNtf {
- required string command = 1;
- optional bytes data = 2;
-}
-
-message ScreenDumpReq {
- required string output_path = 1;
-}
-
-message ScreenDumpAns {
- required int32 errcode = 1;
- optional string errmsg = 2;
-}
-
-
-message Master {
- enum Type {
- CHECKVERSION_REQ = 2; CHECKVERSION_ANS = 3;
- KEEPALIVE_REQ = 4; KEEPALIVE_ANS = 5;
- START_REQ = 6; START_ANS = 7;
- INJECTOR_REQ = 8; INJECTOR_ANS = 9; INJECTOR_NTF = 10;
- DEVICE_REQ = 11; DEVICE_ANS = 12; DEVICE_NTF = 13;
- CONTROL_MSG = 14; CONTROL_ANS = 15; CONTROL_NTF = 16;
- MONITOR_REQ = 17; MONITOR_ANS = 18; MONITOR_NTF = 19;
- SCREEN_DUMP_REQ = 20; SCREEN_DUMP_ANS = 21;
- }
-
- required Type type = 1;
-
- optional CheckVersionReq checkversion_req = 2;
- optional CheckVersionAns checkversion_ans = 3;
-
- optional KeepAliveReq keepalive_req = 4;
- optional KeepAliveAns keepalive_ans = 5;
-
- optional StartReq start_req = 6;
- optional StartAns start_ans = 7;
-
- optional InjectorReq injector_req = 8;
- optional InjectorAns injector_ans = 9;
- optional InjectorNtf injector_ntf = 10;
-
- optional DeviceReq device_req = 11;
- optional DeviceAns device_ans = 12;
- optional DeviceNtf device_ntf = 13;
-
- optional ControlMsg control_msg = 14;
- optional ControlAns control_ans = 15;
- optional ControlNtf control_ntf = 16;
-
- optional MonitorReq monitor_req = 17;
- optional MonitorAns monitor_ans = 18;
- optional MonitorNtf monitor_ntf = 19;
-
- optional ScreenDumpReq screen_dump_req = 20;
- optional ScreenDumpAns screen_dump_ans = 21;
-
-}
-
-
+++ /dev/null
-#!/bin/sh
-
-
-protoc-c --c_out=../genmsg ecs.proto
#include "maruskin_client.h"
#include "emulator.h"
#include "maru_err_table.h"
-#include "ecs.h"
+#include "ecs/ecs.h"
#ifndef CONFIG_USE_SHM
#include "maru_sdl.h"