28#include <wx/msw/winundef.h>
50#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
65 void Notify(std::shared_ptr<const NavMsg> message)
override {
66 switch (message->state) {
67 case NavMsg::State::kCannotParse:
68 case NavMsg::State::kFiltered:
69 case NavMsg::State::kBadChecksum:
73 NavMsgBus::GetInstance().
Notify(message);
80 auto driver = std::make_unique<LoopbackDriver>(NavMsgBus::GetInstance());
81 CommDriverRegistry::GetInstance().
Activate(std::move(driver));
85 auto driver = std::make_unique<CommDriverInternal>(NavMsgBus::GetInstance());
86 CommDriverRegistry::GetInstance().
Activate(std::move(driver));
92 wxLogMessage(
"MakeCommDriver: %s", params->
GetDSPort().c_str());
94 auto& msgbus = NavMsgBus::GetInstance();
95 auto& registry = CommDriverRegistry::GetInstance();
96 switch (params->type) {
99 auto driver = std::make_unique<CommDriverN2KCanable>(params, msgbus);
100 registry.Activate(std::move(driver));
102 wxLogMessage(
"CANable connections require Windows.");
107 switch (params->data_protocol) {
108 case PROTO_NMEA2000: {
109 auto driver = std::make_unique<CommDriverN2KSerial>(params, msgbus);
110 registry.Activate(std::move(driver));
115 std::make_unique<CommDriverN0183Serial>(params, listener);
116 registry.Activate(std::move(driver));
122 switch (params->net_protocol) {
124 auto driver = std::make_unique<CommDriverSignalKNet>(params, msgbus);
125 registry.Activate(std::move(driver));
129 switch (params->data_protocol) {
130 case PROTO_NMEA0183: {
132 std::make_unique<CommDriverN0183Net>(params, listener);
133 registry.Activate(std::move(driver));
136 case PROTO_NMEA2000: {
137 auto driver = std::make_unique<CommDriverN2KNet>(params, msgbus);
138 registry.Activate(std::move(driver));
149#if defined(__linux__) && !defined(__ANDROID__) && !defined(__WXOSX__)
151 auto driver = CommDriverN2KSocketCAN::Create(params, msgbus);
152 registry.Activate(std::move(driver));
159 auto driver = std::make_unique<CommDriverN0183AndroidInt>(params, msgbus);
160 registry.Activate(std::move(driver));
165 auto driver = std::make_unique<CommDriverN0183AndroidBT>(params, msgbus);
166 registry.Activate(std::move(driver));
Common interface for all drivers.
obs::EventVar evt_dropped_msg
Updated by drivers with a shared Navmsg pointer when receiving data otherwise dropped,...
void Activate(DriverPtr driver)
Add driver to list of active drivers.
static void uninitIXNetSystem()
ix::uninitIXNetSystem wrapper
static void initIXNetSystem()
ix::initIXNetSystem wrapper
Connection data container close to a POD struct.
wxString GetDSPort() const
Return port description including for example serial port or network address/port,...
Interface for handling incoming messages.
void Notify(std::shared_ptr< const NavMsg > message) override
Handle a received message.
void Notify(const AbstractCommDriver &driver) override
Handle driver status change.
void Notify(std::shared_ptr< const NavMsg > message)
Accept message received by driver, make it available for upper layers.
void Notify() override
Notify all listeners, no data supplied.
void MakeLoopbackDriver()
Create and register the loopback driver.
void MakeInternalDriver()
Create and register the internal driver.
void MakeCommDriver(const ConnectionParams *params)
Create and register a driver for given connection.
Internal send-only driver sending to plugins.
Loopback driver, treat sent messages as received.
Android nmea0183 internal bluetooth driver.
Android internal nmea0183 driver.
comm_drv_n2k_canable.h NMEA2000 driver for CANable "Contact" (and other SLCAN/LAWICEL-firmware) USB-C...
Nmea2000 IP network driver.
Low-level driver for socketcan devices (linux only).
Driver registration container, a singleton.
SignalK IP network driver.
Raw messages layer, supports sending and recieving navmsg messages.