/**
 * @file message_dispatcher.h
 * @brief 下行消息路由分发
 */

#ifndef CORE_MESSAGE_DISPATCHER_H
#define CORE_MESSAGE_DISPATCHER_H

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct engine_internal_ctx engine_internal_ctx_t;

/** @brief 初始化消息分发器 */
int msg_dispatcher_init(engine_internal_ctx_t *ctx);

/** @brief 处理收到的文本帧 */
int msg_dispatcher_handle_text(engine_internal_ctx_t *ctx, const char *buf, size_t len);

/** @brief 处理收到的二进制帧（音频数据）*/
int msg_dispatcher_handle_binary(engine_internal_ctx_t *ctx, const void *buf, size_t len);

/** @brief 反初始化 */
void msg_dispatcher_deinit(engine_internal_ctx_t *ctx);

#ifdef __cplusplus
}
#endif

#endif /* CORE_MESSAGE_DISPATCHER_H */
