From 739fc9bb830e1eae6337b276e718c5492e70a242 Mon Sep 17 00:00:00 2001 From: DaiYoung Kim Date: Wed, 17 Jul 2013 20:27:54 +0900 Subject: [PATCH] ecp: apply protobuf Signed-off-by: DaiYoung, Kim --- tizen/src/Makefile.tizen | 10 +- tizen/src/ecs.c | 212 ++++- tizen/src/ecs.h | 2 + tizen/src/genmsg/ecs.pb-c.c | 1613 +++++++++++++++++++++++++++++++++++++++ tizen/src/genmsg/ecs.pb-c.h | 561 ++++++++++++++ tizen/src/hw/maru_device_ids.h | 0 tizen/src/hw/maru_virtio_evdi.c | 9 +- tizen/src/hw/maru_virtio_evdi.h | 0 tizen/src/msg/ecs.proto | 105 +++ 9 files changed, 2499 insertions(+), 13 deletions(-) create mode 100644 tizen/src/genmsg/ecs.pb-c.c create mode 100644 tizen/src/genmsg/ecs.pb-c.h mode change 100755 => 100644 tizen/src/hw/maru_device_ids.h mode change 100755 => 100644 tizen/src/hw/maru_virtio_evdi.c mode change 100755 => 100644 tizen/src/hw/maru_virtio_evdi.h create mode 100644 tizen/src/msg/ecs.proto diff --git a/tizen/src/Makefile.tizen b/tizen/src/Makefile.tizen index 87292a1..c2487b0 100755 --- a/tizen/src/Makefile.tizen +++ b/tizen/src/Makefile.tizen @@ -2,11 +2,13 @@ # for TIZEN-maru board -$(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) +$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/tizen/src/genmsg:$(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/libav/$(ARCH)/include QEMU_CFLAGS += -L$(SRC_PATH)/tizen/distrib/libav/$(ARCH)/lib +QEMU_CFLAGS += -L$(HOME)/install/lib QEMU_CFLAGS += $(SDL_CFLAGS) QEMU_CFLAGS += $(GLIB_CFLAGS) ifdef CONFIG_DARWIN @@ -24,7 +26,7 @@ ifdef CONFIG_WIN32 LIBS += -lavformat -lavcodec -lavutil -lm -lcurl -lopengl32 -lglu32 -lgdi32 endif ifdef CONFIG_LINUX -LIBS += -lavformat -lavcodec -lavutil -lm -lcurl -lGL -lXcomposite -lXext +LIBS += -lavformat -lavcodec -lavutil -lm -lcurl -lGL -lXcomposite -lXext -lprotobuf-c endif ifdef CONFIG_DARWIN # FIXME: disabled codec on Mac now @@ -107,6 +109,10 @@ obj-y += debug_ch.o # ecs obj-y += ecs_msg.o ecs.o ecs-json-streamer.o qmp_handler.o +# ecs msg +obj-y += ecs.pb-c.o + + # maru hardware include $(SRC_PATH)/tizen/src/Makefile.tizen.$(TARGET_BASE_ARCH) diff --git a/tizen/src/ecs.c b/tizen/src/ecs.c index b2b82ca..b3b8f19 100644 --- a/tizen/src/ecs.c +++ b/tizen/src/ecs.c @@ -23,6 +23,7 @@ #include #include #include "base64.h" +#include "genmsg/ecs.pb-c.h" #define DEBUG @@ -48,7 +49,7 @@ typedef struct mon_cmd_t { MonitorCompletion *cb, void *opaque); } mhandler; int flags; -} mon_cmd_t; +} static QTAILQ_HEAD(ECS_ClientHead, ECS_Client) clients = QTAILQ_HEAD_INITIALIZER(clients); @@ -747,6 +748,96 @@ bool ntf_to_injector(const char* data, const int len) { return true; } +bool ntf_to_injector2(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); + } + + + ECS__Master master = ECS__MASTER__INIT; + ECS__Injector ij = ECS__INJECTOR_INIT; + + strncpy(ij.category, cat, 10); + ij.length = length; + ij.group = group; + ij.action = action; + + memcpy(ij.data, ijdata, length); + + master.injector = &ij; + + int len_pack = ecs__master__get_packed_size(&master); + void* buf = malloc(len_pack); + ecs__master__pack(&master, buf); + + send_to_all_client(buf, len_pack); + + free(buf); + +// + QDict* obj_header = qdict_new(); + 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 ntf_to_control(const char* data, const int len) { return true; } @@ -757,6 +848,69 @@ bool ntf_to_monitor(const char* data, const int len) { static int ijcount = 0; +static bool msgproc_start_req(ECS_Client* ccli, ECS__StartReq* msg) +{ + + return true; +} + +static bool msgproc_injector_req(ECS_Client* ccli, ECS__InjectorReq* msg) +{ + char cmd[10]; + memset(cmd, 0, 10); + strcpy(cmd, injector->category); + type_length length = (type_length) injector->length; + type_group group = (type_group) (injector->group & 0xff); + type_action action = (type_action) (injector->action & 0xff); + + const char* data = injector->data.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 datalen = injector->data.len; + int sndlen = datalen + 14; + char* sndbuf = (char*) 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); + memcpy(sndbuf + 14, data, datalen); + + send_to_evdi(route_ij, sndbuf, sndlen); + + free(sndbuf); + + return true; +} + +static bool msgproc_control_req(ECS_Client *ccli, ECS__ControlReq* msg) +{ + + return true; +} + +static bool msgproc_monitor_req(ECS_Client *ccli, ECS__MonitorReq* msg) +{ + + return true; +} + +static bool msgproc_screen_dump_req(ECS_Client *ccli, ECS__ScreenDumpReq* msg) +{ + + return true; +} + static bool injector_command_proc(ECS_Client *clii, QObject *obj) { QDict* header = qdict_get_qdict(qobject_to_qdict(obj), "header"); @@ -1013,7 +1167,10 @@ static void ecs_read(ECS_Client *clii) { ecs_client_close(clii); } else if (0 < size) { LOG("read data: %s, len: %d, size: %d\n", buf, len, size); - ecs_json_message_parser_feed(&clii->parser, (const char *) buf, size); + + handle_protobuf_msg(clii, buf, size); + + //ecs_json_message_parser_feed(&clii->parser, (const char *) buf, size); } } @@ -1144,7 +1301,7 @@ static void alive_checker(void *opaque) { { if (1 == clii->keep_alive) { LOG("get client fd %d - keep alive fail", clii->client_fd); - ecs_client_close(clii); + //ecs_client_close(clii); continue; } LOG("set client fd %d - keep alive 1", clii->client_fd); @@ -1345,3 +1502,52 @@ int start_ecs(void) { } return 0; } + +bool handle_protobuf_msg(ECS_Client* cli, char* data, int len) +{ + ECS__Master* master = ecs__master__unpack(NULL, len, 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_REQ) + { + ECS__Control* msg = master->control_req + if (!msg) + goto fail; + msgproc_control_req(cli, msg); + } + else if (master->type == ECS__MASTER__TYPE__MONITOR_REQ) + { + ECS__Monitor* msg = master->monitor_req + if (!msg) + goto fail; + msgproc_monitor_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: + ecs__master__free_unpacked(master, NULL); + return false; +} + diff --git a/tizen/src/ecs.h b/tizen/src/ecs.h index fb9a56c..1fe78b2 100644 --- a/tizen/src/ecs.h +++ b/tizen/src/ecs.h @@ -99,6 +99,8 @@ int stop_ecs(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); diff --git a/tizen/src/genmsg/ecs.pb-c.c b/tizen/src/genmsg/ecs.pb-c.c new file mode 100644 index 0000000..b5067c7 --- /dev/null +++ b/tizen/src/genmsg/ecs.pb-c.c @@ -0,0 +1,1613 @@ +/* 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__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__control_req__init + (ECS__ControlReq *message) +{ + static ECS__ControlReq init_value = ECS__CONTROL_REQ__INIT; + *message = init_value; +} +size_t ecs__control_req__get_packed_size + (const ECS__ControlReq *message) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_req__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t ecs__control_req__pack + (const ECS__ControlReq *message, + uint8_t *out) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_req__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t ecs__control_req__pack_to_buffer + (const ECS__ControlReq *message, + ProtobufCBuffer *buffer) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_req__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ECS__ControlReq * + ecs__control_req__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ECS__ControlReq *) + protobuf_c_message_unpack (&ecs__control_req__descriptor, + allocator, len, data); +} +void ecs__control_req__free_unpacked + (ECS__ControlReq *message, + ProtobufCAllocator *allocator) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &ecs__control_req__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__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__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__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__control_req__field_descriptors[1] = +{ + { + "command", + 1, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + PROTOBUF_C_OFFSETOF(ECS__ControlReq, command), + NULL, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned ecs__control_req__field_indices_by_name[] = { + 0, /* field[0] = command */ +}; +static const ProtobufCIntRange ecs__control_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor ecs__control_req__descriptor = +{ + PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, + "ECS.ControlReq", + "ControlReq", + "ECS__ControlReq", + "ECS", + sizeof(ECS__ControlReq), + 1, + ecs__control_req__field_descriptors, + ecs__control_req__field_indices_by_name, + 1, ecs__control_req__number_ranges, + (ProtobufCMessageInit) ecs__control_req__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] */ +}; +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[0] = +{ +}; +static const unsigned ecs__start_ans__field_indices_by_name[] = { +}; +#define ecs__start_ans__number_ranges NULL +const ProtobufCMessageDescriptor ecs__start_ans__descriptor = +{ + PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, + "ECS.StartAns", + "StartAns", + "ECS__StartAns", + "ECS", + sizeof(ECS__StartAns), + 0, + ecs__start_ans__field_descriptors, + ecs__start_ans__field_indices_by_name, + 0, ecs__start_ans__number_ranges, + (ProtobufCMessageInit) ecs__start_ans__init, + NULL,NULL,NULL /* reserved[123] */ +}; +const ProtobufCEnumValue ecs__master__type__enum_values_by_number[13] = +{ + { "START_REQ", "ECS__MASTER__TYPE__START_REQ", 1 }, + { "START_ANS", "ECS__MASTER__TYPE__START_ANS", 2 }, + { "INJECTOR_REQ", "ECS__MASTER__TYPE__INJECTOR_REQ", 3 }, + { "INJECTOR_ANS", "ECS__MASTER__TYPE__INJECTOR_ANS", 4 }, + { "INJECTOR_NTF", "ECS__MASTER__TYPE__INJECTOR_NTF", 5 }, + { "CONTROL_REQ", "ECS__MASTER__TYPE__CONTROL_REQ", 6 }, + { "CONTROL_ANS", "ECS__MASTER__TYPE__CONTROL_ANS", 7 }, + { "CONTROL_NTF", "ECS__MASTER__TYPE__CONTROL_NTF", 8 }, + { "MONITOR_REQ", "ECS__MASTER__TYPE__MONITOR_REQ", 9 }, + { "MONITOR_ANS", "ECS__MASTER__TYPE__MONITOR_ANS", 10 }, + { "MONITOR_NTF", "ECS__MASTER__TYPE__MONITOR_NTF", 11 }, + { "SCREEN_DUMP_REQ", "ECS__MASTER__TYPE__SCREEN_DUMP_REQ", 12 }, + { "SCREEN_DUMP_ANS", "ECS__MASTER__TYPE__SCREEN_DUMP_ANS", 13 }, +}; +static const ProtobufCIntRange ecs__master__type__value_ranges[] = { +{1, 0},{0, 13} +}; +const ProtobufCEnumValueIndex ecs__master__type__enum_values_by_name[13] = +{ + { "CONTROL_ANS", 6 }, + { "CONTROL_NTF", 7 }, + { "CONTROL_REQ", 5 }, + { "INJECTOR_ANS", 3 }, + { "INJECTOR_NTF", 4 }, + { "INJECTOR_REQ", 2 }, + { "MONITOR_ANS", 9 }, + { "MONITOR_NTF", 10 }, + { "MONITOR_REQ", 8 }, + { "SCREEN_DUMP_ANS", 12 }, + { "SCREEN_DUMP_REQ", 11 }, + { "START_ANS", 1 }, + { "START_REQ", 0 }, +}; +const ProtobufCEnumDescriptor ecs__master__type__descriptor = +{ + PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, + "ECS.Master.Type", + "Type", + "ECS__Master__Type", + "ECS", + 13, + ecs__master__type__enum_values_by_number, + 13, + 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[14] = +{ + { + "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 */ + }, + { + "start_req", + 2, + 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", + 3, + 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", + 4, + 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", + 5, + 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", + 6, + 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 */ + }, + { + "control_req", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + PROTOBUF_C_OFFSETOF(ECS__Master, control_req), + &ecs__control_req__descriptor, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "control_ans", + 8, + 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", + 9, + 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", + 10, + 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", + 11, + 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", + 12, + 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", + 13, + 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", + 14, + 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[] = { + 7, /* field[7] = control_ans */ + 8, /* field[8] = control_ntf */ + 6, /* field[6] = control_req */ + 4, /* field[4] = injector_ans */ + 5, /* field[5] = injector_ntf */ + 3, /* field[3] = injector_req */ + 10, /* field[10] = monitor_ans */ + 11, /* field[11] = monitor_ntf */ + 9, /* field[9] = monitor_req */ + 13, /* field[13] = screen_dump_ans */ + 12, /* field[12] = screen_dump_req */ + 2, /* field[2] = start_ans */ + 1, /* field[1] = start_req */ + 0, /* field[0] = type */ +}; +static const ProtobufCIntRange ecs__master__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 14 } +}; +const ProtobufCMessageDescriptor ecs__master__descriptor = +{ + PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, + "ECS.Master", + "Master", + "ECS__Master", + "ECS", + sizeof(ECS__Master), + 14, + ecs__master__field_descriptors, + ecs__master__field_indices_by_name, + 1, ecs__master__number_ranges, + (ProtobufCMessageInit) ecs__master__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/tizen/src/genmsg/ecs.pb-c.h b/tizen/src/genmsg/ecs.pb-c.h new file mode 100644 index 0000000..7b0888e --- /dev/null +++ b/tizen/src/genmsg/ecs.pb-c.h @@ -0,0 +1,561 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ + +#ifndef PROTOBUF_C_ecs_2eproto__INCLUDED +#define PROTOBUF_C_ecs_2eproto__INCLUDED + +#include + +PROTOBUF_C_BEGIN_DECLS + + +typedef struct _ECS__InjectorReq ECS__InjectorReq; +typedef struct _ECS__InjectorAns ECS__InjectorAns; +typedef struct _ECS__InjectorNtf ECS__InjectorNtf; +typedef struct _ECS__ControlReq ECS__ControlReq; +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__StartReq ECS__StartReq; +typedef struct _ECS__StartAns ECS__StartAns; +typedef struct _ECS__Master ECS__Master; + + +/* --- enums --- */ + +typedef enum _ECS__Master__Type { + ECS__MASTER__TYPE__START_REQ = 1, + ECS__MASTER__TYPE__START_ANS = 2, + ECS__MASTER__TYPE__INJECTOR_REQ = 3, + ECS__MASTER__TYPE__INJECTOR_ANS = 4, + ECS__MASTER__TYPE__INJECTOR_NTF = 5, + ECS__MASTER__TYPE__CONTROL_REQ = 6, + ECS__MASTER__TYPE__CONTROL_ANS = 7, + ECS__MASTER__TYPE__CONTROL_NTF = 8, + ECS__MASTER__TYPE__MONITOR_REQ = 9, + ECS__MASTER__TYPE__MONITOR_ANS = 10, + ECS__MASTER__TYPE__MONITOR_NTF = 11, + ECS__MASTER__TYPE__SCREEN_DUMP_REQ = 12, + ECS__MASTER__TYPE__SCREEN_DUMP_ANS = 13 +} ECS__Master__Type; + +/* --- messages --- */ + +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__ControlReq +{ + ProtobufCMessage base; + char *command; +}; +#define ECS__CONTROL_REQ__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&ecs__control_req__descriptor) \ + , 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__StartReq +{ + ProtobufCMessage base; +}; +#define ECS__START_REQ__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&ecs__start_req__descriptor) \ + } + + +struct _ECS__StartAns +{ + ProtobufCMessage base; +}; +#define ECS__START_ANS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&ecs__start_ans__descriptor) \ + } + + +struct _ECS__Master +{ + ProtobufCMessage base; + ECS__Master__Type type; + ECS__StartReq *start_req; + ECS__StartAns *start_ans; + ECS__InjectorReq *injector_req; + ECS__InjectorAns *injector_ans; + ECS__InjectorNtf *injector_ntf; + ECS__ControlReq *control_req; + 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 } + + +/* 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__ControlReq methods */ +void ecs__control_req__init + (ECS__ControlReq *message); +size_t ecs__control_req__get_packed_size + (const ECS__ControlReq *message); +size_t ecs__control_req__pack + (const ECS__ControlReq *message, + uint8_t *out); +size_t ecs__control_req__pack_to_buffer + (const ECS__ControlReq *message, + ProtobufCBuffer *buffer); +ECS__ControlReq * + ecs__control_req__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void ecs__control_req__free_unpacked + (ECS__ControlReq *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__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__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__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__ControlReq_Closure) + (const ECS__ControlReq *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__StartReq_Closure) + (const ECS__StartReq *message, + void *closure_data); +typedef void (*ECS__StartAns_Closure) + (const ECS__StartAns *message, + void *closure_data); +typedef void (*ECS__Master_Closure) + (const ECS__Master *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +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__control_req__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__start_req__descriptor; +extern const ProtobufCMessageDescriptor ecs__start_ans__descriptor; +extern const ProtobufCMessageDescriptor ecs__master__descriptor; +extern const ProtobufCEnumDescriptor ecs__master__type__descriptor; + +PROTOBUF_C_END_DECLS + + +#endif /* PROTOBUF_ecs_2eproto__INCLUDED */ diff --git a/tizen/src/hw/maru_device_ids.h b/tizen/src/hw/maru_device_ids.h old mode 100755 new mode 100644 diff --git a/tizen/src/hw/maru_virtio_evdi.c b/tizen/src/hw/maru_virtio_evdi.c old mode 100755 new mode 100644 index b315a27..4e62549 --- a/tizen/src/hw/maru_virtio_evdi.c +++ b/tizen/src/hw/maru_virtio_evdi.c @@ -73,11 +73,6 @@ typedef struct MsgInfo static QTAILQ_HEAD(MsgInfoRecvHead , MsgInfo) evdi_recv_msg_queue = QTAILQ_HEAD_INITIALIZER(evdi_recv_msg_queue); - -static QTAILQ_HEAD(MsgInfoSendHead , MsgInfo) evdi_send_msg_queue = - QTAILQ_HEAD_INITIALIZER(evdi_send_msg_queue); - - // typedef struct EvdiBuf { @@ -91,7 +86,6 @@ static QTAILQ_HEAD(EvdiMsgHead , EvdiBuf) evdi_in_queue = static pthread_mutex_t recv_buf_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t send_buf_mutex = PTHREAD_MUTEX_INITIALIZER; bool send_to_evdi(const uint32_t route, char* data, const uint32_t len) { @@ -130,8 +124,6 @@ bool send_to_evdi(const uint32_t route, char* data, const uint32_t len) } -static int g_cnt = 0; - static void flush_evdi_recv_queue(void) { int index; @@ -165,6 +157,7 @@ static void flush_evdi_recv_queue(void) //INFO(">> virtqueue_pop. index: %d, out_num : %d, in_num : %d\n", index, elem.out_num, elem.in_num); + memset(elem.in_sg[0].iov_base, 0, elem.in_sg[0].iov_len); memcpy(elem.in_sg[0].iov_base, &msginfo->info, sizeof(struct msg_info)); //INFO(">> send to guest count = %d, use = %d, msg = %s, iov_len = %d \n", diff --git a/tizen/src/hw/maru_virtio_evdi.h b/tizen/src/hw/maru_virtio_evdi.h old mode 100755 new mode 100644 diff --git a/tizen/src/msg/ecs.proto b/tizen/src/msg/ecs.proto new file mode 100644 index 0000000..ae9d49b --- /dev/null +++ b/tizen/src/msg/ecs.proto @@ -0,0 +1,105 @@ +package ECS; + + +option java_package = "org.tizen.ecp.msg.genmsg.ecs"; + +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 ControlReq { + required string command = 1; +} + +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 StartReq { + +} + +message StartAns { + +} + +message Master { + enum Type { START_REQ = 1; START_ANS = 2; INJECTOR_REQ = 3; INJECTOR_ANS = 4; INJECTOR_NTF = 5; CONTROL_REQ = 6; CONTROL_ANS = 7; CONTROL_NTF = 8; MONITOR_REQ = 9; MONITOR_ANS = 10; MONITOR_NTF = 11; SCREEN_DUMP_REQ = 12; SCREEN_DUMP_ANS = 13; } + + required Type type = 1; + + optional StartReq start_req = 2; + optional StartAns start_ans = 3; + + optional InjectorReq injector_req = 4; + optional InjectorAns injector_ans = 5; + optional InjectorNtf injector_ntf = 6; + + optional ControlReq control_req = 7; + optional ControlAns control_ans = 8; + optional ControlNtf control_ntf = 9; + + optional MonitorReq monitor_req = 10; + optional MonitorAns monitor_ans = 11; + optional MonitorNtf monitor_ntf = 12; + + optional ScreenDumpReq screen_dump_req = 13; + optional ScreenDumpAns screen_dump_ans = 14; + +} + + -- 2.7.4