summaryrefslogtreecommitdiffstats
path: root/libs/nanopb/tests/intsizes/intsizes.proto
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
commit32e25cbca210a359b09768537b6f443fe90a3070 (patch)
tree3309794c15d8a8f8e9c1c08cad072ee1378813ba /libs/nanopb/tests/intsizes/intsizes.proto
parent76c43dec62b2e21cd6446360c00d4fe6b437533f (diff)
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'libs/nanopb/tests/intsizes/intsizes.proto')
-rw-r--r--libs/nanopb/tests/intsizes/intsizes.proto41
1 files changed, 41 insertions, 0 deletions
diff --git a/libs/nanopb/tests/intsizes/intsizes.proto b/libs/nanopb/tests/intsizes/intsizes.proto
new file mode 100644
index 00000000..91444d41
--- /dev/null
+++ b/libs/nanopb/tests/intsizes/intsizes.proto
@@ -0,0 +1,41 @@
+/* Test the integer size overriding in nanopb options.
+ * This allows to use 8- and 16-bit integer variables, which are not supported
+ * directly by Google Protobuf.
+ *
+ * The int_size setting will override the number of bits, but keep the type
+ * otherwise. E.g. uint32 + IS_8 => uint8_t
+ */
+
+syntax = "proto2";
+
+import 'nanopb.proto';
+
+message IntSizes {
+ required int32 req_int8 = 1 [(nanopb).int_size = IS_8];
+ required uint32 req_uint8 = 2 [(nanopb).int_size = IS_8];
+ required sint32 req_sint8 = 3 [(nanopb).int_size = IS_8];
+ required int32 req_int16 = 4 [(nanopb).int_size = IS_16];
+ required uint32 req_uint16 = 5 [(nanopb).int_size = IS_16];
+ required sint32 req_sint16 = 6 [(nanopb).int_size = IS_16];
+ required int32 req_int32 = 7 [(nanopb).int_size = IS_32];
+ required uint32 req_uint32 = 8 [(nanopb).int_size = IS_32];
+ required sint32 req_sint32 = 9 [(nanopb).int_size = IS_32];
+ required int32 req_int64 = 10 [(nanopb).int_size = IS_64];
+ required uint32 req_uint64 = 11 [(nanopb).int_size = IS_64];
+ required sint32 req_sint64 = 12 [(nanopb).int_size = IS_64];
+}
+
+message DefaultSizes {
+ required int32 req_int8 = 1 ;
+ required uint32 req_uint8 = 2 ;
+ required sint32 req_sint8 = 3 ;
+ required int32 req_int16 = 4 ;
+ required uint32 req_uint16 = 5 ;
+ required sint32 req_sint16 = 6 ;
+ required int32 req_int32 = 7 ;
+ required uint32 req_uint32 = 8 ;
+ required sint32 req_sint32 = 9 ;
+ required int64 req_int64 = 10;
+ required uint64 req_uint64 = 11;
+ required sint64 req_sint64 = 12;
+}