Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcards in foe filenames #163

Open
n-sterenborg opened this issue Nov 2, 2023 · 3 comments
Open

Wildcards in foe filenames #163

n-sterenborg opened this issue Nov 2, 2023 · 3 comments

Comments

@n-sterenborg
Copy link

First off, hats of to you guys for this repo, fantastic work.

In the current implementation, the filename of a foe file that is send to the slave has to match (one of) the predefined filename(s) exactly. It would be nice to be able to use wildcard characters for this. My application is for a firmware update, it would be nice to be able to specify e.g.: "firmware_v*...*.bin".

@ArthurKetels
Copy link
Contributor

Easy, just specify the part before '*' as the filename in SOES, extra characters will be ignored. It is up to you application to check the file for validity.

@n-sterenborg
Copy link
Author

n-sterenborg commented Nov 3, 2023

Hi @ArthurKetels, thanks for your reply. I tried your solution but it does not seem to work for me.

I specified the filename in the foe_cfg as "firmware_v". If I then send a file named e.g. "firmware_v1.2.3" foe_fopen() returns FOE_ERR_NOTFOUND, since the strncmp compares up to num_chars, which is the length of "firmware_v1.2.3".

Edit: The other way around does work, e.g. I send a file named "firm", which is accepted.

@ArthurKetels
Copy link
Contributor

Changing #define FOE_FN_MAX 31 to a value that fits "firmware_v" helps. But I agree the API could be improved so the application has better control about what filenames can be accpted or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants