pebble / clay

Pebble Config Framework
MIT License
120 stars 29 forks source link

Javacript conversion mandatory for checkboxgroups #13

Closed gregoiresage closed 8 years ago

gregoiresage commented 8 years ago

The getValue of a checkboxgroup returns an array of strings

{"enableBackground":1,"background":65280,"font_size":"2","test":["sushi","burgers"]}

If we let Clay handle 'showConfiguration' and 'webviewclosed' events, an array of bytes is sent to the watchapp for the test key containing : ['s','u','s','h','i','b','u','r','g','e','r','s']

So without javascript convertion, it is really not easy to use this in the C code. Clay should also return \0 character like that :

{"enableBackground":1,"background":65280,"font_size":"2","test":["sushi",0,"burgers",0]}

so the string delimiter will permit to split the result in C.

gregoiresage commented 8 years ago

For the context, I wrote a simple tool to generate the C getters for the Clay settings (from the config.json). checkboxgroup is the only type not yet supported

If you want to look at the tool : https://github.com/gregoiresage/enamel