29#include <wx/msw/winundef.h>
39#include "comm_drv_n2k_serial.h"
40#include "comm_drv_n0183_serial.h"
41#include "comm_drv_n0183_net.h"
42#include "comm_drv_signalk_net.h"
43#include "comm_navmsg_bus.h"
44#include "comm_drv_registry.h"
46#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
47#include "comm_drv_n2k_socketcan.h"
50std::shared_ptr<AbstractCommDriver> MakeCommDriver(
53 wxString::Format(_T(
"MakeCommDriver: %s"), params->GetDSPort().c_str()));
55 auto& msgbus = NavMsgBus::GetInstance();
56 auto& registry = CommDriverRegistry::GetInstance();
57 switch (params->Type) {
59 switch (params->Protocol) {
60 case PROTO_NMEA2000: {
61 auto driver = std::make_shared<CommDriverN2KSerial>(params, msgbus);
62 registry.Activate(driver);
67 auto driver = std::make_shared<CommDriverN0183Serial>(params, msgbus);
68 registry.Activate(driver);
75 switch (params->NetProtocol) {
77 auto driver = std::make_shared<CommDriverSignalKNet>(params, msgbus);
78 registry.Activate(driver);
83 auto driver = std::make_shared<CommDriverN0183Net>(params, msgbus);
84 registry.Activate(driver);
90#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
93 auto driver = CommDriverN2KSocketCAN::Create(params, msgbus);
94 registry.Activate(driver);
102 return new InternalGPSDataStream(input_consumer, params);
104 return new InternalBTDataStream(input_consumer, params);