From 26ea84e1b74e3e24964e065142d01519372f1ffb Mon Sep 17 00:00:00 2001 From: Kitae Kim Date: Fri, 23 May 2014 20:22:05 +0900 Subject: [PATCH] tethering: add protobuf messages for display feature Change-Id: I019256786e9c9309fedf7cfc003d66fdceca7c19 Signed-off-by: Kitae Kim --- tizen/src/tethering/genmsg/tethering.pb-c.c | 138 ++++++++++++++++++++++++++-- tizen/src/tethering/genmsg/tethering.pb-c.h | 44 ++++++++- tizen/src/tethering/msg/tethering.proto | 9 ++ 3 files changed, 181 insertions(+), 10 deletions(-) diff --git a/tizen/src/tethering/genmsg/tethering.pb-c.c b/tizen/src/tethering/genmsg/tethering.pb-c.c index ad16dc1..fe58d32 100644 --- a/tizen/src/tethering/genmsg/tethering.pb-c.c +++ b/tizen/src/tethering/genmsg/tethering.pb-c.c @@ -565,6 +565,49 @@ void tethering__resolution__free_unpacked PROTOBUF_C_ASSERT (message->base.descriptor == &tethering__resolution__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void tethering__display_msg__init + (Tethering__DisplayMsg *message) +{ + static Tethering__DisplayMsg init_value = TETHERING__DISPLAY_MSG__INIT; + *message = init_value; +} +size_t tethering__display_msg__get_packed_size + (const Tethering__DisplayMsg *message) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &tethering__display_msg__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t tethering__display_msg__pack + (const Tethering__DisplayMsg *message, + uint8_t *out) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &tethering__display_msg__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t tethering__display_msg__pack_to_buffer + (const Tethering__DisplayMsg *message, + ProtobufCBuffer *buffer) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &tethering__display_msg__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Tethering__DisplayMsg * + tethering__display_msg__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Tethering__DisplayMsg *) + protobuf_c_message_unpack (&tethering__display_msg__descriptor, + allocator, len, data); +} +void tethering__display_msg__free_unpacked + (Tethering__DisplayMsg *message, + ProtobufCAllocator *allocator) +{ + PROTOBUF_C_ASSERT (message->base.descriptor == &tethering__display_msg__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void tethering__multi_touch_max_count__init (Tethering__MultiTouchMaxCount *message) { @@ -1455,6 +1498,70 @@ const ProtobufCMessageDescriptor tethering__resolution__descriptor = (ProtobufCMessageInit) tethering__resolution__init, NULL,NULL,NULL /* reserved[123] */ }; +static const ProtobufCFieldDescriptor tethering__display_msg__field_descriptors[3] = +{ + { + "onOff", + 2, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + PROTOBUF_C_OFFSETOF(Tethering__DisplayMsg, onoff), + NULL, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "frameRate", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_OFFSETOF(Tethering__DisplayMsg, has_framerate), + PROTOBUF_C_OFFSETOF(Tethering__DisplayMsg, framerate), + NULL, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "imageData", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_OFFSETOF(Tethering__DisplayMsg, has_imagedata), + PROTOBUF_C_OFFSETOF(Tethering__DisplayMsg, imagedata), + NULL, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned tethering__display_msg__field_indices_by_name[] = { + 1, /* field[1] = frameRate */ + 2, /* field[2] = imageData */ + 0, /* field[0] = onOff */ +}; +static const ProtobufCIntRange tethering__display_msg__number_ranges[1 + 1] = +{ + { 2, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor tethering__display_msg__descriptor = +{ + PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, + "tethering.DisplayMsg", + "DisplayMsg", + "Tethering__DisplayMsg", + "tethering", + sizeof(Tethering__DisplayMsg), + 3, + tethering__display_msg__field_descriptors, + tethering__display_msg__field_indices_by_name, + 1, tethering__display_msg__number_ranges, + (ProtobufCMessageInit) tethering__display_msg__init, + NULL,NULL,NULL /* reserved[123] */ +}; static const int32_t tethering__multi_touch_max_count__max__default_value = 10; static const ProtobufCFieldDescriptor tethering__multi_touch_max_count__field_descriptors[1] = { @@ -1574,7 +1681,7 @@ const ProtobufCMessageDescriptor tethering__multi_touch_data__descriptor = (ProtobufCMessageInit) tethering__multi_touch_data__init, NULL,NULL,NULL /* reserved[123] */ }; -const ProtobufCEnumValue tethering__multi_touch_msg__type__enum_values_by_number[6] = +const ProtobufCEnumValue tethering__multi_touch_msg__type__enum_values_by_number[7] = { { "START_REQ", "TETHERING__MULTI_TOUCH_MSG__TYPE__START_REQ", 2 }, { "START_ANS", "TETHERING__MULTI_TOUCH_MSG__TYPE__START_ANS", 3 }, @@ -1582,12 +1689,14 @@ const ProtobufCEnumValue tethering__multi_touch_msg__type__enum_values_by_number { "MAX_COUNT", "TETHERING__MULTI_TOUCH_MSG__TYPE__MAX_COUNT", 5 }, { "TOUCH_DATA", "TETHERING__MULTI_TOUCH_MSG__TYPE__TOUCH_DATA", 6 }, { "RESOLUTION", "TETHERING__MULTI_TOUCH_MSG__TYPE__RESOLUTION", 7 }, + { "DISPLAY", "TETHERING__MULTI_TOUCH_MSG__TYPE__DISPLAY", 8 }, }; static const ProtobufCIntRange tethering__multi_touch_msg__type__value_ranges[] = { -{2, 0},{0, 6} +{2, 0},{0, 7} }; -const ProtobufCEnumValueIndex tethering__multi_touch_msg__type__enum_values_by_name[6] = +const ProtobufCEnumValueIndex tethering__multi_touch_msg__type__enum_values_by_name[7] = { + { "DISPLAY", 6 }, { "MAX_COUNT", 3 }, { "RESOLUTION", 5 }, { "START_ANS", 1 }, @@ -1602,15 +1711,15 @@ const ProtobufCEnumDescriptor tethering__multi_touch_msg__type__descriptor = "Type", "Tethering__MultiTouchMsg__Type", "tethering", - 6, + 7, tethering__multi_touch_msg__type__enum_values_by_number, - 6, + 7, tethering__multi_touch_msg__type__enum_values_by_name, 1, tethering__multi_touch_msg__type__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; -static const ProtobufCFieldDescriptor tethering__multi_touch_msg__field_descriptors[7] = +static const ProtobufCFieldDescriptor tethering__multi_touch_msg__field_descriptors[8] = { { "type", @@ -1696,8 +1805,21 @@ static const ProtobufCFieldDescriptor tethering__multi_touch_msg__field_descript 0, /* packed */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "display", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + PROTOBUF_C_OFFSETOF(Tethering__MultiTouchMsg, display), + &tethering__display_msg__descriptor, + NULL, + 0, /* packed */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned tethering__multi_touch_msg__field_indices_by_name[] = { + 7, /* field[7] = display */ 4, /* field[4] = maxCount */ 6, /* field[6] = resolution */ 2, /* field[2] = startAns */ @@ -1709,7 +1831,7 @@ static const unsigned tethering__multi_touch_msg__field_indices_by_name[] = { static const ProtobufCIntRange tethering__multi_touch_msg__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 7 } + { 0, 8 } }; const ProtobufCMessageDescriptor tethering__multi_touch_msg__descriptor = { @@ -1719,7 +1841,7 @@ const ProtobufCMessageDescriptor tethering__multi_touch_msg__descriptor = "Tethering__MultiTouchMsg", "tethering", sizeof(Tethering__MultiTouchMsg), - 7, + 8, tethering__multi_touch_msg__field_descriptors, tethering__multi_touch_msg__field_indices_by_name, 1, tethering__multi_touch_msg__number_ranges, diff --git a/tizen/src/tethering/genmsg/tethering.pb-c.h b/tizen/src/tethering/genmsg/tethering.pb-c.h index 8e551c0..7b28c00 100644 --- a/tizen/src/tethering/genmsg/tethering.pb-c.h +++ b/tizen/src/tethering/genmsg/tethering.pb-c.h @@ -21,6 +21,7 @@ typedef struct _Tethering__SetSensorStatus Tethering__SetSensorStatus; typedef struct _Tethering__SensorData Tethering__SensorData; typedef struct _Tethering__SensorMsg Tethering__SensorMsg; typedef struct _Tethering__Resolution Tethering__Resolution; +typedef struct _Tethering__DisplayMsg Tethering__DisplayMsg; typedef struct _Tethering__MultiTouchMaxCount Tethering__MultiTouchMaxCount; typedef struct _Tethering__MultiTouchData Tethering__MultiTouchData; typedef struct _Tethering__MultiTouchMsg Tethering__MultiTouchMsg; @@ -48,7 +49,8 @@ typedef enum _Tethering__MultiTouchMsg__Type { TETHERING__MULTI_TOUCH_MSG__TYPE__TERMINATE = 4, TETHERING__MULTI_TOUCH_MSG__TYPE__MAX_COUNT = 5, TETHERING__MULTI_TOUCH_MSG__TYPE__TOUCH_DATA = 6, - TETHERING__MULTI_TOUCH_MSG__TYPE__RESOLUTION = 7 + TETHERING__MULTI_TOUCH_MSG__TYPE__RESOLUTION = 7, + TETHERING__MULTI_TOUCH_MSG__TYPE__DISPLAY = 8 } Tethering__MultiTouchMsg__Type; typedef enum _Tethering__TetheringMsg__Type { TETHERING__TETHERING_MSG__TYPE__HANDSHAKE_REQ = 2, @@ -237,6 +239,20 @@ struct _Tethering__Resolution , 0, 0 } +struct _Tethering__DisplayMsg +{ + ProtobufCMessage base; + protobuf_c_boolean onoff; + protobuf_c_boolean has_framerate; + int32_t framerate; + protobuf_c_boolean has_imagedata; + ProtobufCBinaryData imagedata; +}; +#define TETHERING__DISPLAY_MSG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&tethering__display_msg__descriptor) \ + , 0, 0,0, 0,{0,NULL} } + + struct _Tethering__MultiTouchMaxCount { ProtobufCMessage base; @@ -275,10 +291,11 @@ struct _Tethering__MultiTouchMsg Tethering__MultiTouchMaxCount *maxcount; Tethering__MultiTouchData *touchdata; Tethering__Resolution *resolution; + Tethering__DisplayMsg *display; }; #define TETHERING__MULTI_TOUCH_MSG__INIT \ { PROTOBUF_C_MESSAGE_INIT (&tethering__multi_touch_msg__descriptor) \ - , 0, NULL, NULL, NULL, NULL, NULL, NULL } + , 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL } struct _Tethering__TetheringMsg @@ -545,6 +562,25 @@ Tethering__Resolution * void tethering__resolution__free_unpacked (Tethering__Resolution *message, ProtobufCAllocator *allocator); +/* Tethering__DisplayMsg methods */ +void tethering__display_msg__init + (Tethering__DisplayMsg *message); +size_t tethering__display_msg__get_packed_size + (const Tethering__DisplayMsg *message); +size_t tethering__display_msg__pack + (const Tethering__DisplayMsg *message, + uint8_t *out); +size_t tethering__display_msg__pack_to_buffer + (const Tethering__DisplayMsg *message, + ProtobufCBuffer *buffer); +Tethering__DisplayMsg * + tethering__display_msg__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void tethering__display_msg__free_unpacked + (Tethering__DisplayMsg *message, + ProtobufCAllocator *allocator); /* Tethering__MultiTouchMaxCount methods */ void tethering__multi_touch_max_count__init (Tethering__MultiTouchMaxCount *message); @@ -662,6 +698,9 @@ typedef void (*Tethering__SensorMsg_Closure) typedef void (*Tethering__Resolution_Closure) (const Tethering__Resolution *message, void *closure_data); +typedef void (*Tethering__DisplayMsg_Closure) + (const Tethering__DisplayMsg *message, + void *closure_data); typedef void (*Tethering__MultiTouchMaxCount_Closure) (const Tethering__MultiTouchMaxCount *message, void *closure_data); @@ -701,6 +740,7 @@ extern const ProtobufCMessageDescriptor tethering__sensor_data__descriptor; extern const ProtobufCMessageDescriptor tethering__sensor_msg__descriptor; extern const ProtobufCEnumDescriptor tethering__sensor_msg__type__descriptor; extern const ProtobufCMessageDescriptor tethering__resolution__descriptor; +extern const ProtobufCMessageDescriptor tethering__display_msg__descriptor; extern const ProtobufCMessageDescriptor tethering__multi_touch_max_count__descriptor; extern const ProtobufCMessageDescriptor tethering__multi_touch_data__descriptor; extern const ProtobufCMessageDescriptor tethering__multi_touch_msg__descriptor; diff --git a/tizen/src/tethering/msg/tethering.proto b/tizen/src/tethering/msg/tethering.proto index cf08eee..9db3c38 100644 --- a/tizen/src/tethering/msg/tethering.proto +++ b/tizen/src/tethering/msg/tethering.proto @@ -123,6 +123,13 @@ message Resolution { required int32 height = 2; } +message DisplayMsg { + // required Resolution resolution = 1; + required bool onOff = 2; + optional int32 frameRate = 3; + optional bytes imageData = 4; +} + message MultiTouchMaxCount { optional int32 max = 1 [default = 10]; } @@ -142,6 +149,7 @@ message MultiTouchMsg { MAX_COUNT = 5; TOUCH_DATA = 6; RESOLUTION = 7; + DISPLAY = 8; } required Type type = 1; optional StartReq startReq = 2; @@ -150,6 +158,7 @@ message MultiTouchMsg { optional MultiTouchMaxCount maxCount = 5; optional MultiTouchData touchData = 6; optional Resolution resolution = 7; + optional DisplayMsg display = 8; } message TetheringMsg { -- 2.7.4