mirror of
https://github.com/BotChain-Robots/control.git
synced 2026-03-10 00:32:26 +01:00
Formatting, add remote calling to c library
This commit is contained in:
28
examples/rpc_call/include/flatbuffers/OTAPacketBuilder.h
Normal file
28
examples/rpc_call/include/flatbuffers/OTAPacketBuilder.h
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
#ifndef OTAPACKETBUILDER_H
|
||||
#define OTAPACKETBUILDER_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "flatbuffers/SerializedMessage.h"
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
#include "flatbuffers_generated/OTAPacket_generated.h"
|
||||
|
||||
namespace Flatbuffers {
|
||||
|
||||
class OTAPacketBuilder {
|
||||
public:
|
||||
OTAPacketBuilder() : builder_(1024) {
|
||||
}
|
||||
|
||||
SerializedMessage build_ota_packet(uint16_t packet_num, const std::vector<uint8_t> &packet);
|
||||
|
||||
static const Messaging::OTAPacket *parse_ota_packet(const uint8_t *buffer);
|
||||
|
||||
private:
|
||||
flatbuffers::FlatBufferBuilder builder_;
|
||||
};
|
||||
} // namespace Flatbuffers
|
||||
|
||||
#endif // OTAPACKETBUILDER_H
|
||||
15
examples/rpc_call/include/flatbuffers/SerializedMessage.h
Normal file
15
examples/rpc_call/include/flatbuffers/SerializedMessage.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-07-05.
|
||||
//
|
||||
|
||||
#ifndef SERIALIZEDMESSAGE_H
|
||||
#define SERIALIZEDMESSAGE_H
|
||||
|
||||
namespace Flatbuffers {
|
||||
struct SerializedMessage {
|
||||
void *data;
|
||||
size_t size;
|
||||
};
|
||||
} // namespace Flatbuffers
|
||||
|
||||
#endif // SERIALIZEDMESSAGE_H
|
||||
Reference in New Issue
Block a user