#pragma once

#include <softbus_api/ExecuteCommand.h>
#include <softbus_core/models/RawPacket.h>
#include <softbus_core/models/SoftbusTypes.h>
#include <softbus_transport/TcpUplinkClient.h>

#include <functional>
#include <memory>
#include <string>

namespace softbus::edge {

class UplinkClient {
public:
    UplinkClient(std::string host, uint16_t port);
    ~UplinkClient();

    bool connect();
    void disconnect();
    bool sendRawPacket(const softbus::core::RawPacket& packet);
    bool sendAck(const softbus::core::SoftbusAck& ack);
    bool sendHeartbeat(const std::string& deviceId);
    void setCommandHandler(std::function<void(const softbus::api::ExecuteCommand&)> handler);
    void poll();

private:
    std::unique_ptr<softbus::transport::TcpUplinkClient> client_;
};

} // namespace softbus::edge
