30#ifndef DW_FRAMEWORK_FSI_COM_HPP_
31#define DW_FRAMEWORK_FSI_COM_HPP_
33#include <dw/core/base/BasicTypes.h>
34#include <dwshared/dwfoundation/dw/core/language/Function.hpp>
38#include <unordered_map>
53 static constexpr char LOG_TAG[]{
"IChannelFsiCom"};
83 virtual int32_t
write(
void* buff, uint32_t size, uint32_t& writtenBytes) = 0;
103 virtual int32_t
read(
void* buff, uint32_t size, uint32_t& readBytes) = 0;
105 using createFactory = std::function<std::shared_ptr<IChannelFsiCom>(uint8_t,
const char*)>;
115 static std::shared_ptr<IChannelFsiCom>
create(uint8_t numChannels,
const char* compat,
createFactory& overrider);
134 bool m_consumerRegistered{
false};
135 bool m_producerRegistered{
false};
virtual int32_t waitForEvent(dwTime_t timeout_us)=0
Wait for a buffer to be available to read.
virtual bool connect()=0
Connect to a specified FSI endpoint.
void unregisterClient(bool consumer)
Unregister a FSI connection.
static constexpr char LOG_TAG[]
virtual int32_t write(void *buff, uint32_t size, uint32_t &writtenBytes)=0
Write to a connected FSI endpoint.
virtual void disconnect()=0
Disconnect from a connected FSI endpoint.
virtual bool isConnected()=0
Check if FSI endpoint is connected.
virtual int32_t read(void *buff, uint32_t size, uint32_t &readBytes)=0
Read from a connected FSI endpoint.
bool registerClient(bool consumer)
Register a FSI connection.
std::function< std::shared_ptr< IChannelFsiCom >(uint8_t, const char *)> createFactory
static std::shared_ptr< IChannelFsiCom > create(uint8_t numChannels, const char *compat, createFactory &overrider)
Create the FSI channel.
virtual ~IChannelFsiCom()=default