Commit Graph

12 Commits

Author SHA1 Message Date
Charl Wentzel
3f86de71b1 Major update:
- DataTreeCore:
  - Bug fix: GetMember() error if member not found
- FunctionCore: (affected: SelectableCore, FileCore, WatchdogCore)
  - Made destructor virual
  - Standardize method parameter naming, e.g. pName, pLog
  - Renamed parameters: DebugLevel -> LogLevel, OutputDisplay -> LogOutput
  - Reinstated parameter BaseMember
  - Removed logging parameters from constructor
  - Created method InitLoggging() (shows "Function Created" message)
  - Split LoadConfig() method into parts:
    - Implemented public LoadConfig() methods
    - Implemented LoadConfigData() method, load parameters from DataTree
- WatchdogCore:
  - Derive from CSelectableCore instead of CFunctionCore
  - Rename parameter: PingTimeout -> PingInterval
  - Replace Ping Channel with Handle only
  - Add method SetInterval()
  - Send command direct to handle with (channel) Input()
- SelectableCore:
  - Rename parameters: Auto -> AutoManage, ReopenTimeout -> ReopenDelay
  - Implemented own virtual LoadConfigData() method
- DeviceCore:
  - Made all logging conditional: if (Log) Log->Message(...)
- SelectCore:
  - Renamed parameters: DebugLevel -> LogLevel
2017-07-11 06:20:14 +02:00
Charl Wentzel
b7ed169730 Major Update & Bug fixes:
- FileCore:
  - Replace dlNone -> dlLow
  - Remove temporary code used by CBaslerCamera
- Function Core:
  - Add method SetDebugLevel()
  - Remove global parameter BaseMember;
- JSONparse:
  - Print Bool parameters as true/false, not 1/0
- SelectCore:
  - Add method SetDebugLevel()
- SignalCore:
  - Replace dlNone -> dlLow
2017-07-09 16:31:47 +02:00
Charl Wentzel
ee29625b9a Important update:
- DataTree->GetStr return Member->Value or NULL if not found
- Rename DeviceCore EDataType to EMBDataType, avoid conflict with JSONpaser
- Add DataTree to FunctionCore with LoadConfig() method
- Change ProcessName to char * (from char[])
- JSONparse:
  - Rename RootPath to BasePath on all methods to reduce confusion
  - Allow FilePath to be NULL, add '/' if not present
  - Fixed Parsing sequence in ParseObject & ParseArray
2017-04-10 21:33:14 +02:00
Charl Wentzel
5ea05d119e Major update:
- Logging
  - Created LogCore Class
  - Updated LogCore to use file descriptors instead of stdout
  - Add Log object reference to constructors for:
    FunctionCore, SelectCore
  - Use extern Log() object in SignalCore
- SelectableCore
  - Added new connection type: ForkedPipe
    Create pipe, fork process, connect pipe out to child stdin, exec
2016-08-22 12:14:53 +02:00
Charl Wentzel
1a9f825b25 Major Update:
- Minor fix: Set correct names in comments at top of file
- New FileCore Class:
  - Writing data to output file
- BufferCore:
  - Check for "EAGAIN" on write and retry write
- FunctionCore:
  - Add new Output method that references LocalIO directly
- SelectableCore:
  - New method SetAutomanage to specify auto re-open parameters
  - Re-open timer implemented to slow re-open events
  - Only call ProcessBuffer() if data received on socket
  - Force processing input data when no input marker set
  - Use new Output method to simplify code
  - Bug fix: Read correctly from buffer on multiple reads/writes on FD
  - Check for "EAGAIN" on write to FD and retry write
2016-07-20 09:37:25 +02:00
Charl Wentzel
b418fa73e0 Important Update:
- LogCore:
  - Removed global DebugLevel var, now passed as parameter
  - Implemented binary output values
- FunctionCore, SelectCore and SelectableCore:
  - internal DebugLevel param implemented
  - new internal DisplayOutput param (Normal/Hex/Bin)
- BufferCore:
  - Bug fix: allow for empty search string/marker
2016-06-09 06:53:09 +02:00
Charl Wentzel
ac34066f30 Important Update: (Massive CPU usage improvement)
- Bug fix: Select timeout not constant, reduces to zero
- Only scan FDs if Select event occured
2016-06-02 12:38:47 +02:00
Charl Wentzel
b4073a166a Major Update:
- Updated all Logged messages, standardised DebugLevel:
  - dlNone   - Show startup and stop
  - dlLow    - Show creation/destruction of Function Blocks and Local IO
  - dlMedium - Show connection events, eg. open/close
  - dlHigh   - Show data flow events
-LogCore:
  - LogMessage and ShowOutput uses va_list
    only run printf if DebugLevel correct
  - Remove global LogStr[] variable
- SelectableCore:
  - Implemented Auto-management of handles
    auto open on startup/fail/close
  - Changed simple Open/Close/Read/Write methods to inline
  - Do not set Select Write trigger for server socket
  - Memory leak, setting address twice on RemoteClient
  - Bug fix, only send handle out data if DebugLevel = dlHigh
  - Bug fix, do not Read/ProcessBuffer if no InputBuffer
2016-05-27 13:32:54 +02:00
Charl Wentzel
c01c8f5e9b Major Update:
- Implemented global var DebugLevel
- Update LogCore to check DebugLevel
- Added many log messages and standadised all log messages
- Further improved validation checks on all methods
- Updated SelectCore, only remove SelectHandle from list during Test()
- Close Handles in SelectableCore destructor
Bug fixes:
- Non-blocking Client Socket Connection now working correctly
- Remove FD from Select lists at the correct time
2016-05-26 15:03:13 +02:00
Charl Wentzel
e83c09ecb6 Important Update:
- Converted Select functions into new class CSelectCore
- Move Read/Write code from main() to SelectableCore Read()/Write()
- Pass CSelectCore object to CSelectableCore on create
- Updated SelectCore Read/Write lists directly from SelectableCore
- SelectCore->Test() checks all FDs directly and call Read/Write functions
- Improved checking/validating for methods in SelectableCore
2016-05-24 15:02:51 +02:00
Charl Wentzel
dcfbd85efa Major Update:
- Merged SelectCore and PortCore into new SelectableCore
  Single well integrated Class
- Rename SelectCore.h to SelectableCore.h
- Create new TFileHandle structure for Ports/Sockets
- Moved buffer and Input Timeout from FunctionCore to TFileHandle
- Moved Read, Write and ProcessBuffer from FunctionCore to TFileHandle
Bug Fixes:
- malloc correct size for names
- Calculate MaxFD correctly when closing FDs
2016-05-23 14:35:15 +02:00
Charl Wentzel
264169e525 Initial Commit:
- Create single library for all Core RedA functions/classes
- Working version
2016-05-17 07:38:33 +02:00