Go to the documentation of this file.
80 #define XS_DEFAULT_READ_BUFFER_SIZE (XS_MAXMSGLEN*8)
81 #define XS_DEFAULT_WRITE_BUFFER_SIZE XS_MAXMSGLEN
105 virtual bool isOpen(
void)
const = 0;
virtual XsResultValue getName(XsString &filename) const
Retrieve the filename that was last successfully opened.
virtual XsResultValue closeAndDelete(void)
Close the file and delete it.
virtual XsResultValue getLastResult(void) const =0
Returns the last result value produced by this interface.
IoInterface()
Constructor.
virtual XsResultValue flushData(void)=0
Flush all data in the buffers to and from the device.
virtual XsResultValue setReadPosition(XsFilePos pos)
Set the new absolute read position.
virtual XsResultValue writeData(const XsByteArray &data, XsFilePos *written=nullptr)=0
Write the data contained in data to the device.
A list of uint8_t values.
virtual XsResultValue readData(XsFilePos maxLength, XsByteArray &data)=0
Read at most maxLength bytes from the device into data.
virtual ~IoInterface()
Destructor.
virtual bool isOpen(void) const =0
Returns true if the object has a connection to a device.
PortOptions
Options for flow control and stopbits which must be used when opening a port.
#define XS_DEFAULT_READ_BUFFER_SIZE
The default size of the serial read buffer in bytes.
XsResultValue
Xsens result values.
#define XS_DEFAULT_WRITE_BUFFER_SIZE
The default size of the serial write buffer in bytes.
virtual XsFilePos getFileSize(void) const
Return the size of the file.
Contains a descriptor for opening a communication port to an Xsens device.
virtual XsResultValue create(const XsString &filename)
Create an empty file.
virtual XsFilePos getWritePosition(void) const
Return the current write position.
virtual XsResultValue close(void)=0
Close the connection to the device.
virtual XsResultValue setTimeout(uint32_t ms)
Set the default timeout value to use in blocking operations.
XSENS_DISABLE_COPY(IoInterface)
virtual XsResultValue find(const XsByteArray &needleV, XsFilePos &pos)
Find a string of bytes in the file.
virtual XsResultValue deleteData(XsFilePos start, XsFilePos length)
Delete the given data from the file.
An abstract IO interface.
virtual XsResultValue setWritePosition(XsFilePos pos=-1)
Set the new absolute write position.
virtual void cancelIo(void) const
Cancel any pending io requests.
virtual XsResultValue waitForData(XsFilePos maxLength, XsByteArray &data)
Wait for data to arrive or a timeout to occur.
virtual XsResultValue insertData(XsFilePos start, const XsByteArray &data)
Insert the given data into the file.
virtual XsResultValue open(const XsPortInfo &portInfo, XsFilePos readBufSize=XS_DEFAULT_READ_BUFFER_SIZE, XsFilePos writeBufSize=XS_DEFAULT_WRITE_BUFFER_SIZE, PortOptions options=PO_XsensDefaults)
Open a communication channel to the given port info.
int64_t XsFilePos
The type that is used for positioning inside a file.
A 0-terminated managed string of characters.
virtual XsResultValue appendData(const XsByteArray &bdata)
Write data to the end of the file.
virtual XsFilePos getReadPosition(void) const
Return the current read position.
virtual bool isReadOnly(void) const
Return whether the file is read-only or not.