update proto, add config update publish broadcast, add messages compacting
This commit is contained in:
@@ -38,6 +38,9 @@ typedef struct {
|
||||
size_t interceptCtxCount;
|
||||
flatcc_builder_t stream_builder;
|
||||
uint64_t simRateLimit;
|
||||
// Cached DeviceIdMappingNotif broadcast message (sent to newly authed clients)
|
||||
uint8_t* deviceIdMappingMsg;
|
||||
size_t deviceIdMappingMsgLen;
|
||||
} EmulContext;
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ typedef struct {
|
||||
ws_cli_conn_t clientIdx;
|
||||
uint8_t* msg;
|
||||
size_t msgLen;
|
||||
uint64_t dispatch_us; // microsecond timestamp when queued (for batching window)
|
||||
} OutgoingMessage;
|
||||
|
||||
// Build a ServerMessage{AuthResponse} frame. Returns a malloc'd buffer;
|
||||
@@ -59,12 +60,21 @@ uint8_t* fb_build_stream_reg_confirm(
|
||||
|
||||
// Build a ServerMessage{CtrlServerMessage{ConfigNotifMessage{DeviceIdMappingNotif}}} frame.
|
||||
// paths: array of NULL-terminated string arrays; path_lens: component count per path.
|
||||
// seg_names[i]: array of seg_counts[i] segment name strings for device i.
|
||||
uint8_t* fb_build_config_device_id_mapping(
|
||||
uint64_t nonce,
|
||||
char** paths[], size_t path_lens[],
|
||||
char* seg_names[][64], size_t seg_counts[],
|
||||
size_t device_count, size_t* len_out);
|
||||
|
||||
// Build a ServerMessage{CtrlServerMessage{ConfigNotifMessage{ConfigLoadError}}} frame.
|
||||
uint8_t* fb_build_config_error(uint64_t nonce, const char* message, size_t* len_out);
|
||||
|
||||
// Build a ServerMessage{CompactedMessage{frames=[...]}} frame.
|
||||
// msgs / msg_lens: array of `count` pre-built ServerMessage byte buffers to pack.
|
||||
// The caller retains ownership of the source buffers; this function copies their bytes.
|
||||
// Nonce is set to UINT64_MAX (no-nonce / fire-and-forget).
|
||||
uint8_t* fb_build_compacted_message(
|
||||
uint8_t* const* msgs, const size_t* msg_lens, size_t count, size_t* len_out);
|
||||
|
||||
#endif // __PROTO_MSG_H__
|
||||
|
||||
Reference in New Issue
Block a user