fc5ebb72b9
No longer uses CPS. We also found and documented a potential bug in the way we deal with disablePcloudData during detachDeviceReq.
58 lines
1.9 KiB
C++
58 lines
1.9 KiB
C++
#ifndef LIVOX_GEN1_INTERNAL_H
|
|
#define LIVOX_GEN1_INTERNAL_H
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <spinscale/co/invokers.h>
|
|
#include <user/deviceAttachmentSpec.h>
|
|
#include <user/senseApiDesc.h>
|
|
#include <user/stimulusProducer.h>
|
|
|
|
#include "livoxGen1.h"
|
|
#include "pcloudStimulusProducer.h"
|
|
|
|
namespace smo::stim_buff {
|
|
|
|
struct LivoxProviderParams
|
|
{
|
|
int commandTimeoutMs = 5; // Default: 5ms
|
|
int retryDelayMs = 5250; // Default: 5250ms
|
|
uint8_t smoSubnetNbits = 24; // Default: /24 subnet
|
|
uint16_t dataPort = 56000; // Default data port
|
|
uint16_t cmdPort = 56001; // Default command port
|
|
uint16_t imuPort = 56002; // Default IMU port
|
|
std::string smoIp; // Default: empty string (will trigger IP auto-detection)
|
|
};
|
|
|
|
extern const SmoCallbacks *smoHooksPtr;
|
|
extern SmoThreadingModelDesc smoThreadingModelDesc;
|
|
extern std::vector<std::shared_ptr<StimulusProducer>> attachedStimulusProducers;
|
|
|
|
std::shared_ptr<StimulusProducer> getStimulusProducer(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &spec);
|
|
|
|
size_t parseNDgramsPerFrame(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &spec);
|
|
|
|
LivoxProviderParams parseLivoxProviderParams(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &desc);
|
|
|
|
bool ensureStimBufferAttachedWithoutDuplicates(
|
|
const std::shared_ptr<PcloudStimulusProducer> &stimProducer,
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &spec);
|
|
|
|
sscl::co::ViralNonPostingInvoker<int> livoxGen1_initializeCInd();
|
|
sscl::co::ViralNonPostingInvoker<int> livoxGen1_finalizeCInd();
|
|
sscl::co::ViralNonPostingInvoker<StimBuffDeviceOpResult> livoxGen1_attachDeviceCReq(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &desc,
|
|
const std::shared_ptr<sscl::ComponentThread> &componentThread);
|
|
sscl::co::ViralNonPostingInvoker<StimBuffDeviceOpResult> livoxGen1_detachDeviceCReq(
|
|
const std::shared_ptr<device::DeviceAttachmentSpec> &desc);
|
|
|
|
} // namespace smo::stim_buff
|
|
|
|
#endif // LIVOX_GEN1_INTERNAL_H
|