author | Edouard Tisserant <edouard@beremiz.fr> |
Thu, 04 Jul 2024 11:24:04 +0200 | |
changeset 3982 | 69d161fc2e08 |
parent 3957 | 2510c1f935d1 |
child 3961 | f01bd9a40554 |
permissions | -rw-r--r-- |
3937
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
1 |
/* |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
2 |
Copyright Edouard TISSERANT 2024 |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
3 |
See COPYING for details |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
4 |
*/ |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
5 |
|
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
6 |
#if !defined(_PLCObject_hpp_) |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
7 |
#define _PLCObject_hpp_ |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
8 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
9 |
#include <map> |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
10 |
#include <vector> |
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
11 |
#include <mutex> |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
12 |
#include <thread> |
3949
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
13 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
14 |
#include "blob.hpp" |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
15 |
|
3937
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
16 |
#include "erpc_PLCObject_interface.hpp" |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
17 |
|
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
18 |
using namespace erpcShim; |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
19 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
20 |
#define FOR_EACH_PLC_SYMBOLS_DO(ACTION) \ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
21 |
ACTION(PLC_ID)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
22 |
ACTION(startPLC)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
23 |
ACTION(stopPLC)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
24 |
ACTION(ResetDebugVariables)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
25 |
ACTION(RegisterDebugVariable)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
26 |
ACTION(FreeDebugData)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
27 |
ACTION(GetDebugData)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
28 |
ACTION(suspendDebug)\ |
3949
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
29 |
ACTION(resumeDebug)\ |
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
30 |
ACTION(ResetLogCount)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
31 |
ACTION(GetLogCount)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
32 |
ACTION(LogMessage)\ |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
33 |
ACTION(GetLogMessage) |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
34 |
|
3949
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
35 |
extern "C" { |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
36 |
typedef struct s_PLCSyms{ |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
37 |
uint8_t *PLC_ID; |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
38 |
int (*startPLC)(int argc,char **argv); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
39 |
int (*stopPLC)(void); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
40 |
void (*ResetDebugVariables)(void); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
41 |
int (*RegisterDebugVariable)(unsigned int idx, void* force, size_t force_size); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
42 |
void (*FreeDebugData)(void); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
43 |
int (*GetDebugData)(unsigned int *tick, unsigned int *size, void **buffer); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
44 |
int (*suspendDebug)(int disable); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
45 |
void (*resumeDebug)(void); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
46 |
void (*ResetLogCount)(void); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
47 |
uint32_t (*GetLogCount)(uint8_t level); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
48 |
int (*LogMessage)(uint8_t level, char* buf, uint32_t size); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
49 |
uint32_t (*GetLogMessage)(uint8_t level, uint32_t msgidx, char* buf, uint32_t max_size, uint32_t* tick, uint32_t* tv_sec, uint32_t* tv_nsec); |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
50 |
} PLCSyms; |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
51 |
} |
3937
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
52 |
class PLCObject : public BeremizPLCObjectService_interface |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
53 |
{ |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
54 |
public: |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
55 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
56 |
PLCObject(void); |
3937
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
57 |
~PLCObject(void); |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
58 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
59 |
// ERPC interface |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
60 |
uint32_t AppendChunkToBlob(const binary_t * data, const binary_t * blobID, binary_t * newBlobID); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
61 |
uint32_t GetLogMessage(uint8_t level, uint32_t msgID, log_message * message); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
62 |
uint32_t GetPLCID(PSKID * plcID); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
63 |
uint32_t GetPLCstatus(PLCstatus * status); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
64 |
uint32_t GetTraceVariables(uint32_t debugToken, TraceVariables * traces); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
65 |
uint32_t MatchMD5(const char * MD5, bool * match); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
66 |
uint32_t NewPLC(const char * md5sum, const binary_t * plcObjectBlobID, const list_extra_file_1_t * extrafiles, bool * success); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
67 |
uint32_t PurgeBlobs(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
68 |
uint32_t RepairPLC(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
69 |
uint32_t ResetLogCount(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
70 |
uint32_t SeedBlob(const binary_t * seed, binary_t * blobID); |
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
71 |
uint32_t SetTraceVariablesList(const list_trace_order_1_t * orders, int32_t * debugtoken); |
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
72 |
uint32_t StartPLC(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
73 |
uint32_t StopPLC(bool * success); |
3957
2510c1f935d1
C runtime: add autoload
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3949
diff
changeset
|
74 |
uint32_t AutoLoad(); |
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
75 |
|
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
76 |
private: |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
77 |
// A map of all the blobs |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
78 |
std::map<std::vector<uint8_t>, Blob*> m_mapBlobIDToBlob; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
79 |
|
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
80 |
// PLC object library handle |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
81 |
void * m_handle; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
82 |
|
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
83 |
// Shared object mutex |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
84 |
std::mutex m_PLClibMutex; |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
85 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
86 |
// Symbols resolved from the PLC object |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
87 |
PLCSyms m_PLCSyms; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
88 |
|
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
89 |
// argc and argv for the PLC object |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
90 |
int m_argc; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
91 |
char ** m_argv; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
92 |
|
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
93 |
// PLC status |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
94 |
PLCstatus m_status; |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
95 |
|
3949
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
96 |
// PSK |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
97 |
std::string m_PSK_ID; |
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
98 |
std::string m_PSK_secret; |
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
99 |
|
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
100 |
// Debug token, used for consistency check of traces |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
101 |
uint32_t m_debugToken; |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
102 |
|
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
103 |
// Trace thread |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
104 |
std::thread m_traceThread; |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
105 |
|
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
106 |
// Trace thread mutex |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
107 |
std::mutex m_tracesMutex; |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
108 |
|
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
109 |
// Trace double buffer |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
110 |
std::vector<trace_sample> m_traces; |
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
111 |
|
3940
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
112 |
uint32_t BlobAsFile(const binary_t * BlobID, std::filesystem::path filename); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
113 |
uint32_t LoadPLC(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
114 |
uint32_t UnLoadPLC(void); |
934bd46a7500
C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3937
diff
changeset
|
115 |
uint32_t LogMessage(uint8_t level, std::string message); |
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
116 |
uint32_t PurgePLC(void); |
3949
f64dce4e2f62
C runtime: initial fixes. Now runs and traces first_steps example.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3945
diff
changeset
|
117 |
void PurgeTraceBuffer(void); |
3945
d303aab8f68b
C++ runtime: WIP. Continue PLCObject implementation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3940
diff
changeset
|
118 |
void TraceThreadProc(void); |
3937
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
119 |
}; |
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
120 |
|
e13543d716b6
C++ runtime: add eRPC server, minimal CLI and Makefile. WIP.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
121 |
#endif |