On Mon, Mar 5, 2018, 6:48 AM Mats Wichmann <m...@wichmann.us> wrote:

> following on from Phil, the underlying issue is since json2cbor is a
> binary generated during the build, it does not work at build time for cross
> builds (host != target, think android in particular). thus a set of checked
> in dat files is needed.
>
> in master, currently, after a .dat is generated to out it is copied back
> to the src tree specifically so that git status will tell us something is
> out of sync. that may not be optimal, people are free to suggest better
> answers.
>

Get rid of the dat files altogether? AFAIK they are only there to bootstrap
SVR config at initialization time. Might as well just compile that in at
build time, no?

I threw together a simple PoC that initializes the doxm resource from a C
file and it seems to work (very light testing). Very simply:
InitDoxmResource calls get_vendor_doxm (instead of reading and parsing a
dat file), which must be implemented by the application to return a ptr to
a doxm struct that is assigned to gDoxm. The implementation is dead simple,
just static initialization of a struct. Not much more complicated than the
JSON.

A more dev-friendly implementation would generate the C source from JSON
(or as I prefer EDN).

Before I put more time in this (other SVRs are more complicated) I'd like
to get some feedback. Is there any reason this would not work? I can't find
one, but that doesn't mean there isn't one.

Gregg
_______________________________________________
iotivity-dev mailing list
iotivity-dev@lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to