/** * * gsd_ExpelPlugin.h * */ #pragma once #include #include "Util/util.h" #include "Network/Socket.h" #include "config.hpp" #include "dataTypeList.h" #include "InfineFilter.h" using namespace toolkit; namespace gsd { class ExpelPlugin : public drogon::Plugin { public: ExpelPlugin() {} /// This method must be called by drogon to initialize and start the plugin. /// It must be implemented by the user. virtual void initAndStart(const Json::Value &config) override; /// This method must be called by drogon to shutdown the plugin. /// It must be implemented by the user. virtual void shutdown() override; /** * @description: 初始化 * @return {*} */ int8_t Init(); /** * @description: 启动任务 * @return {*} */ void StartTask(); /** * @description: 赋值struct sockaddr * @param undefined * @param undefined * @param undefined * @return {*} */ void makeAddr(struct sockaddr *out,const char *ip,uint16_t port); /** * @description: Udp数据接收 * @param {Ptr} &buf * @return {*} */ void UdpRecData(const Buffer::Ptr &buf); private: Socket::Ptr sockerUdp = nullptr; mutex m_mutex; // 驱鸟设备状态 bool m_DevPowerState = false; }; }