Bristol-Braille / canute-ui

User interface for the Canute electronic Braille reader.
http://bristolbraille.co.uk
GNU General Public License v3.0
36 stars 6 forks source link

Let the Canute-as-display slave protocol write to a file on the Canute's Library SD card #286

Open pachpict opened 1 year ago

pachpict commented 1 year ago

Is it possible to write a file to media inserted into the Canute whilst the Canute is in display mode?

If so we should be able to implement a new feature which has been requested by Techno-Vision for some time, being able to treat the Canute like an embosser, i.e. plug it into a PC and have the PC send Braille which gets written to a file.

Even if it can only write to the Raspian's micro-SD card (not external media) whilst in display mode this would work as a file once written could be transferred to the SD card automatically next time the Canute leaves display mode and enters the stand-alone mode.

I suggest this would be by adding a new protocol call (which doesn't break old functionality) which basically says, "treat all the following lines as Braille to write into a file".

File name could be iterating ("external-001.brf" etc) in the first implementation, though having the first line sent back translated (assuming US Computer Braille) to a string and used as the file name would be ideal.

woodcoder commented 1 year ago

So the problem here is that the PC talking to the Canute in display mode is directly communicating with the firmware. Currently this cuts the internal OS out of the loop, so it won't know what data is being shown, and will therefore be unable to write it to a file on either the SD card or USB media.

It might be possible for the firmware to communicate with the OS at the same time as the PC - 'echoing' any commands it receives so that the OS could write the output to a file - but we'd need to try that to check it could work.