Due to the structure of the API the device has no option but to return an error or the length of data requested.
While some physical layers do not support variable length reads, I2C and USB do. The only work around is for teh application to add a read header with the actual returned length.
Suugestion;
- Change the API to allow the application to report how much data is available for the given request.
Then either;
- Change the protocol to prepend a read length to the protocol read, or,
- Change the
control peripheral driver adapters to allow the pyhsical layer to report end-of-transaction to the host.
- This might mean creating a protocol update to inform the host on physical layers that do not explicitly support short-reads.
Due to the structure of the API the device has no option but to return an error or the length of data requested.
While some physical layers do not support variable length reads, I2C and USB do. The only work around is for teh application to add a read header with the actual returned length.
Suugestion;
Then either;
controlperipheral driver adapters to allow the pyhsical layer to report end-of-transaction to the host.