Directly access an AssetOTA file?


Is it possible to directly access an asset? I see that in AssetManager::parseAvailableAssets() it sets the filesystem to the external P2 storage to read from there. Is something like that possible to call from the user application?

I'm working on integrating a bootloader for an external coprocessor and I'd like to be able to directly access the file pointer so that it can work with the example bootloader host, but the Asset class abstracts that away a bit so I can't just use assetFile = fopen(asset.c_str(), "r") like it is expecting.

If not I could probably modify more on the bootloader host side to more closely resemble the asset_ota example. Though there are some functions like ftell() or fseek() that don't look like they directly map to an Asset function.

You can't access the underlying file directly. Also, it's compressed in flash memory, which is why there isn't a seek function and you must access the asset sequentially.

If the asset is fairly small, you could make a copy of it in the flash file system, which would then allow random access to it.

Ah, of course, it's still compressed. It is pretty small so I'll try writing to and reading from the flash file system, if for whatever reason I can't get that to work I'll try to adapt my code to use ApplicationAsset like in the example. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.