mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
[Thread] Implement write on socket interface
Bug: 313425570 Test: build pass & manual test Change-Id: I2da14a563b795b0044362c1c248b53c1d3505d39
This commit is contained in:
@@ -83,6 +83,12 @@ void SocketInterface::Deinit(void) {
|
||||
mReceiveFrameBuffer = nullptr;
|
||||
}
|
||||
|
||||
otError SocketInterface::SendFrame(const uint8_t* aFrame, uint16_t aLength) {
|
||||
Write(aFrame, aLength);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void SocketInterface::UpdateFdSet(void* aMainloopContext) {
|
||||
otSysMainloopContext* context = reinterpret_cast<otSysMainloopContext*>(aMainloopContext);
|
||||
|
||||
@@ -95,6 +101,12 @@ void SocketInterface::UpdateFdSet(void* aMainloopContext) {
|
||||
}
|
||||
}
|
||||
|
||||
void SocketInterface::Write(const uint8_t* aFrame, uint16_t aLength) {
|
||||
ssize_t rval = TEMP_FAILURE_RETRY(write(mSockFd, aFrame, aLength));
|
||||
VerifyOrDie(rval >= 0, OT_EXIT_ERROR_ERRNO);
|
||||
VerifyOrDie(rval > 0, OT_EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int SocketInterface::OpenFile(const ot::Url::Url& aRadioUrl) {
|
||||
int fd = -1;
|
||||
sockaddr_un serverAddress;
|
||||
|
||||
Reference in New Issue
Block a user