simplejsble 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroSimplejsble.podspec +9 -4
- package/VERSION +1 -0
- package/android/CMakeLists.txt +62 -20
- package/cmake/epilogue.cmake +81 -0
- package/cmake/find/FindDBus1.cmake +20 -0
- package/cmake/find/Findfmt.cmake +41 -0
- package/cmake/find/Findgoogletest.cmake +18 -0
- package/cmake/parse_version.cmake +45 -0
- package/cmake/prelude.cmake +8 -0
- package/dependencies/README +4 -0
- package/dependencies/external/kvn/kvn_bytearray.h +297 -0
- package/dependencies/external/kvn/kvn_safe_callback.hpp +66 -0
- package/dependencies/external/kvn/logfwd.hpp +35 -0
- package/dependencies/internal/include/fmt/LICENSE +27 -0
- package/dependencies/internal/include/fmt/args.h +220 -0
- package/dependencies/internal/include/fmt/base.h +2962 -0
- package/dependencies/internal/include/fmt/chrono.h +2338 -0
- package/dependencies/internal/include/fmt/color.h +610 -0
- package/dependencies/internal/include/fmt/compile.h +539 -0
- package/dependencies/internal/include/fmt/core.h +5 -0
- package/dependencies/internal/include/fmt/format-inl.h +1949 -0
- package/dependencies/internal/include/fmt/format.h +4244 -0
- package/dependencies/internal/include/fmt/os.h +427 -0
- package/dependencies/internal/include/fmt/ostream.h +166 -0
- package/dependencies/internal/include/fmt/printf.h +633 -0
- package/dependencies/internal/include/fmt/ranges.h +850 -0
- package/dependencies/internal/include/fmt/std.h +726 -0
- package/dependencies/internal/include/fmt/xchar.h +373 -0
- package/dependencies/internal/include/nanopb/pb.h +948 -0
- package/dependencies/internal/include/nanopb/pb_common.h +49 -0
- package/dependencies/internal/include/nanopb/pb_decode.h +204 -0
- package/dependencies/internal/include/nanopb/pb_encode.h +195 -0
- package/dependencies/internal/include/simplejni/Common.hpp +598 -0
- package/dependencies/internal/include/simplejni/References.hpp +151 -0
- package/dependencies/internal/include/simplejni/Registry.hpp +249 -0
- package/dependencies/internal/include/simplejni/VM.hpp +93 -0
- package/dependencies/internal/src/nanopb/pb_common.c +388 -0
- package/dependencies/internal/src/nanopb/pb_decode.c +1763 -0
- package/dependencies/internal/src/nanopb/pb_encode.c +1009 -0
- package/dependencies/internal/src/simplejni/Common.cpp +4 -0
- package/package.json +5 -1
- package/simpleble/CMakeLists.txt +519 -0
- package/simpleble/include/simpleble/Adapter.h +102 -0
- package/simpleble/include/simpleble/AdapterSafe.h +58 -0
- package/simpleble/include/simpleble/Advanced.h +50 -0
- package/simpleble/include/simpleble/Characteristic.h +39 -0
- package/simpleble/include/simpleble/Config.h +64 -0
- package/simpleble/include/simpleble/Descriptor.h +30 -0
- package/simpleble/include/simpleble/Exceptions.h +72 -0
- package/simpleble/include/simpleble/Logging.h +73 -0
- package/simpleble/include/simpleble/Peripheral.h +82 -0
- package/simpleble/include/simpleble/PeripheralSafe.h +64 -0
- package/simpleble/include/simpleble/Service.h +34 -0
- package/simpleble/include/simpleble/SimpleBLE.h +8 -0
- package/simpleble/include/simpleble/Types.h +49 -0
- package/simpleble/include/simpleble/Utils.h +13 -0
- package/simpleble/include/simpleble_c/DEPRECATED +2 -0
- package/simpleble/include/simpleble_c/adapter.h +188 -0
- package/simpleble/include/simpleble_c/logging.h +37 -0
- package/simpleble/include/simpleble_c/peripheral.h +304 -0
- package/simpleble/include/simpleble_c/simpleble.h +21 -0
- package/simpleble/include/simpleble_c/types.h +73 -0
- package/simpleble/include/simpleble_c/utils.h +27 -0
- package/simpleble/src/CommonUtils.h +63 -0
- package/simpleble/src/Config.cpp +25 -0
- package/simpleble/src/Exceptions.cpp +31 -0
- package/simpleble/src/Logging.cpp +136 -0
- package/simpleble/src/LoggingInternal.h +85 -0
- package/simpleble/src/Utils.cpp +24 -0
- package/simpleble/src/backends/android/AdapterAndroid.cpp +101 -0
- package/simpleble/src/backends/android/AdapterAndroid.h +67 -0
- package/simpleble/src/backends/android/BackendAndroid.cpp +41 -0
- package/simpleble/src/backends/android/BackendAndroid.h +26 -0
- package/simpleble/src/backends/android/PeripheralAndroid.cpp +365 -0
- package/simpleble/src/backends/android/PeripheralAndroid.h +90 -0
- package/simpleble/src/backends/android/bridge/BluetoothGattCallback.cpp +432 -0
- package/simpleble/src/backends/android/bridge/BluetoothGattCallback.h +102 -0
- package/simpleble/src/backends/android/bridge/ScanCallback.cpp +142 -0
- package/simpleble/src/backends/android/bridge/ScanCallback.h +55 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.cpp +107 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.h +55 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.cpp +68 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.h +54 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.cpp +115 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.h +75 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.cpp +142 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.h +66 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.cpp +67 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.h +46 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.cpp +106 -0
- package/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.h +47 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.cpp +47 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.h +37 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.cpp +69 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.h +41 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.cpp +63 -0
- package/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.h +42 -0
- package/simpleble/src/backends/android/types/android/os/ParcelUUID.cpp +32 -0
- package/simpleble/src/backends/android/types/android/os/ParcelUUID.h +30 -0
- package/simpleble/src/backends/android/types/android/util/SparseArray.cpp +54 -0
- package/simpleble/src/backends/android/types/android/util/SparseArray.h +37 -0
- package/simpleble/src/backends/android/types/java/util/Iterator.cpp +36 -0
- package/simpleble/src/backends/android/types/java/util/Iterator.h +28 -0
- package/simpleble/src/backends/android/types/java/util/List.cpp +29 -0
- package/simpleble/src/backends/android/types/java/util/List.h +27 -0
- package/simpleble/src/backends/android/types/java/util/Set.cpp +33 -0
- package/simpleble/src/backends/android/types/java/util/Set.h +28 -0
- package/simpleble/src/backends/android/types/java/util/UUID.cpp +26 -0
- package/simpleble/src/backends/android/types/java/util/UUID.h +29 -0
- package/simpleble/src/backends/common/AdapterBase.cpp +53 -0
- package/simpleble/src/backends/common/AdapterBase.h +81 -0
- package/simpleble/src/backends/common/AdapterBaseTypes.h +22 -0
- package/simpleble/src/backends/common/BackendBase.h +20 -0
- package/simpleble/src/backends/common/BackendUtils.h +33 -0
- package/simpleble/src/backends/common/CharacteristicBase.cpp +28 -0
- package/simpleble/src/backends/common/CharacteristicBase.h +38 -0
- package/simpleble/src/backends/common/DescriptorBase.cpp +7 -0
- package/simpleble/src/backends/common/DescriptorBase.h +19 -0
- package/simpleble/src/backends/common/PeripheralBase.h +82 -0
- package/simpleble/src/backends/common/ServiceBase.cpp +18 -0
- package/simpleble/src/backends/common/ServiceBase.h +28 -0
- package/simpleble/src/backends/dongl/AdapterBaseTypes.h +22 -0
- package/simpleble/src/backends/dongl/AdapterDongl.cpp +369 -0
- package/simpleble/src/backends/dongl/AdapterDongl.h +60 -0
- package/simpleble/src/backends/dongl/BackendDongl.cpp +35 -0
- package/simpleble/src/backends/dongl/PeripheralDongl.cpp +562 -0
- package/simpleble/src/backends/dongl/PeripheralDongl.h +136 -0
- package/simpleble/src/backends/dongl/protocol/basic.pb.c +33 -0
- package/simpleble/src/backends/dongl/protocol/basic.pb.h +172 -0
- package/simpleble/src/backends/dongl/protocol/d2h.pb.c +18 -0
- package/simpleble/src/backends/dongl/protocol/d2h.pb.h +118 -0
- package/simpleble/src/backends/dongl/protocol/h2d.pb.c +12 -0
- package/simpleble/src/backends/dongl/protocol/h2d.pb.h +69 -0
- package/simpleble/src/backends/dongl/protocol/simpleble.pb.c +123 -0
- package/simpleble/src/backends/dongl/protocol/simpleble.pb.h +908 -0
- package/simpleble/src/backends/dongl/protocol/softdevice.pb.c +18 -0
- package/simpleble/src/backends/dongl/protocol/softdevice.pb.h +815 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gap.pb.c +339 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gap.pb.h +2086 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gattc.pb.c +114 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gattc.pb.h +772 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gatts.pb.c +117 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_gatts.pb.h +766 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_types.pb.c +207 -0
- package/simpleble/src/backends/dongl/protocol/softdevice_types.pb.h +1686 -0
- package/simpleble/src/backends/dongl/serial/Protocol.cpp +887 -0
- package/simpleble/src/backends/dongl/serial/Protocol.h +117 -0
- package/simpleble/src/backends/dongl/serial/ProtocolBase.cpp +95 -0
- package/simpleble/src/backends/dongl/serial/ProtocolBase.h +54 -0
- package/simpleble/src/backends/dongl/serial/Wire.cpp +133 -0
- package/simpleble/src/backends/dongl/serial/Wire.h +116 -0
- package/simpleble/src/backends/dongl/usb/UsbHelper.cpp +53 -0
- package/simpleble/src/backends/dongl/usb/UsbHelper.h +32 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperApple.cpp +266 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperApple.h +34 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperImpl.h +29 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperLinux.cpp +21 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperLinux.h +22 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperNull.cpp +21 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperNull.h +22 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperWindows.cpp +21 -0
- package/simpleble/src/backends/dongl/usb/UsbHelperWindows.h +22 -0
- package/simpleble/src/backends/linux/AdapterLinux.cpp +102 -0
- package/simpleble/src/backends/linux/AdapterLinux.h +55 -0
- package/simpleble/src/backends/linux/BackendBluez.cpp +90 -0
- package/simpleble/src/backends/linux/PeripheralLinux.cpp +394 -0
- package/simpleble/src/backends/linux/PeripheralLinux.h +90 -0
- package/simpleble/src/backends/linux_legacy/AdapterLinuxLegacy.cpp +102 -0
- package/simpleble/src/backends/linux_legacy/AdapterLinuxLegacy.h +55 -0
- package/simpleble/src/backends/linux_legacy/BackendBluezLegacy.cpp +87 -0
- package/simpleble/src/backends/linux_legacy/PeripheralLinuxLegacy.cpp +376 -0
- package/simpleble/src/backends/linux_legacy/PeripheralLinuxLegacy.h +90 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Adapter.h +46 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Agent.h +52 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Bluez.h +37 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/BluezOrg.h +22 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/BluezOrgBluez.h +26 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/BluezRoot.h +32 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Characteristic.h +47 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Descriptor.h +33 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Device.h +64 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Exceptions.h +43 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Service.h +27 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/Types.h +9 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/Adapter1.h +49 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/Agent1.h +100 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/AgentManager1.h +24 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/Battery1.h +32 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/Device1.h +62 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/GattCharacteristic1.h +48 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/GattDescriptor1.h +41 -0
- package/simpleble/src/backends/linux_legacy/include/simplebluezlegacy/interfaces/GattService1.h +28 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/advanced/Interface.h +67 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/advanced/InterfaceRegistry.h +62 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/advanced/Proxy.h +117 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Connection.h +50 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Exceptions.h +56 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Holder.h +147 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Logging.h +57 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Message.h +89 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/base/Path.h +24 -0
- package/simpleble/src/backends/linux_legacy/include/simpledbuslegacy/interfaces/ObjectManager.h +26 -0
- package/simpleble/src/backends/linux_legacy/src/Adapter.cpp +78 -0
- package/simpleble/src/backends/linux_legacy/src/Agent.cpp +72 -0
- package/simpleble/src/backends/linux_legacy/src/Bluez.cpp +45 -0
- package/simpleble/src/backends/linux_legacy/src/BluezOrg.cpp +20 -0
- package/simpleble/src/backends/linux_legacy/src/BluezOrgBluez.cpp +23 -0
- package/simpleble/src/backends/linux_legacy/src/BluezRoot.cpp +44 -0
- package/simpleble/src/backends/linux_legacy/src/Characteristic.cpp +64 -0
- package/simpleble/src/backends/linux_legacy/src/Descriptor.cpp +27 -0
- package/simpleble/src/backends/linux_legacy/src/Device.cpp +104 -0
- package/simpleble/src/backends/linux_legacy/src/Exceptions.cpp +29 -0
- package/simpleble/src/backends/linux_legacy/src/Service.cpp +33 -0
- package/simpleble/src/backends/linux_legacy/src/advanced/Interface.cpp +155 -0
- package/simpleble/src/backends/linux_legacy/src/advanced/Proxy.cpp +374 -0
- package/simpleble/src/backends/linux_legacy/src/base/Connection.cpp +219 -0
- package/simpleble/src/backends/linux_legacy/src/base/Exceptions.cpp +39 -0
- package/simpleble/src/backends/linux_legacy/src/base/Holder.cpp +739 -0
- package/simpleble/src/backends/linux_legacy/src/base/Message.cpp +622 -0
- package/simpleble/src/backends/linux_legacy/src/base/Path.cpp +129 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/Adapter1.cpp +123 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/Agent1.cpp +143 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/AgentManager1.cpp +34 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/Battery1.cpp +30 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/Device1.cpp +170 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/GattCharacteristic1.cpp +118 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/GattDescriptor1.cpp +78 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/GattService1.cpp +28 -0
- package/simpleble/src/backends/linux_legacy/src/interfaces/ObjectManager.cpp +58 -0
- package/simpleble/src/backends/macos/AdapterBaseMacOS.h +29 -0
- package/simpleble/src/backends/macos/AdapterBaseMacOS.mm +235 -0
- package/simpleble/src/backends/macos/AdapterMac.h +78 -0
- package/simpleble/src/backends/macos/AdapterMac.mm +156 -0
- package/simpleble/src/backends/macos/BackendCoreBluetooth.mm +45 -0
- package/simpleble/src/backends/macos/PeripheralBaseMacOS.h +49 -0
- package/simpleble/src/backends/macos/PeripheralBaseMacOS.mm +714 -0
- package/simpleble/src/backends/macos/PeripheralMac.h +81 -0
- package/simpleble/src/backends/macos/PeripheralMac.mm +229 -0
- package/simpleble/src/backends/macos/Utils.h +9 -0
- package/simpleble/src/backends/macos/Utils.mm +23 -0
- package/simpleble/src/backends/plain/AdapterPlain.cpp +65 -0
- package/simpleble/src/backends/plain/AdapterPlain.h +49 -0
- package/simpleble/src/backends/plain/BackendPlain.cpp +30 -0
- package/simpleble/src/backends/plain/PeripheralPlain.cpp +159 -0
- package/simpleble/src/backends/plain/PeripheralPlain.h +72 -0
- package/simpleble/src/backends/windows/AdapterWindows.cpp +338 -0
- package/simpleble/src/backends/windows/AdapterWindows.h +89 -0
- package/simpleble/src/backends/windows/BackendWinRT.cpp +67 -0
- package/simpleble/src/backends/windows/BackendWinRT.h +18 -0
- package/simpleble/src/backends/windows/MtaManager.cpp +49 -0
- package/simpleble/src/backends/windows/MtaManager.h +90 -0
- package/simpleble/src/backends/windows/PeripheralWindows.cpp +487 -0
- package/simpleble/src/backends/windows/PeripheralWindows.h +129 -0
- package/simpleble/src/backends/windows/Utils.cpp +146 -0
- package/simpleble/src/backends/windows/Utils.h +47 -0
- package/simpleble/src/builders/BuildVec.h +32 -0
- package/simpleble/src/builders/BuilderBase.h +87 -0
- package/simpleble/src/external/TaskRunner.hpp +99 -0
- package/simpleble/src/external/ThreadRunner.h +52 -0
- package/simpleble/src/external/kvn_safe_callback.hpp +66 -0
- package/simpleble/src/external/kvn_safe_map.hpp +94 -0
- package/simpleble/src/external/kvn_threadrunner.hpp +70 -0
- package/simpleble/src/external/logfwd.hpp +35 -0
- package/simpleble/src/frontends/base/Adapter.cpp +111 -0
- package/simpleble/src/frontends/base/Advanced.cpp +34 -0
- package/simpleble/src/frontends/base/Backend.cpp +95 -0
- package/simpleble/src/frontends/base/Backend.h +76 -0
- package/simpleble/src/frontends/base/Characteristic.cpp +56 -0
- package/simpleble/src/frontends/base/Descriptor.cpp +21 -0
- package/simpleble/src/frontends/base/Peripheral.cpp +113 -0
- package/simpleble/src/frontends/base/Service.cpp +26 -0
- package/simpleble/src/frontends/safe/AdapterSafe.cpp +158 -0
- package/simpleble/src/frontends/safe/PeripheralSafe.cpp +219 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* pb_common.h: Common support functions for pb_encode.c and pb_decode.c.
|
|
2
|
+
* These functions are rarely needed by applications directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#ifndef PB_COMMON_H_INCLUDED
|
|
6
|
+
#define PB_COMMON_H_INCLUDED
|
|
7
|
+
|
|
8
|
+
#include "pb.h"
|
|
9
|
+
|
|
10
|
+
#ifdef __cplusplus
|
|
11
|
+
extern "C" {
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
/* Initialize the field iterator structure to beginning.
|
|
15
|
+
* Returns false if the message type is empty. */
|
|
16
|
+
bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_msgdesc_t *desc, void *message);
|
|
17
|
+
|
|
18
|
+
/* Get a field iterator for extension field. */
|
|
19
|
+
bool pb_field_iter_begin_extension(pb_field_iter_t *iter, pb_extension_t *extension);
|
|
20
|
+
|
|
21
|
+
/* Same as pb_field_iter_begin(), but for const message pointer.
|
|
22
|
+
* Note that the pointers in pb_field_iter_t will be non-const but shouldn't
|
|
23
|
+
* be written to when using these functions. */
|
|
24
|
+
bool pb_field_iter_begin_const(pb_field_iter_t *iter, const pb_msgdesc_t *desc, const void *message);
|
|
25
|
+
bool pb_field_iter_begin_extension_const(pb_field_iter_t *iter, const pb_extension_t *extension);
|
|
26
|
+
|
|
27
|
+
/* Advance the iterator to the next field.
|
|
28
|
+
* Returns false when the iterator wraps back to the first field. */
|
|
29
|
+
bool pb_field_iter_next(pb_field_iter_t *iter);
|
|
30
|
+
|
|
31
|
+
/* Advance the iterator until it points at a field with the given tag.
|
|
32
|
+
* Returns false if no such field exists. */
|
|
33
|
+
bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag);
|
|
34
|
+
|
|
35
|
+
/* Find a field with type PB_LTYPE_EXTENSION, or return false if not found.
|
|
36
|
+
* There can be only one extension range field per message. */
|
|
37
|
+
bool pb_field_iter_find_extension(pb_field_iter_t *iter);
|
|
38
|
+
|
|
39
|
+
#ifdef PB_VALIDATE_UTF8
|
|
40
|
+
/* Validate UTF-8 text string */
|
|
41
|
+
bool pb_validate_utf8(const char *s);
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
#ifdef __cplusplus
|
|
45
|
+
} /* extern "C" */
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
#endif
|
|
49
|
+
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/* pb_decode.h: Functions to decode protocol buffers. Depends on pb_decode.c.
|
|
2
|
+
* The main function is pb_decode. You also need an input stream, and the
|
|
3
|
+
* field descriptions created by nanopb_generator.py.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef PB_DECODE_H_INCLUDED
|
|
7
|
+
#define PB_DECODE_H_INCLUDED
|
|
8
|
+
|
|
9
|
+
#include "pb.h"
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
extern "C" {
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
/* Structure for defining custom input streams. You will need to provide
|
|
16
|
+
* a callback function to read the bytes from your storage, which can be
|
|
17
|
+
* for example a file or a network socket.
|
|
18
|
+
*
|
|
19
|
+
* The callback must conform to these rules:
|
|
20
|
+
*
|
|
21
|
+
* 1) Return false on IO errors. This will cause decoding to abort.
|
|
22
|
+
* 2) You can use state to store your own data (e.g. buffer pointer),
|
|
23
|
+
* and rely on pb_read to verify that no-body reads past bytes_left.
|
|
24
|
+
* 3) Your callback may be used with substreams, in which case bytes_left
|
|
25
|
+
* is different than from the main stream. Don't use bytes_left to compute
|
|
26
|
+
* any pointers.
|
|
27
|
+
*/
|
|
28
|
+
struct pb_istream_s
|
|
29
|
+
{
|
|
30
|
+
#ifdef PB_BUFFER_ONLY
|
|
31
|
+
/* Callback pointer is not used in buffer-only configuration.
|
|
32
|
+
* Having an int pointer here allows binary compatibility but
|
|
33
|
+
* gives an error if someone tries to assign callback function.
|
|
34
|
+
*/
|
|
35
|
+
int *callback;
|
|
36
|
+
#else
|
|
37
|
+
bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count);
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
/* state is a free field for use of the callback function defined above.
|
|
41
|
+
* Note that when pb_istream_from_buffer() is used, it reserves this field
|
|
42
|
+
* for its own use.
|
|
43
|
+
*/
|
|
44
|
+
void *state;
|
|
45
|
+
|
|
46
|
+
/* Maximum number of bytes left in this stream. Callback can report
|
|
47
|
+
* EOF before this limit is reached. Setting a limit is recommended
|
|
48
|
+
* when decoding directly from file or network streams to avoid
|
|
49
|
+
* denial-of-service by excessively long messages.
|
|
50
|
+
*/
|
|
51
|
+
size_t bytes_left;
|
|
52
|
+
|
|
53
|
+
#ifndef PB_NO_ERRMSG
|
|
54
|
+
/* Pointer to constant (ROM) string when decoding function returns error */
|
|
55
|
+
const char *errmsg;
|
|
56
|
+
#endif
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
#ifndef PB_NO_ERRMSG
|
|
60
|
+
#define PB_ISTREAM_EMPTY {0,0,0,0}
|
|
61
|
+
#else
|
|
62
|
+
#define PB_ISTREAM_EMPTY {0,0,0}
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
/***************************
|
|
66
|
+
* Main decoding functions *
|
|
67
|
+
***************************/
|
|
68
|
+
|
|
69
|
+
/* Decode a single protocol buffers message from input stream into a C structure.
|
|
70
|
+
* Returns true on success, false on any failure.
|
|
71
|
+
* The actual struct pointed to by dest must match the description in fields.
|
|
72
|
+
* Callback fields of the destination structure must be initialized by caller.
|
|
73
|
+
* All other fields will be initialized by this function.
|
|
74
|
+
*
|
|
75
|
+
* Example usage:
|
|
76
|
+
* MyMessage msg = {};
|
|
77
|
+
* uint8_t buffer[64];
|
|
78
|
+
* pb_istream_t stream;
|
|
79
|
+
*
|
|
80
|
+
* // ... read some data into buffer ...
|
|
81
|
+
*
|
|
82
|
+
* stream = pb_istream_from_buffer(buffer, count);
|
|
83
|
+
* pb_decode(&stream, MyMessage_fields, &msg);
|
|
84
|
+
*/
|
|
85
|
+
bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct);
|
|
86
|
+
|
|
87
|
+
/* Extended version of pb_decode, with several options to control
|
|
88
|
+
* the decoding process:
|
|
89
|
+
*
|
|
90
|
+
* PB_DECODE_NOINIT: Do not initialize the fields to default values.
|
|
91
|
+
* This is slightly faster if you do not need the default
|
|
92
|
+
* values and instead initialize the structure to 0 using
|
|
93
|
+
* e.g. memset(). This can also be used for merging two
|
|
94
|
+
* messages, i.e. combine already existing data with new
|
|
95
|
+
* values.
|
|
96
|
+
*
|
|
97
|
+
* PB_DECODE_DELIMITED: Input message starts with the message size as varint.
|
|
98
|
+
* Corresponds to parseDelimitedFrom() in Google's
|
|
99
|
+
* protobuf API.
|
|
100
|
+
*
|
|
101
|
+
* PB_DECODE_NULLTERMINATED: Stop reading when field tag is read as 0. This allows
|
|
102
|
+
* reading null terminated messages.
|
|
103
|
+
* NOTE: Until nanopb-0.4.0, pb_decode() also allows
|
|
104
|
+
* null-termination. This behaviour is not supported in
|
|
105
|
+
* most other protobuf implementations, so PB_DECODE_DELIMITED
|
|
106
|
+
* is a better option for compatibility.
|
|
107
|
+
*
|
|
108
|
+
* Multiple flags can be combined with bitwise or (| operator)
|
|
109
|
+
*/
|
|
110
|
+
#define PB_DECODE_NOINIT 0x01U
|
|
111
|
+
#define PB_DECODE_DELIMITED 0x02U
|
|
112
|
+
#define PB_DECODE_NULLTERMINATED 0x04U
|
|
113
|
+
bool pb_decode_ex(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags);
|
|
114
|
+
|
|
115
|
+
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
|
116
|
+
#define pb_decode_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NOINIT)
|
|
117
|
+
#define pb_decode_delimited(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED)
|
|
118
|
+
#define pb_decode_delimited_noinit(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED | PB_DECODE_NOINIT)
|
|
119
|
+
#define pb_decode_nullterminated(s,f,d) pb_decode_ex(s,f,d, PB_DECODE_NULLTERMINATED)
|
|
120
|
+
|
|
121
|
+
/* Release any allocated pointer fields. If you use dynamic allocation, you should
|
|
122
|
+
* call this for any successfully decoded message when you are done with it. If
|
|
123
|
+
* pb_decode() returns with an error, the message is already released.
|
|
124
|
+
*/
|
|
125
|
+
void pb_release(const pb_msgdesc_t *fields, void *dest_struct);
|
|
126
|
+
|
|
127
|
+
/**************************************
|
|
128
|
+
* Functions for manipulating streams *
|
|
129
|
+
**************************************/
|
|
130
|
+
|
|
131
|
+
/* Create an input stream for reading from a memory buffer.
|
|
132
|
+
*
|
|
133
|
+
* msglen should be the actual length of the message, not the full size of
|
|
134
|
+
* allocated buffer.
|
|
135
|
+
*
|
|
136
|
+
* Alternatively, you can use a custom stream that reads directly from e.g.
|
|
137
|
+
* a file or a network socket.
|
|
138
|
+
*/
|
|
139
|
+
pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen);
|
|
140
|
+
|
|
141
|
+
/* Function to read from a pb_istream_t. You can use this if you need to
|
|
142
|
+
* read some custom header data, or to read data in field callbacks.
|
|
143
|
+
*/
|
|
144
|
+
bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count);
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
/************************************************
|
|
148
|
+
* Helper functions for writing field callbacks *
|
|
149
|
+
************************************************/
|
|
150
|
+
|
|
151
|
+
/* Decode the tag for the next field in the stream. Gives the wire type and
|
|
152
|
+
* field tag. At end of the message, returns false and sets eof to true. */
|
|
153
|
+
bool pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof);
|
|
154
|
+
|
|
155
|
+
/* Skip the field payload data, given the wire type. */
|
|
156
|
+
bool pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type);
|
|
157
|
+
|
|
158
|
+
/* Decode an integer in the varint format. This works for enum, int32,
|
|
159
|
+
* int64, uint32 and uint64 field types. */
|
|
160
|
+
#ifndef PB_WITHOUT_64BIT
|
|
161
|
+
bool pb_decode_varint(pb_istream_t *stream, uint64_t *dest);
|
|
162
|
+
#else
|
|
163
|
+
#define pb_decode_varint pb_decode_varint32
|
|
164
|
+
#endif
|
|
165
|
+
|
|
166
|
+
/* Decode an integer in the varint format. This works for enum, int32,
|
|
167
|
+
* and uint32 field types. */
|
|
168
|
+
bool pb_decode_varint32(pb_istream_t *stream, uint32_t *dest);
|
|
169
|
+
|
|
170
|
+
/* Decode a bool value in varint format. */
|
|
171
|
+
bool pb_decode_bool(pb_istream_t *stream, bool *dest);
|
|
172
|
+
|
|
173
|
+
/* Decode an integer in the zig-zagged svarint format. This works for sint32
|
|
174
|
+
* and sint64. */
|
|
175
|
+
#ifndef PB_WITHOUT_64BIT
|
|
176
|
+
bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest);
|
|
177
|
+
#else
|
|
178
|
+
bool pb_decode_svarint(pb_istream_t *stream, int32_t *dest);
|
|
179
|
+
#endif
|
|
180
|
+
|
|
181
|
+
/* Decode a fixed32, sfixed32 or float value. You need to pass a pointer to
|
|
182
|
+
* a 4-byte wide C variable. */
|
|
183
|
+
bool pb_decode_fixed32(pb_istream_t *stream, void *dest);
|
|
184
|
+
|
|
185
|
+
#ifndef PB_WITHOUT_64BIT
|
|
186
|
+
/* Decode a fixed64, sfixed64 or double value. You need to pass a pointer to
|
|
187
|
+
* a 8-byte wide C variable. */
|
|
188
|
+
bool pb_decode_fixed64(pb_istream_t *stream, void *dest);
|
|
189
|
+
#endif
|
|
190
|
+
|
|
191
|
+
#ifdef PB_CONVERT_DOUBLE_FLOAT
|
|
192
|
+
/* Decode a double value into float variable. */
|
|
193
|
+
bool pb_decode_double_as_float(pb_istream_t *stream, float *dest);
|
|
194
|
+
#endif
|
|
195
|
+
|
|
196
|
+
/* Make a limited-length substream for reading a PB_WT_STRING field. */
|
|
197
|
+
bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream);
|
|
198
|
+
bool pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream);
|
|
199
|
+
|
|
200
|
+
#ifdef __cplusplus
|
|
201
|
+
} /* extern "C" */
|
|
202
|
+
#endif
|
|
203
|
+
|
|
204
|
+
#endif
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/* pb_encode.h: Functions to encode protocol buffers. Depends on pb_encode.c.
|
|
2
|
+
* The main function is pb_encode. You also need an output stream, and the
|
|
3
|
+
* field descriptions created by nanopb_generator.py.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef PB_ENCODE_H_INCLUDED
|
|
7
|
+
#define PB_ENCODE_H_INCLUDED
|
|
8
|
+
|
|
9
|
+
#include "pb.h"
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
extern "C" {
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
/* Structure for defining custom output streams. You will need to provide
|
|
16
|
+
* a callback function to write the bytes to your storage, which can be
|
|
17
|
+
* for example a file or a network socket.
|
|
18
|
+
*
|
|
19
|
+
* The callback must conform to these rules:
|
|
20
|
+
*
|
|
21
|
+
* 1) Return false on IO errors. This will cause encoding to abort.
|
|
22
|
+
* 2) You can use state to store your own data (e.g. buffer pointer).
|
|
23
|
+
* 3) pb_write will update bytes_written after your callback runs.
|
|
24
|
+
* 4) Substreams will modify max_size and bytes_written. Don't use them
|
|
25
|
+
* to calculate any pointers.
|
|
26
|
+
*/
|
|
27
|
+
struct pb_ostream_s
|
|
28
|
+
{
|
|
29
|
+
#ifdef PB_BUFFER_ONLY
|
|
30
|
+
/* Callback pointer is not used in buffer-only configuration.
|
|
31
|
+
* Having an int pointer here allows binary compatibility but
|
|
32
|
+
* gives an error if someone tries to assign callback function.
|
|
33
|
+
* Also, NULL pointer marks a 'sizing stream' that does not
|
|
34
|
+
* write anything.
|
|
35
|
+
*/
|
|
36
|
+
const int *callback;
|
|
37
|
+
#else
|
|
38
|
+
bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
/* state is a free field for use of the callback function defined above.
|
|
42
|
+
* Note that when pb_ostream_from_buffer() is used, it reserves this field
|
|
43
|
+
* for its own use.
|
|
44
|
+
*/
|
|
45
|
+
void *state;
|
|
46
|
+
|
|
47
|
+
/* Limit number of output bytes written. Can be set to SIZE_MAX. */
|
|
48
|
+
size_t max_size;
|
|
49
|
+
|
|
50
|
+
/* Number of bytes written so far. */
|
|
51
|
+
size_t bytes_written;
|
|
52
|
+
|
|
53
|
+
#ifndef PB_NO_ERRMSG
|
|
54
|
+
/* Pointer to constant (ROM) string when decoding function returns error */
|
|
55
|
+
const char *errmsg;
|
|
56
|
+
#endif
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/***************************
|
|
60
|
+
* Main encoding functions *
|
|
61
|
+
***************************/
|
|
62
|
+
|
|
63
|
+
/* Encode a single protocol buffers message from C structure into a stream.
|
|
64
|
+
* Returns true on success, false on any failure.
|
|
65
|
+
* The actual struct pointed to by src_struct must match the description in fields.
|
|
66
|
+
* All required fields in the struct are assumed to have been filled in.
|
|
67
|
+
*
|
|
68
|
+
* Example usage:
|
|
69
|
+
* MyMessage msg = {};
|
|
70
|
+
* uint8_t buffer[64];
|
|
71
|
+
* pb_ostream_t stream;
|
|
72
|
+
*
|
|
73
|
+
* msg.field1 = 42;
|
|
74
|
+
* stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
|
|
75
|
+
* pb_encode(&stream, MyMessage_fields, &msg);
|
|
76
|
+
*/
|
|
77
|
+
bool pb_encode(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct);
|
|
78
|
+
|
|
79
|
+
/* Extended version of pb_encode, with several options to control the
|
|
80
|
+
* encoding process:
|
|
81
|
+
*
|
|
82
|
+
* PB_ENCODE_DELIMITED: Prepend the length of message as a varint.
|
|
83
|
+
* Corresponds to writeDelimitedTo() in Google's
|
|
84
|
+
* protobuf API.
|
|
85
|
+
*
|
|
86
|
+
* PB_ENCODE_NULLTERMINATED: Append a null byte to the message for termination.
|
|
87
|
+
* NOTE: This behaviour is not supported in most other
|
|
88
|
+
* protobuf implementations, so PB_ENCODE_DELIMITED
|
|
89
|
+
* is a better option for compatibility.
|
|
90
|
+
*/
|
|
91
|
+
#define PB_ENCODE_DELIMITED 0x02U
|
|
92
|
+
#define PB_ENCODE_NULLTERMINATED 0x04U
|
|
93
|
+
bool pb_encode_ex(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct, unsigned int flags);
|
|
94
|
+
|
|
95
|
+
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
|
96
|
+
#define pb_encode_delimited(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_DELIMITED)
|
|
97
|
+
#define pb_encode_nullterminated(s,f,d) pb_encode_ex(s,f,d, PB_ENCODE_NULLTERMINATED)
|
|
98
|
+
|
|
99
|
+
/* Encode the message to get the size of the encoded data, but do not store
|
|
100
|
+
* the data. */
|
|
101
|
+
bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct);
|
|
102
|
+
|
|
103
|
+
/**************************************
|
|
104
|
+
* Functions for manipulating streams *
|
|
105
|
+
**************************************/
|
|
106
|
+
|
|
107
|
+
/* Create an output stream for writing into a memory buffer.
|
|
108
|
+
* The number of bytes written can be found in stream.bytes_written after
|
|
109
|
+
* encoding the message.
|
|
110
|
+
*
|
|
111
|
+
* Alternatively, you can use a custom stream that writes directly to e.g.
|
|
112
|
+
* a file or a network socket.
|
|
113
|
+
*/
|
|
114
|
+
pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize);
|
|
115
|
+
|
|
116
|
+
/* Pseudo-stream for measuring the size of a message without actually storing
|
|
117
|
+
* the encoded data.
|
|
118
|
+
*
|
|
119
|
+
* Example usage:
|
|
120
|
+
* MyMessage msg = {};
|
|
121
|
+
* pb_ostream_t stream = PB_OSTREAM_SIZING;
|
|
122
|
+
* pb_encode(&stream, MyMessage_fields, &msg);
|
|
123
|
+
* printf("Message size is %d\n", stream.bytes_written);
|
|
124
|
+
*/
|
|
125
|
+
#ifndef PB_NO_ERRMSG
|
|
126
|
+
#define PB_OSTREAM_SIZING {0,0,0,0,0}
|
|
127
|
+
#else
|
|
128
|
+
#define PB_OSTREAM_SIZING {0,0,0,0}
|
|
129
|
+
#endif
|
|
130
|
+
|
|
131
|
+
/* Function to write into a pb_ostream_t stream. You can use this if you need
|
|
132
|
+
* to append or prepend some custom headers to the message.
|
|
133
|
+
*/
|
|
134
|
+
bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/************************************************
|
|
138
|
+
* Helper functions for writing field callbacks *
|
|
139
|
+
************************************************/
|
|
140
|
+
|
|
141
|
+
/* Encode field header based on type and field number defined in the field
|
|
142
|
+
* structure. Call this from the callback before writing out field contents. */
|
|
143
|
+
bool pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_iter_t *field);
|
|
144
|
+
|
|
145
|
+
/* Encode field header by manually specifying wire type. You need to use this
|
|
146
|
+
* if you want to write out packed arrays from a callback field. */
|
|
147
|
+
bool pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number);
|
|
148
|
+
|
|
149
|
+
/* Encode an integer in the varint format.
|
|
150
|
+
* This works for bool, enum, int32, int64, uint32 and uint64 field types. */
|
|
151
|
+
#ifndef PB_WITHOUT_64BIT
|
|
152
|
+
bool pb_encode_varint(pb_ostream_t *stream, uint64_t value);
|
|
153
|
+
#else
|
|
154
|
+
bool pb_encode_varint(pb_ostream_t *stream, uint32_t value);
|
|
155
|
+
#endif
|
|
156
|
+
|
|
157
|
+
/* Encode an integer in the zig-zagged svarint format.
|
|
158
|
+
* This works for sint32 and sint64. */
|
|
159
|
+
#ifndef PB_WITHOUT_64BIT
|
|
160
|
+
bool pb_encode_svarint(pb_ostream_t *stream, int64_t value);
|
|
161
|
+
#else
|
|
162
|
+
bool pb_encode_svarint(pb_ostream_t *stream, int32_t value);
|
|
163
|
+
#endif
|
|
164
|
+
|
|
165
|
+
/* Encode a string or bytes type field. For strings, pass strlen(s) as size. */
|
|
166
|
+
bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size);
|
|
167
|
+
|
|
168
|
+
/* Encode a fixed32, sfixed32 or float value.
|
|
169
|
+
* You need to pass a pointer to a 4-byte wide C variable. */
|
|
170
|
+
bool pb_encode_fixed32(pb_ostream_t *stream, const void *value);
|
|
171
|
+
|
|
172
|
+
#ifndef PB_WITHOUT_64BIT
|
|
173
|
+
/* Encode a fixed64, sfixed64 or double value.
|
|
174
|
+
* You need to pass a pointer to a 8-byte wide C variable. */
|
|
175
|
+
bool pb_encode_fixed64(pb_ostream_t *stream, const void *value);
|
|
176
|
+
#endif
|
|
177
|
+
|
|
178
|
+
#ifdef PB_CONVERT_DOUBLE_FLOAT
|
|
179
|
+
/* Encode a float value so that it appears like a double in the encoded
|
|
180
|
+
* message. */
|
|
181
|
+
bool pb_encode_float_as_double(pb_ostream_t *stream, float value);
|
|
182
|
+
#endif
|
|
183
|
+
|
|
184
|
+
/* Encode a submessage field.
|
|
185
|
+
* You need to pass the pb_field_t array and pointer to struct, just like
|
|
186
|
+
* with pb_encode(). This internally encodes the submessage twice, first to
|
|
187
|
+
* calculate message size and then to actually write it out.
|
|
188
|
+
*/
|
|
189
|
+
bool pb_encode_submessage(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct);
|
|
190
|
+
|
|
191
|
+
#ifdef __cplusplus
|
|
192
|
+
} /* extern "C" */
|
|
193
|
+
#endif
|
|
194
|
+
|
|
195
|
+
#endif
|