#include "subscribe.h"
#include <memory>
#include "request.h"
#include "response_message_receiver.h"
#include "wrapper.rs.h"
namespace OHOS {
namespace RequestAni {
void UdsListener::OnChannelBroken()
{
}
void UdsListener::OnResponseReceive(const std::shared_ptr<Request::Response> &response)
{
auto res = Response{
.taskId = response->taskId,
.version = response->version,
.statusCode = response->statusCode,
.reason = response->reason,
};
on_response(res);
}
void UdsListener::OnNotifyDataReceive(const std::shared_ptr<Request::NotifyData> ¬ifyData)
{
auto res = Response{
.taskId = std::to_string(notifyData->taskId),
.version = "st",
.statusCode = 123,
.reason = "aaa",
};
on_response(res);
}
void OpenChannel(int32_t fd)
{
static UdsListener listener;
auto uds = std::make_shared<Request::ResponseMessageReceiver>(&listener, fd);
uds->BeginReceive();
};
}
}