Jagpal Singh Gill | c637974 | 2025-01-13 17:25:57 -0800 | [diff] [blame] | 1 | { |
| 2 | "$schema1": "http://json-schema.org/draft-07/schema#", |
| 3 | "$defs": { |
| 4 | "ModbusRTUDetect": { |
| 5 | "additionalProperties": false, |
| 6 | "description": "The definition for the modbus device.", |
| 7 | "type": "object", |
| 8 | "properties": { |
| 9 | "Type": { |
| 10 | "description": "The type of configuration object.", |
| 11 | "const": "ModbusRTUDetect" |
| 12 | }, |
| 13 | "Name": { |
| 14 | "description": "The name of the modbus device.", |
| 15 | "type": "string" |
| 16 | }, |
| 17 | "Address": { |
| 18 | "description": "The address ranges for the modbus device.", |
| 19 | "type": "array", |
| 20 | "items": { |
| 21 | "type": "object", |
| 22 | "additionalProperties": false, |
| 23 | "properties": { |
| 24 | "RangeStart": { |
| 25 | "description": "The start address for the address range of the modbus device.", |
| 26 | "type": "number" |
| 27 | }, |
| 28 | "RangeEnd": { |
| 29 | "description": "The end address for the address range of the modbus device.", |
| 30 | "type": "number" |
| 31 | }, |
| 32 | "SerialPort": { |
| 33 | "description": "The name of the serial port from SerialPort definition.", |
| 34 | "type": "string" |
| 35 | } |
| 36 | }, |
| 37 | "required": ["RangeStart", "RangeEnd", "SerialPort"] |
| 38 | } |
| 39 | }, |
| 40 | "Registers": { |
| 41 | "description": "The Modbus register definition.", |
| 42 | "type": "array", |
| 43 | "items": { |
| 44 | "type": "object", |
| 45 | "additionalProperties": false, |
| 46 | "properties": { |
| 47 | "Name": { |
| 48 | "description": "The name of the register.", |
| 49 | "enum": [ |
| 50 | "PartNumber", |
| 51 | "SparePartNumber", |
| 52 | "SerialNumber", |
| 53 | "BuildDate", |
| 54 | "Model", |
| 55 | "Manufacturer" |
| 56 | ] |
| 57 | }, |
| 58 | "Address": { |
| 59 | "description": "The address of the register.", |
| 60 | "type": "number" |
| 61 | }, |
| 62 | "Size": { |
| 63 | "description": "The size of the register in bytes.", |
| 64 | "type": "number" |
| 65 | } |
| 66 | }, |
| 67 | "required": ["Name", "Address", "Size"] |
| 68 | } |
| 69 | }, |
| 70 | "DataParity": { |
| 71 | "description": "The parity to use for data transmission.", |
| 72 | "enum": ["Odd", "Even", "None"] |
| 73 | }, |
| 74 | "BaudRate": { |
| 75 | "description": "The baudrate of the communication channel.", |
| 76 | "enum": [9600, 19200, 57600, 115200] |
| 77 | } |
| 78 | }, |
| 79 | "required": [ |
| 80 | "Name", |
| 81 | "Type", |
| 82 | "Address", |
| 83 | "Registers", |
| 84 | "DataParity", |
| 85 | "BaudRate" |
| 86 | ] |
| 87 | } |
| 88 | } |
| 89 | } |