Add create object function
This function takes in a object name, and a map of
variants, converts it to json, and creates a dbus-interface
after validating the json matches the correct schema.
Tested-by: Uploaded new Pid interface through D-Bus.
Change-Id: Ieec47a3f9fb53d5ac4f975f13ae6b8efd323971d
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/schemas/Pid.json b/schemas/Pid.json
new file mode 100644
index 0000000..aa262fb
--- /dev/null
+++ b/schemas/Pid.json
@@ -0,0 +1,83 @@
+{
+ "$schema": "http://json-schema.org/schema#",
+ "type": "object",
+ "properties": {
+ "Class": {
+ "type": "string"
+ },
+ "FFGainCoefficient": {
+ "type": "number"
+ },
+ "FFOffCoefficient": {
+ "type": "number"
+ },
+ "ICoefficient": {
+ "type": "number"
+ },
+ "ILimitMax": {
+ "type": "number"
+ },
+ "ILimitMin": {
+ "type": "number"
+ },
+ "Inputs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "Name": {
+ "type": "string"
+ },
+ "OutLimitMax": {
+ "type": "number"
+ },
+ "OutLimitMin": {
+ "type": "number"
+ },
+ "Outputs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "PCoefficient": {
+ "type": "number"
+ },
+ "SlewNeg": {
+ "type": "number"
+ },
+ "SlewPos": {
+ "type": "number"
+ },
+ "Type": {
+ "type": "string"
+ },
+ "Zones": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "SetPoint": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "Class",
+ "FFGainCoefficient",
+ "FFOffCoefficient",
+ "ICoefficient",
+ "ILimitMax",
+ "ILimitMin",
+ "Inputs",
+ "Name",
+ "OutLimitMax",
+ "OutLimitMin",
+ "PCoefficient",
+ "SlewNeg",
+ "SlewPos",
+ "Type",
+ "Zones"
+ ]
+}