LivoxProto1: Rename pcloudDataSocketDesc=>pcloudDataFdDesc
This commit is contained in:
@@ -78,10 +78,10 @@ void UdpCommandDemuxer::stop()
|
|||||||
cmdEndpointFdDesc.reset();
|
cmdEndpointFdDesc.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pcloudDataSocketDesc)
|
if (pcloudDataFdDesc)
|
||||||
{
|
{
|
||||||
pcloudDataSocketDesc->cancel();
|
pcloudDataFdDesc->cancel();
|
||||||
pcloudDataSocketDesc.reset();
|
pcloudDataFdDesc.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive.store(false);
|
isActive.store(false);
|
||||||
@@ -201,7 +201,7 @@ void UdpCommandDemuxer::setupPcloudDataSocket()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create boost wrapper for async operations
|
// Create boost wrapper for async operations
|
||||||
pcloudDataSocketDesc = std::make_shared<boost::asio::posix::stream_descriptor>(
|
pcloudDataFdDesc = std::make_shared<boost::asio::posix::stream_descriptor>(
|
||||||
componentThread->getIoService(), socketGuard.getFd());
|
componentThread->getIoService(), socketGuard.getFd());
|
||||||
|
|
||||||
// Transfer ownership, prevent auto-close
|
// Transfer ownership, prevent auto-close
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ public:
|
|||||||
std::shared_ptr<boost::asio::posix::stream_descriptor>
|
std::shared_ptr<boost::asio::posix::stream_descriptor>
|
||||||
getPcloudDataFdDesc() const
|
getPcloudDataFdDesc() const
|
||||||
{
|
{
|
||||||
return pcloudDataSocketDesc;
|
return pcloudDataFdDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Socket and async objects
|
// Socket and async objects
|
||||||
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataSocketDesc;
|
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataFdDesc;
|
||||||
// Socket and async objects
|
// Socket and async objects
|
||||||
std::shared_ptr<boost::asio::posix::stream_descriptor> cmdEndpointFdDesc;
|
std::shared_ptr<boost::asio::posix::stream_descriptor> cmdEndpointFdDesc;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
|
inline LivoxProto1DllState& getLivoxProto1State() { return livoxProto1; }
|
||||||
|
|
||||||
struct DummyLivoxEthHeader
|
struct DummyLivoxEthHeader
|
||||||
{
|
{
|
||||||
enum : uint32_t {
|
enum : uint32_t {
|
||||||
@@ -47,8 +49,15 @@ bool IoUringAssemblyEngine::setup()
|
|||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
// Get point cloud data socket descriptor from UdpCommandDemuxer
|
// Get point cloud data socket descriptor from UdpCommandDemuxer
|
||||||
int udpFd = (*livoxProto1.livoxProto1_getPcloudDataFdDesc)()
|
auto& livoxState = getLivoxProto1State();
|
||||||
->native_handle();
|
if (!livoxState.livoxProto1_getPcloudDataFdDesc)
|
||||||
|
{ return false; }
|
||||||
|
pcloudDataFdDesc = (*livoxState.livoxProto1_getPcloudDataFdDesc)();
|
||||||
|
if (!pcloudDataFdDesc)
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
|
// Get UDP socket file descriptor
|
||||||
|
int udpFd = pcloudDataFdDesc->native_handle();
|
||||||
if (udpFd < 0)
|
if (udpFd < 0)
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
@@ -87,7 +96,7 @@ void IoUringAssemblyEngine::resetAndAssembleFrame()
|
|||||||
// 1. Submit frameAssemblyDesc->numSlots RECVMSG SQEs using io_uring_prep_recvmsg()
|
// 1. Submit frameAssemblyDesc->numSlots RECVMSG SQEs using io_uring_prep_recvmsg()
|
||||||
// - Each SQE receives into frameAssemblyDesc->slots[i].vaddr
|
// - Each SQE receives into frameAssemblyDesc->slots[i].vaddr
|
||||||
// - With size frameAssemblyDesc->slots[i].nBytes
|
// - With size frameAssemblyDesc->slots[i].nBytes
|
||||||
// - Socket FD from pcloudDataSocketDesc->native_handle()
|
// - Socket FD from pcloudDataFdDesc->native_handle()
|
||||||
// 2. Submit batch via io_uring_submit(&ring)
|
// 2. Submit batch via io_uring_submit(&ring)
|
||||||
// 3. Set up stall timer using stallTimer with appropriate timeout
|
// 3. Set up stall timer using stallTimer with appropriate timeout
|
||||||
// - SQEs are independent and can arrive out of order
|
// - SQEs are independent and can arrive out of order
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ private:
|
|||||||
bool isSetup;
|
bool isSetup;
|
||||||
|
|
||||||
// Point cloud data socket descriptor
|
// Point cloud data socket descriptor
|
||||||
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataSocketDesc;
|
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataFdDesc;
|
||||||
|
|
||||||
// Stall detection timer
|
// Stall detection timer
|
||||||
boost::asio::deadline_timer stallTimer;
|
boost::asio::deadline_timer stallTimer;
|
||||||
|
|||||||
Reference in New Issue
Block a user