mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-08-15 15:19:45 +00:00
* refactor: render chat rows from presentation state * Fix Meshtastic channel sync and add MeshCore CN preset * Add granular chat notification settings * Add SD settings backup and restore * Prepare 0.1.26-alpha release --------- Co-authored-by: vicliu624 <vicliu@outlook.com>
29 lines
1.4 KiB
C++
29 lines
1.4 KiB
C++
#include "platform/nrf52/protocol/nrf52_protocol_factory.h"
|
|
|
|
#include "platform/nrf52/arduino_common/chat/infra/meshcore/meshcore_radio_adapter.h"
|
|
#include "platform/nrf52/arduino_common/chat/infra/meshtastic/meshtastic_radio_adapter.h"
|
|
|
|
namespace platform::nrf52::protocol
|
|
{
|
|
|
|
std::unique_ptr<chat::IMeshAdapter> createProtocolAdapter(chat::MeshProtocol protocol,
|
|
const chat::runtime::SelfIdentityProvider* identity_provider,
|
|
platform::nrf52::arduino_common::chat::meshtastic::NodeStore* meshtastic_node_store,
|
|
chat::contacts::ContactService* contact_service)
|
|
{
|
|
switch (protocol)
|
|
{
|
|
case chat::MeshProtocol::MeshCore:
|
|
return std::unique_ptr<chat::IMeshAdapter>(
|
|
new platform::nrf52::arduino_common::chat::meshcore::MeshCoreRadioAdapter(identity_provider));
|
|
case chat::MeshProtocol::Meshtastic:
|
|
default:
|
|
return std::unique_ptr<chat::IMeshAdapter>(
|
|
new platform::nrf52::arduino_common::chat::meshtastic::MeshtasticRadioAdapter(identity_provider,
|
|
meshtastic_node_store,
|
|
contact_service));
|
|
}
|
|
}
|
|
|
|
} // namespace platform::nrf52::protocol
|