we could read the kernel data and make a json file

This commit is contained in:
2024-06-25 20:46:54 +02:00
parent 8d2fee2406
commit bd3078bdef
30 changed files with 536 additions and 4603 deletions

View File

@@ -0,0 +1,32 @@
#include <string>
#include <list>
#include <iostream>
#include <thread>
#include <ecal/ecal.h>
#include "RTSMonitoringTask.h"
class RTCreateMonitoring
{
private:
/* data */
std::shared_ptr<RTSMonitoringTask> rtsMonTask;
public:
RTCreateMonitoring(std::shared_ptr<RTSMonitoringTask> rtsMonTask) {
this->rtsMonTask = rtsMonTask;
}
int operator()(const std::string& method_, const std::string& req_type_, const std::string& resp_type_ , const std::string& request_, std::string& response_) {
//make data from json
bool res = true; //this->rtsMonTask.CreateMonitoring(id, name, samplerate, sampleperiod, downtime, status);
return res ? 0 : -1;
}
};

View File

@@ -30,8 +30,8 @@ public:
private:
int Copro_getFwPath(char* pathStr);
int Copro_setFwPath(char* pathStr);
int Copro_setFwPath(const char* pathStr);
int Copro_getFwName(char* pathStr);
int Copro_setFwName(char* nameStr);
int Copro_setFwName(const char* nameStr);
};

View File

@@ -9,7 +9,8 @@ class RTSMonFrame
{
private:
/* data */
std::string id;
int id;
std::string name;
int samplerate;
int sampleperiod;
int downtime;
@@ -17,14 +18,14 @@ private:
public:
RTSMonFrame(std::string id, int samplerate, int sampleperiod, int downtime) {
RTSMonFrame(int id, std::string name, int samplerate, int sampleperiod, int downtime) {
this->id = id;
this->samplerate = samplerate;
this->sampleperiod = sampleperiod;
this->downtime = downtime;
}
RTSMonFrame(std::string id) {
RTSMonFrame(int id) {
this->id = id;
}
@@ -37,10 +38,13 @@ public:
void Add(std::string item){
this->items.push_back(item);
}
std::string GetId() {
int GetId() {
return this->id;
}
std::string GetName() {
return name;
}
int GetSampleRate() {
return this->samplerate;
}

View File

@@ -19,7 +19,7 @@ private:
int mFdRpmsg[2] = {-1, -1};
RTSCoproHelper coproHelper;
std::map<std::string, RTSMonFrame*> rtsMonFrames;
std::map<int, RTSMonFrame*> rtsMonFrames;
pthread_t monThread;
@@ -30,12 +30,13 @@ public:
//static RTSMonitoringTask& Instance();
bool Init();
bool CreateMonitoring(std::string id, int samplerate, int sampleperiod, int downtime, std::string status);
bool CreateMonitoring(int id, std::string name, int samplerate, int sampleperiod, int downtime, std::string status);
bool LoadFW();
bool Start();
bool Stop();
private:
static void* Run(void *obj);
bool Load();
};

View File

@@ -1,39 +0,0 @@
/*
*/
#include "../../include/RTSCoproHelper.h"
class RTSMonitoringTask
{
public:
typedef enum RTSMonitoringTaskState {
OFF= 0,
LOADED = 1,
READY = 2,
};
private:
/* data */
//lock Element
/* The file descriptor used to manage our TTY over RPMSG */
int mFdRpmsg[2] = {-1, -1};
RTSCoproHelper coproHelper;
RTSMonitoringTaskState rtsState=RTSMonitoringTaskState::OFF;
public:
RTSMonitoringTask(/* args */);
~RTSMonitoringTask();
bool Init();
bool LoadFW();
bool Start();
bool Stop();
private:
};