2835 lines
97 KiB
JSON
2835 lines
97 KiB
JSON
{
|
|
"type": "translation_unit",
|
|
"children": [
|
|
{
|
|
"type": "preproc_ifdef",
|
|
"children": [
|
|
{
|
|
"type": "#ifndef",
|
|
"text": "#ifndef"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "JOYSTICK_H"
|
|
},
|
|
{
|
|
"type": "preproc_def",
|
|
"children": [
|
|
{
|
|
"type": "#define",
|
|
"text": "#define"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "JOYSTICK_H"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "system_lib_string",
|
|
"text": "<ArduinoLog.h>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "string_literal",
|
|
"children": [
|
|
{
|
|
"type": "\"",
|
|
"text": "\""
|
|
},
|
|
{
|
|
"type": "string_content",
|
|
"text": "config.h"
|
|
},
|
|
{
|
|
"type": "\"",
|
|
"text": "\""
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "system_lib_string",
|
|
"text": "<App.h>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "system_lib_string",
|
|
"text": "<Component.h>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "system_lib_string",
|
|
"text": "<modbus/ModbusTCP.h>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "string_literal",
|
|
"children": [
|
|
{
|
|
"type": "\"",
|
|
"text": "\""
|
|
},
|
|
{
|
|
"type": "string_content",
|
|
"text": "config-modbus.h"
|
|
},
|
|
{
|
|
"type": "\"",
|
|
"text": "\""
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "preproc_include",
|
|
"children": [
|
|
{
|
|
"type": "#include",
|
|
"text": "#include"
|
|
},
|
|
{
|
|
"type": "system_lib_string",
|
|
"text": "<stdint.h>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "class_specifier",
|
|
"children": [
|
|
{
|
|
"type": "class",
|
|
"text": "class"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "Bridge"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
},
|
|
{
|
|
"type": "class_specifier",
|
|
"children": [
|
|
{
|
|
"type": "class",
|
|
"text": "class"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "Joystick"
|
|
},
|
|
{
|
|
"type": "base_class_clause",
|
|
"children": [
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "access_specifier",
|
|
"children": [
|
|
{
|
|
"type": "public",
|
|
"text": "public"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "Component"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration_list",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "access_specifier",
|
|
"children": [
|
|
{
|
|
"type": "public",
|
|
"text": "public"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "enum_specifier",
|
|
"children": [
|
|
{
|
|
"type": "enum",
|
|
"text": "enum"
|
|
},
|
|
{
|
|
"type": "class",
|
|
"text": "class"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "enumerator_list",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "CENTER"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "UP"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "DOWN"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "LEFT"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "RIGHT"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "UNKNOWN"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "enum_specifier",
|
|
"children": [
|
|
{
|
|
"type": "enum",
|
|
"text": "enum"
|
|
},
|
|
{
|
|
"type": "class",
|
|
"text": "class"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "enumerator_list",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "LOCAL"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "REMOTE"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "enum_specifier",
|
|
"children": [
|
|
{
|
|
"type": "enum",
|
|
"text": "enum"
|
|
},
|
|
{
|
|
"type": "class",
|
|
"text": "class"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_REGISTER"
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "enumerator_list",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "POSITION"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "MODE"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "1"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "enumerator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "OVERRIDE"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "access_specifier",
|
|
"children": [
|
|
{
|
|
"type": "private",
|
|
"text": "private"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "pinUp"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "pinDown"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "pinLeft"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "pinRight"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "modbusAddr"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "currentPosition"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "lastPosition"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "mode"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "overridePosition"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// Position timing\r"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "unsigned",
|
|
"text": "unsigned"
|
|
},
|
|
{
|
|
"type": "long",
|
|
"text": "long"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "positionStartMs"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// Debouncing data\r"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "unsigned",
|
|
"text": "unsigned"
|
|
},
|
|
{
|
|
"type": "long",
|
|
"text": "long"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "lastReadMs"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "proposedPosition"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "qualified_identifier",
|
|
"children": [
|
|
{
|
|
"type": "namespace_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "::",
|
|
"text": "::"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "CENTER"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "confirmCount"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "primitive_type",
|
|
"text": "bool"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "useDebouncing"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "true",
|
|
"text": "true"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// Modbus definitions\r"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "MB_Registers"
|
|
},
|
|
{
|
|
"type": "array_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "modbusBlocks"
|
|
},
|
|
{
|
|
"type": "[",
|
|
"text": "["
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "3"
|
|
},
|
|
{
|
|
"type": "]",
|
|
"text": "]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "modbusBlockCount"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ModbusBlockView"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "modbusView"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// Private helpers\r"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "readPinsPosition"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "access_specifier",
|
|
"children": [
|
|
{
|
|
"type": "public",
|
|
"text": "public"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "declaration",
|
|
"children": [
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "Joystick"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "Component"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "owner"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_pinUp"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_pinDown"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_pinLeft"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_pinRight"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "optional_parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_modbusAddress"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "100"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "setup"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "loop"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "reset"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "info"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "optional_parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "val0"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "optional_parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "val1"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "debug"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "call_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "info"
|
|
},
|
|
{
|
|
"type": "argument_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "0"
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "getPosition"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "conditional_expression",
|
|
"children": [
|
|
{
|
|
"type": "binary_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "mode"
|
|
},
|
|
{
|
|
"type": "==",
|
|
"text": "=="
|
|
},
|
|
{
|
|
"type": "qualified_identifier",
|
|
"children": [
|
|
{
|
|
"type": "namespace_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": "::",
|
|
"text": "::"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "LOCAL"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "?",
|
|
"text": "?"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "currentPosition"
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "overridePosition"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "getValue"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "call_expression",
|
|
"children": [
|
|
{
|
|
"type": "template_function",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "static_cast"
|
|
},
|
|
{
|
|
"type": "template_argument_list",
|
|
"children": [
|
|
{
|
|
"type": "<",
|
|
"text": "<"
|
|
},
|
|
{
|
|
"type": "type_descriptor",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ">",
|
|
"text": ">"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "argument_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "call_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "getPosition"
|
|
},
|
|
{
|
|
"type": "argument_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "getLastPosition"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "lastPosition"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "unsigned",
|
|
"text": "unsigned"
|
|
},
|
|
{
|
|
"type": "long",
|
|
"text": "long"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "getHoldingTime"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "binary_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "now"
|
|
},
|
|
{
|
|
"type": "-",
|
|
"text": "-"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "positionStartMs"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "getMode"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "return_statement",
|
|
"children": [
|
|
{
|
|
"type": "return",
|
|
"text": "return"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "mode"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "primitive_type",
|
|
"text": "void"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "setMode"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_mode"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "expression_statement",
|
|
"children": [
|
|
{
|
|
"type": "assignment_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "mode"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "_mode"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "expression_statement",
|
|
"children": [
|
|
{
|
|
"type": "call_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "notifyStateChange"
|
|
},
|
|
{
|
|
"type": "argument_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_definition",
|
|
"children": [
|
|
{
|
|
"type": "primitive_type",
|
|
"text": "void"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "setOverridePosition"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "E_POSITION"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "pos"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "compound_statement",
|
|
"children": [
|
|
{
|
|
"type": "{",
|
|
"text": "{"
|
|
},
|
|
{
|
|
"type": "expression_statement",
|
|
"children": [
|
|
{
|
|
"type": "assignment_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "overridePosition"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "pos"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "if_statement",
|
|
"children": [
|
|
{
|
|
"type": "if",
|
|
"text": "if"
|
|
},
|
|
{
|
|
"type": "condition_clause",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "binary_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "mode"
|
|
},
|
|
{
|
|
"type": "==",
|
|
"text": "=="
|
|
},
|
|
{
|
|
"type": "qualified_identifier",
|
|
"children": [
|
|
{
|
|
"type": "namespace_identifier",
|
|
"text": "E_MODE"
|
|
},
|
|
{
|
|
"type": "::",
|
|
"text": "::"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "REMOTE"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "expression_statement",
|
|
"children": [
|
|
{
|
|
"type": "call_expression",
|
|
"children": [
|
|
{
|
|
"type": "identifier",
|
|
"text": "notifyStateChange"
|
|
},
|
|
{
|
|
"type": "argument_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "mb_tcp_write"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "MB_Registers"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "reg"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ",",
|
|
"text": ","
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "networkValue"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "mb_tcp_read"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "MB_Registers"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "reg"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "primitive_type",
|
|
"text": "void"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "mb_tcp_register"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ModbusTCP"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "manager"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ModbusBlockView"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "mb_tcp_blocks"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "const",
|
|
"text": "const"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "sized_type_specifier",
|
|
"children": [
|
|
{
|
|
"type": "short",
|
|
"text": "short"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "serial_register"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": "parameter_declaration",
|
|
"children": [
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "Bridge"
|
|
},
|
|
{
|
|
"type": "pointer_declarator",
|
|
"children": [
|
|
{
|
|
"type": "*",
|
|
"text": "*"
|
|
},
|
|
{
|
|
"type": "identifier",
|
|
"text": "bridge"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "access_specifier",
|
|
"children": [
|
|
{
|
|
"type": "protected",
|
|
"text": "protected"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ":",
|
|
"text": ":"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "primitive_type",
|
|
"text": "void"
|
|
},
|
|
{
|
|
"type": "function_declarator",
|
|
"children": [
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "notifyStateChange"
|
|
},
|
|
{
|
|
"type": "parameter_list",
|
|
"children": [
|
|
{
|
|
"type": "(",
|
|
"text": "("
|
|
},
|
|
{
|
|
"type": ")",
|
|
"text": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "virtual_specifier",
|
|
"children": [
|
|
{
|
|
"type": "override",
|
|
"text": "override"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// Configuration\r"
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "storage_class_specifier",
|
|
"children": [
|
|
{
|
|
"type": "static",
|
|
"text": "static"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "constexpr",
|
|
"text": "constexpr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "DEBOUNCE_COUNT"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "3"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "field_declaration",
|
|
"children": [
|
|
{
|
|
"type": "storage_class_specifier",
|
|
"children": [
|
|
{
|
|
"type": "static",
|
|
"text": "static"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_qualifier",
|
|
"children": [
|
|
{
|
|
"type": "constexpr",
|
|
"text": "constexpr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "type_identifier",
|
|
"text": "ushort"
|
|
},
|
|
{
|
|
"type": "field_identifier",
|
|
"text": "READ_INTERVAL_MS"
|
|
},
|
|
{
|
|
"type": "=",
|
|
"text": "="
|
|
},
|
|
{
|
|
"type": "number_literal",
|
|
"text": "25"
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "}",
|
|
"text": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": ";",
|
|
"text": ";"
|
|
},
|
|
{
|
|
"type": "#endif",
|
|
"text": "#endif"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "comment",
|
|
"text": "// JOYSTICK_H "
|
|
}
|
|
]
|
|
} |