Hi all
Thanks a lot for all your inputs.
rhb, thanks the the suggestions on pain ascii. I would, if possible, like to avoid creating a custom format.
ejeffrey, we currently use INI file format and are not happy with it - for the same reasons as you point out. I agree that a solution could be to implement a subset of eg. JSON. I would like if the server does not need to know the restrictions - as it will need to know this for every firmware version, which will likely be a pain to maintain. The restrictions could be added in the eg. JSON structure - but this would be a custom interpretation. Ideally, I would like the retrictions to be formulated in a standard way - such that it can be loaded into every existing program supporting this.
Dubbie, thanks for the link to the parser. Will definately give this a try if we end up with JSON.
sleemanj, thanks for the suggestion. Again, the weak point with JSON in regards to this specific application is the lack of a standard way to define restrictions to parameter values.
David Chamberlain, thanks for the example. It is definately a possibility to add the schema in the top of the file. The "problem" is that 3rd party software will not be able to recognise this (i assume). In this case, it is really the client (the embeded device) which knows what the correct schema is. The server merely provides a interface to edit the config files and should ideally not know any detail of the content (thats why I need the config file to be completely self-explanatory). The "edited" config file will be validated by the embedded device before it is loaded.
krho, Thanks for the suggestion on CBOR. We have looked into this. The format itself is interesting and seems suitable for embedded devices (which JSON, XML, YAML etc. are really not). However, to my knowledge, CBOR does not specify any "schema" mechanism.
Jeroen3, Thanks for the suggestion. I was not aware that XML supported inline schema - I will definately look into this. Only problem with XLM is that it is not the simplets to parse on a small embedded device in ANSI C.
Best regards
Chrstian