--- nono/host/hostcom.h 2026/04/29 17:05:34 1.1.1.4 +++ nono/host/hostcom.h 2026/04/29 17:06:02 1.1.1.8 @@ -14,6 +14,8 @@ #include "comdriver.h" #include "spscqueue.h" +class ConfigItem; + class HostCOMDevice : public HostDevice { using inherited = HostDevice; @@ -33,23 +35,30 @@ class HostCOMDevice : public HostDevice }; public: - HostCOMDevice(Device *parent_, const std::string& objname_); + HostCOMDevice(Device *parent_, int n, const std::string& portname_); ~HostCOMDevice() override; void SetLogLevel(int loglevel_) override; - bool Init() override; + bool Create2() override; void Dispatch(int udata) override; bool Tx(uint32 data); uint32 Rx(); + // ドライバ名を返す。 + const std::string& GetDriverName(); + private: - bool SelectDriver(); + bool SelectDriver(bool startup) override; + void CreateNone(); + void CreateStdio(const ConfigItem&, const std::string& key); + void CreateTCP(); + void CreateConsole(const ConfigItem&); int Read() override; - void Write(uint32 data) override; + void Write() override; - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); // キュー COMQueue txq {};