mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-10-23 21:43:28 +00:00
Retire the legacy NodeInfo, INodeStore, and IContactStore directory model. Route contact projections, protocol observations, persistence, and platform composition through IMeshPeerDirectory across ESP, Linux, and nRF52.
28 lines
1.3 KiB
C++
28 lines
1.3 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,
|
|
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,
|
|
contact_service));
|
|
case chat::MeshProtocol::Meshtastic:
|
|
default:
|
|
return std::unique_ptr<chat::IMeshAdapter>(
|
|
new platform::nrf52::arduino_common::chat::meshtastic::MeshtasticRadioAdapter(identity_provider,
|
|
contact_service));
|
|
}
|
|
}
|
|
|
|
} // namespace platform::nrf52::protocol
|