Commit Graph

183 Commits

Author SHA1 Message Date
Charl Wentzel
fb28f86ae9 Important Update:
- JSONparse:
  - Allow base entry to be Array or Object
  - Do not enforce escaping of '/' -> '\/'
  - Bug fix: properly encode string values in arrays
2019-07-16 16:43:55 +02:00
Charl Wentzel
c682fd6504 Merge branch 'MessageServer' 2019-07-15 17:41:04 +02:00
Charl Wentzel
14982e8459 Important Update:
- Channels (FunctionCore & SelectableBare):
  - Added state "Standby", allow auto-managed handle to be opened
- SelectableCore:
  - Set default "Persistent" state for sockets based on type
  - Remove Process() method (no different from SelectableBare
- DateTimeCore:
  - Added BuildDateTimeStr() methods to build date for values
- JSONparseCore:
  - Added error message to file operations
2019-07-15 17:40:40 +02:00
Charl Wentzel
df371d4f10 Important Update:
- DeviceCore:
  - Allow different event output types: None, Simple or JSON
  - Add date & time to JSON events
2019-07-15 17:29:45 +02:00
Charl Wentzel
91a7707fef Minor Update:
- DeviceCore:
  Issue event with DataPath, not param name
2019-07-12 08:54:06 +02:00
Charl Wentzel
5f0c963da7 Merge branch 'master' into ModbusCore 2019-07-10 19:50:26 +02:00
Charl Wentzel
7d69edffa2 Important Update:
- DeviceCore:
  - Added Data Type "bool"
  - Create boolean var for params of type "bool"
2019-07-10 19:39:44 +02:00
Charl Wentzel
14af8390ec Important Update:
- FunctionCore:
  - Bug Fix: Change Channel OutState before triggering event
- TimingCore:
  - Add method SecondsPassed() (provides seconds instead of milli-seconds)
2019-06-23 20:51:51 +02:00
Charl Wentzel
9f8f69de3f Important Update:
- FunctionCore:
  - Improve Channel Events:
    - Remove important actions from ChannelStateEvent()
      (now only used for custom actions)
    - Add new method UpdateChannelOutState()
    - Add Channel Events to Link and Unlink actions
    - Rename SetChannelState() -> SetChannelInState()
  - Use Channel->Ref (instead of name) on all channel events
- DeviceCore/SelectableCore:
  - Rename SetChannelState() -> SetChannelInState()
2019-06-23 18:03:37 +02:00
Charl Wentzel
e9b50f1af9 Important Update:
- FunctionCore/SelectableCore:
  - Replace Channel->State with InState
  - Add Channel-OutState (ready for output) updated by ChannelStateEvent()
- TimingCore:
  - Add GetUpCounter() for calculating uptime string (in seconds)
2019-06-23 10:38:27 +02:00
Charl Wentzel
207caa696d Important Update:
- DateTimeCore:
  - Added new functions Get/SetDateTime() for combined date & time get/set
  - Added LocalTime param to ReadDate/Time() and BuildDate/TimeStr()
    - Allow input time to interpretted as ether UTC or local time
- DeviceCore:
  - Added SourceRef to HandleCommand()
2019-06-19 11:18:34 +02:00
Charl Wentzel
794b7e5486 Important Update:
- FunctionCore:
  - Implement UnlinkChannel()
    - Avoid memory errors on application shutdown (state events)
    - Unlink channels before destroying in Function destructor
  - Bug fix: Linked Channels not added correctly
2019-06-17 12:43:12 +02:00
Charl Wentzel
abf51d39a2 Merge branch 'GISReaderPort' 2019-06-16 21:04:28 +02:00
Charl Wentzel
8791e25d22 Important update:
- DateTimeCore:
  - Added ReadDateTime() method, combining ReadDate() & ReadTime()
  - Added Read(Time/Date/DateTime)Str() methods for decoding date string
2019-06-16 13:56:26 +02:00
Charl Wentzel
253eb91824 Important Update:
- FunctionCore:
  - Add OldState to ChannelStateEvent()
  - Add new method ChannelOutState()
  - Update Logging levels
- SelectableCore:
  - Restart LastAction timer of Name Resolve fail (cause delayed re-open)
- Watchdog:
  - Move JSON PingInterval param to "Config" object
2019-06-10 17:25:31 +02:00
Charl Wentzel
7787da5119 Important Update:
- Complete Async resolve:
  - Remove Resolving param from THandle
  - Rename state csResolving -> csPreparing
  - Added handle state csPrepared, to indicated resolve complete
  - Open handle if state = csPrepared
  - Remove Resolve delay (not required since async resolve)
    - remove from JSON config as well
2019-06-10 10:44:51 +02:00
Charl Wentzel
bde14a13da Major Update:
- FunctionCore
  - Replace Channel->Ready with Channel->State (off/waiting/ready)
  - Add Function reference to Handle
- SelectableBare/Core:
  - Implement async address resolve with event handling
    - Create ResolveHandler() signal handler (friend) function
  - Change Create/Remove/DestroyHandle() methods to virtual methods
    - Move socket specific code to SelectableCore
  - Rename ChangeState() to virtual HandleState()
  - Move ClearHandle() from SelectableBare -> SelectableCore
  - Implement new/delete from THandle
  - Set max TCP SYN count on connect
2019-06-09 22:05:27 +02:00
Charl Wentzel
08fce64629 Important Update:
- FunctionCore
  - So not set Function JSON "config" param to empty object by default
  - Change TChannelLink to reference Channel direct
  - Add Input/Output to TChannelLink
    - Replace LinkChannel() Bidirectional param with Input/Output param
    - Update JSON config as well
  - Implement Channel "Ready" state and events
    - Remove Input/OutputEnabled parameters and related methods
    - Remove from JSON config as well
    - Update AddChannel() method accordingly
  - Add Ref param to struct TChannel
- SelectableCore:
  - Convert inline ChangeState() to non-inline method
  - Move ChangeState() to last step in open/close methods
  - Add Channels in Not Ready state
  - Change Channel state when Handle state changed
- DeviceCore:
  - Add Channels in Ready state
- FileCore:
  - Add Channel in Not Ready state
2019-06-05 19:13:04 +02:00
Charl Wentzel
fa6825b72a Important Update:
- FunctionCore/SelectableCore/FileCore/DeviceCore:
  - Remove InputChannels
    - Only OutputChannels -> LinkedChannels
    - Remove PullInput/Output() methods
    - Remove StoredOutput
  - Add References to channels and linked channels
    - Send SourceRef with output
    - Receive TargetRef with input
    - Filter output channels based on TargetRef
2019-06-04 18:35:23 +02:00
Charl Wentzel
7459763eb6 Important Update:
- Remove unused: FunctionCore-ChannelBuffer
- DataTreeCore:
  - Bug fix: Set Len=0 on element Clear()
- SelectableBare/Core:
  - Move move BuildArgs() to SelectableBare
  - Make OutputHandle() to virtual method
- UtilCore:
  - Bug fix: Handle NoCrLF correctly in BytesToSafeStr()
2019-06-02 16:12:42 +02:00
Charl Wentzel
ac649bf4fb Minor Update:
- DeviceCore:
  - Initialise params in header file
- JSONparseCore:
  - Increase Read buffer to handle large queries
- UtilCore:
  - Bug fix: handle NULL seperator in Hex conversions
2019-05-28 09:22:28 +02:00
Charl Wentzel
316b27b19f Important Update:
- DeviceCore:
  - Allow adjustable reply timeout with SetWaitForReply()
2019-05-22 15:35:27 +02:00
Charl Wentzel
97eb749903 Merge branch 'BeagleBoneIO' 2019-05-20 18:08:10 +02:00
Charl Wentzel
c0a50bf2bd Minor update:
- FunctionCore:
  - Set Function Type in Init()
- SelectableBare:
  - Remove unnecesary initialisation in constructor
- SelectableCore:
  - Remove code duplicated in SelectableBare
2019-05-20 18:07:25 +02:00
Charl Wentzel
c723846fc9 Bug fix:
- JSONparse:
  - Error deleting unused array element
2019-05-20 17:33:35 +02:00
Charl Wentzel
0682de7f62 Merge branch 'WatchdogCore' 2019-05-13 09:41:16 +02:00
Charl Wentzel
cb98634b79 Minor Update:
- Comments added
2019-05-13 09:33:37 +02:00
Charl Wentzel
aedf3c6b46 Minor Update:
- LogCore: Increase log buffer for larger data events
2019-05-03 11:33:00 -05:00
Charl Wentzel
1b4ec32065 Minor Update:
- UtilCore:
  - Set optional parameters on HexStrToBytes function.
2019-04-23 21:52:23 +02:00
Charl Wentzel
01ec1071b1 Important Update:
- Save reference to process config in Function Core
  - Moved from DeviceCore to here as common feature
  - "Config" : object
    Allow additional config to be stored in application definition
  - "Config" : string
    Name reference to config object in main JSON file
  - Remove from Device Core
2019-04-22 10:29:52 +02:00
Charl Wentzel
77db246541 Important Update:
- UtilCore:
  - Coverted strings not zero terminated
2019-04-21 12:53:28 +02:00
Charl Wentzel
0db59f8ecd Important Update:
- SelectableBare:
  - Bug fix: Packet sent too early
2019-04-19 11:16:07 +02:00
Charl Wentzel
f89d59e269 Merge branch 'master' into GISReaderPort 2019-04-15 17:27:47 +02:00
Charl Wentzel
0046edc251 Important Update:
- Implemented new Util library:
  - Convert Bytes to Hex/Bin/Safe string
  - Convert HexString to Bytes
  - Search String for substring function
- Use Util library in LogCore for String conversions
2019-04-15 17:26:52 +02:00
Charl Wentzel
f20a9a676f Important Update:
- JSONparseCore:
  - Implement output to string
  - Added method WriteToString()
  - Create function pointers which is selected for correct output:
    JSONstrOutput or JSONfileOutput -> Print()
  - Replace all write() statements with Print() statements
  - Modify PrintStr not use dprintf, but sprintf to temp buffer
2019-04-07 10:25:44 +02:00
Charl Wentzel
7acdd8f704 Minor Update:
- Increase buffer of JSONparse to ensure reading for long strings
2019-04-06 13:45:45 +02:00
Charl Wentzel
bc89021a0e Important Update:
- DateTimeCore:
  - Added new functions to process data information
- JSONparse:
  - Bug fix: file permissions on create
2019-04-03 17:03:50 +02:00
Charl Wentzel
5899bf9892 Merge branch 'master' into HitNotBLE
# Conflicts:
#	SelectableCore.cpp
#	SelectableCore.h
2019-04-03 17:02:52 +02:00
Charl Wentzel
ebaf52a1a0 Important Update:
- Split SelectableCore.cpp into two classes:
  SelectableBare & SelectableCore
2019-03-29 15:44:13 +02:00
Charl Wentzel
889df6c7de Important Update:
- DeviceCore:
  - Added PollCycle variable (not used here)
- WatchdogCore:
  - Return "true" on in Process()
- SelectableCore:
  - Minor update (code compacted)
- Application/Function:
  - Added CApplication as friend of CFunction
  - Added param WaitToTerminate on Function
  - Application Run() only exists if all (WaitToTerminate) functions
    has terminated cleanly.
2019-03-09 20:41:25 +02:00
Charl Wentzel
3626909786 Important Update:
- Added SendEnable (vir RTS pin) for TTL/RS485 converter
- Bug fix: Check for Handle->InTimeout before force output
2019-03-04 16:42:29 +02:00
Charl Wentzel
49294ab6b5 Important Update:
- Update Command port:
  - Simplified error handling
  - Provide error reply
- Added method GetNextParamGroup()
2019-01-10 11:46:41 +02:00
Charl Wentzel
b679da9c29 Important Update:
- Renamed JSON parameter: PollGroup -> ParamGroup
2019-01-09 15:48:37 +02:00
Charl Wentzel
f10750ca2d Important Update:
- Remove separate poll group specifications in JSON file
- Implemented PollGroups per parameter or node in JSON file
- Implemented copying of PollGroups from Template
2019-01-09 15:19:06 +02:00
Charl Wentzel
3472f506b6 Major Update:
- JSONparseCore:
  - Add initialisations values for class params
  - Add method AddBase() to dynamically change DataTree
  - Added Error messages
- DeviceCore:
  - Implement ValueTree (JSON tree)
    - Node are added as devices & params are created/added
    - Nodes (and path) are referenced on devices & params
    - Node values are updated as device params are updated
  - Added Persistence File (not yet complete)
  - Updated InitDevices() & InitDeviceParams()
    - Split into smaller methods: CopyTemplateParam() & InitDeviceParam()
    - Load Device definition or Parameter maps from files
    - Allow loading of nested parameter map files
    - Load Parameter as JSON tree, generate names/path dynamically
2019-01-09 10:56:38 +02:00
Charl Wentzel
3e40f7a86d Important Update:
- Implement Handle Address renaming:
- Restructure JSON config, with address list and rename list
- SelectableCore:
  - Add method GetHandleAddress() - lookup renamed handle
  - Add init values to all struct and classes declarations
- Replace malloc()/strcpy() sequences with strdup()
2019-01-08 08:35:21 +02:00
Charl Wentzel
c5da842ac1 Major Update:
- FunctionCore:
  - Add OutputFormat param on Output() method - override output format
- SelectableCore:
  - Update Log output formats (process/functionblock)
- DeviceCore:
  - Updated device data format (different byte sequences)
  - Added ID & Address fields to TDevice struct
  - Add search methods for ID & Address
  - Update AddDevice() method to check for duplicate ID & address
  - Handle Invalid reply different from reply timeout
  - Add methods ValidReplyReceived() for standardise operation
  - Bug fix: DeviceTypes added as to Device List!
  - Bug fix: Check if Device/DeviceType created before adding params
  - Added correct handling of new Device Data types (LH & HL)
  - Updated log messages
2018-12-16 00:42:43 +02:00
Charl Wentzel
f1be4e9540 Important Update:
- Switch from malloc/free -> new/delete for structures
- Bug fix: Move Parameter groups to Device (not class)
- Update Parameter groups:
  - Update Read/Write indicators as params are added
2018-12-13 12:41:37 +02:00
Charl Wentzel
dc76d99b58 Important Update;
- ApplicationCore:
  - Minor log updates
- FunctionCore:
  - Initialise structs & object params in declaration
- DeviceCore:
  - Update logs with more consistent structure
  - Initialise structs & object params in declaration
  - Implemented DeviceType templates
    - Added Add/Get/Destroy methods
    - Load from config or separate template file
    - Build Devices/Params from template
  - Implemented ParamGroups
    - Added Add/Get/Destroy methods
    - Load with DeviceTypes
  - Added JSON parser to read separate template files
  - Bug fix: Getxxxx() methods
2018-12-13 09:17:39 +02:00
Charl Wentzel
90beb031af Minor Update 2018-12-11 21:36:24 +02:00