mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
MultiChannelCommunication: Resolve MSVC constexpr warning
This commit is contained in:
@@ -18,7 +18,8 @@ public:
|
||||
std::unique_ptr<Driver> com,
|
||||
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer,
|
||||
std::unique_ptr<Encoder> e,
|
||||
std::unique_ptr<Decoder> md) : Communication(err, std::move(com), makeConfiguredPacketizer, std::move(e), std::move(md)) {}
|
||||
std::unique_ptr<Decoder> md,
|
||||
size_t vnetCount);
|
||||
void spawnThreads() override;
|
||||
void joinThreads() override;
|
||||
bool sendPacket(std::vector<uint8_t>& bytes) override;
|
||||
@@ -27,8 +28,6 @@ protected:
|
||||
bool preprocessPacket(std::deque<uint8_t>& usbReadFifo);
|
||||
|
||||
private:
|
||||
static constexpr const size_t NUM_SUPPORTED_VNETS = 1;
|
||||
|
||||
enum class CommandType : uint8_t {
|
||||
PlasmaReadRequest = 0x10, // Status read request to HSC
|
||||
PlasmaStatusResponse = 0x11, // Status response by HSC
|
||||
@@ -106,9 +105,10 @@ private:
|
||||
CommandType currentCommandType;
|
||||
size_t currentReadIndex = 0;
|
||||
|
||||
const size_t numVnets;
|
||||
std::thread hidReadThread;
|
||||
std::array<std::thread, NUM_SUPPORTED_VNETS> vnetThreads;
|
||||
std::array<moodycamel::BlockingReaderWriterQueue< std::vector<uint8_t> >, NUM_SUPPORTED_VNETS> vnetQueues;
|
||||
std::vector<std::thread> vnetThreads;
|
||||
std::vector< moodycamel::BlockingReaderWriterQueue< std::vector<uint8_t> > > vnetQueues;
|
||||
void hidReadTask();
|
||||
void vnetReadTask(size_t vnetIndex);
|
||||
};
|
||||
|
||||
@@ -28,6 +28,22 @@ private:
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
productId = PRODUCT_ID;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<Communication> makeCommunication(
|
||||
std::unique_ptr<Driver> transport,
|
||||
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer,
|
||||
std::unique_ptr<Encoder> encoder,
|
||||
std::unique_ptr<Decoder> decoder
|
||||
) override {
|
||||
return std::make_shared<MultiChannelCommunication>(
|
||||
report,
|
||||
std::move(transport),
|
||||
makeConfiguredPacketizer,
|
||||
std::move(encoder),
|
||||
std::move(decoder),
|
||||
1 // 2
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,22 @@ private:
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
productId = PRODUCT_ID;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<Communication> makeCommunication(
|
||||
std::unique_ptr<Driver> transport,
|
||||
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer,
|
||||
std::unique_ptr<Encoder> encoder,
|
||||
std::unique_ptr<Decoder> decoder
|
||||
) override {
|
||||
return std::make_shared<MultiChannelCommunication>(
|
||||
report,
|
||||
std::move(transport),
|
||||
makeConfiguredPacketizer,
|
||||
std::move(encoder),
|
||||
std::move(decoder),
|
||||
1 // 3
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -45,21 +45,6 @@ public:
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
protected:
|
||||
virtual std::shared_ptr<Communication> makeCommunication(
|
||||
std::unique_ptr<Driver> transport,
|
||||
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer,
|
||||
std::unique_ptr<Encoder> encoder,
|
||||
std::unique_ptr<Decoder> decoder
|
||||
) override {
|
||||
return std::make_shared<MultiChannelCommunication>(
|
||||
report,
|
||||
std::move(transport),
|
||||
makeConfiguredPacketizer,
|
||||
std::move(encoder),
|
||||
std::move(decoder)
|
||||
);
|
||||
}
|
||||
|
||||
// TODO This is done so that Plasion can still transmit it's basic networks, awaiting slave VNET support
|
||||
virtual bool isSupportedRXNetwork(const Network&) const override { return true; }
|
||||
virtual bool isSupportedTXNetwork(const Network&) const override { return true; }
|
||||
|
||||
Reference in New Issue
Block a user