initial
This commit is contained in:
24
ConfigGenerator/configGen.py
Normal file
24
ConfigGenerator/configGen.py
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from Cheetah.Template import Template
|
||||
|
||||
|
||||
|
||||
configItems = [
|
||||
{"label":"_", "key":"magic", "type":"I"},
|
||||
{"label":"Wifi SSID", "key":"wifiSsid", "type":"C", "length":32},
|
||||
{"label":"Wifi Key", "key":"wifiKey", "type":"C", "length":64},
|
||||
{"label":"MQTT Broker", "key":"mqttBroker", "type":"C", "length":64},
|
||||
{"label":"MQTT Username", "key":"mqttUser", "type":"C", "length":32},
|
||||
{"label":"MQTT Password", "key":"mqttPass", "type":"C", "length":32},
|
||||
{"label":"MQTT ClientId", "key":"mqttClientId", "type":"C", "length":32},
|
||||
{"label":"MQTT Topic", "key":"mqttTopic", "type":"C", "length":64},
|
||||
{"label":"MQTT Port", "key":"mqttPort", "type":"I"},
|
||||
{"label":"Measure Period", "key":"measurePeriod", "type":"I"}
|
||||
]
|
||||
|
||||
|
||||
h_file = Template(file="configuration_h.tmpl", searchList=[{"configItems":configItems}])
|
||||
open('configuration.h','w').write(str(h_file))
|
||||
c_file = Template(file="configuration_c.tmpl", searchList=[{"configItems":configItems}])
|
||||
open('configuration.cpp','w').write(str(c_file))
|
Reference in New Issue
Block a user