#ifndef PLAINCONNECTION_H #define PLAINCONNECTION_H #ifdef _WIN32 #include #include #include "win32shim.h" #else #include // for size_t #endif #include // for uint8_t #include // for function #include // for string #include // for vector typedef std::function timeoutCallback; namespace cspot { class PlainConnection { public: PlainConnection(); ~PlainConnection(); /** * @brief Connect to the given AP address * * @param apAddress The AP url to connect to */ void connect(const std::string& apAddress); void close(); timeoutCallback timeoutHandler; std::vector sendPrefixPacket(const std::vector& prefix, const std::vector& data); std::vector recvPacket(); void readBlock(const uint8_t* dst, size_t size); size_t writeBlock(const std::vector& data); private: int apSock; }; } // namespace cspot #endif