-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Verification
- I searched for similar feature request and found none was relevant.
Pitch us your idea!
Let's specify how resources will be packaged and handled by companion apps
Description
In #321 I did a lot of experiments with the external flash storage and the file system. The goal is to use this external flash memory to store big resources (pictures and fonts) so that we can free quite a lot of space in the internal flash memory.
In this comment, I listed the action points that must be done before we can release this feature. This discussion is about the resources packaging and management by companion app : how will we packaged the resource files so companion app can upload them to the watch using the BLE FS API ?
Please note that this is a technical discussion mostly targeted to InfiniTime and companion apps developers.
During my experiments, I used ITD to manually upload previously generated binary files to the watch. I sometimes needed to retry because the transfer would fail for some reason. I also had no way to check if the data were corrupted during the transfer. The upload of a full picture (24024016b = 115200B) took ~2 minutes, iirc.
Sending random binary files to the watch does not fit well with the end-users. I would like all the file to be automatically generated at build time (this is not the scope of this discussion), packaged into a single file with all the info needed for companion app to automatically upload the files to the watch.
Here's my proposal :
- package all the files in a compressed file format (.tar.gz or .zip). Maybe change the file extension to something else (InfiniTime Resource Format, IRF)
- add a small 'manifest' file that companion app will be able to use to identify this archive as a resource pack for InfiniTime
- Could be as simple as a JSON file with the target infinitime version :
{
"infinitime" : "1.11"
}
- it could also contain the file mapping (path and name of each file from the archive -> path and name in the in the PineTime FS)
{
"files": [
{
"file1.bin": "/resources/watchface1/background.bin"
},
{
"file2.bin": "/resources/watchface2/font.bin"
}
]
}
- this file could also contain other meta data in the future
- I don't think our BLE API supports any kind of CRC functionality. The companion app will be able to check the data validity by reading back the file it has just transferred.
- I noticed that overwriting a file is very slow. If the file already exists, I recommend to delete it first before writing it again.
Questions:
- Am I missing anything?
- Is there some kind of existing standard that we could use instead of creating a new one?
So... this is a request for comment. Will this simple packaging strategy work well with InfiniTime and companion app to upload fonts and pictures in the external flash storage?