public ComportHub(SerialPort machine, SerialComm machineAnalyzer, SerialComm apiAnalyzer, SerialComm api)
        {
            Machine = machine;
            ApiAnalyzer = apiAnalyzer;
            Api = api;
            MachineAnalyzer = machineAnalyzer;

            Api.RegisterDataSentInterceptHandler(ApiSentDataInterceptHandler);
            Machine.DataReceived += new SerialDataReceivedEventHandler(MachineDataReceived);

            Machine.Open();
        }
        public void Close()
        {
            if (ApiExt != null)
            {
                ApiExt.Close();
                ApiExt.Dispose();
            }

            Api.RegisterDataSentInterceptHandler(null);
            Machine.Close();
            Machine.Dispose();
        }