[Thread] Add socket interface support in thread chip

Bug: 313425570
Test: build pass & manual test
Change-Id: Ie1b0c687cf529659521f1dd1457fcda35af1bf49
This commit is contained in:
shihchienc 2024-01-24 09:05:34 +00:00
parent 1623351bc0
commit 27711c3195

View file

@ -24,6 +24,7 @@
#include <utils/Log.h>
#include "hdlc_interface.hpp"
#include "socket_interface.hpp"
#include "spi_interface.hpp"
namespace aidl {
@ -43,6 +44,8 @@ ThreadChip::ThreadChip(char* url) : mUrl(), mRxFrameBuffer(), mCallback(nullptr)
mSpinelInterface = std::make_shared<ot::Posix::SpiInterface>(mUrl);
} else if (ot::Posix::HdlcInterface::IsInterfaceNameMatch(interfaceName)) {
mSpinelInterface = std::make_shared<ot::Posix::HdlcInterface>(mUrl);
} else if (SocketInterface::IsInterfaceNameMatch(interfaceName)) {
mSpinelInterface = std::make_shared<SocketInterface>(mUrl);
} else {
ALOGE("The interface \"%s\" is not supported", interfaceName);
exit(EXIT_FAILURE);