diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Real-Time Systems/RTS_P6/A1/src | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Master/Real-Time Systems/RTS_P6/A1/src')
5 files changed, 126 insertions, 0 deletions
diff --git a/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.cpp b/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.cpp new file mode 100644 index 0000000..7bfcd99 --- /dev/null +++ b/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.cpp @@ -0,0 +1,24 @@ +/* + * CanAnalyzer.cpp + * + * Created on: 18.01.2011 + * Author: istsveise + */ + +#include "CanAnalyzer.h" +#include <math.h> + +CanAnalyzer::CanAnalyzer() { + // TODO Auto-generated constructor stub + +} + +CanAnalyzer::~CanAnalyzer() { + // TODO Auto-generated destructor stub +} +int CanAnalyzer::getMaxTransmissionTimeUsec(CanMessage& m) +{ + int tau = 1; // 1 mircosecond bit time + int transTimeUsec = (floor((34+8*m.byteCount)/5)+47+8*m.byteCount)*tau; + return transTimeUsec; +} diff --git a/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.h b/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.h new file mode 100644 index 0000000..1012bb3 --- /dev/null +++ b/Master/Real-Time Systems/RTS_P6/A1/src/CanAnalyzer.h @@ -0,0 +1,23 @@ +/* + * CanAnalyzer.h + * + * Created on: 18.01.2011 + * Author: istsveise + */ + +#ifndef CANANALYZER_H_ +#define CANANALYZER_H_ + +#include "CanMessage.h" +#include <vector> + +using namespace std; + +class CanAnalyzer { +public: + CanAnalyzer(); + virtual ~CanAnalyzer(); + static int getMaxTransmissionTimeUsec(CanMessage&); +}; + +#endif /* CANANALYZER_H_ */ diff --git a/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.cpp b/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.cpp new file mode 100644 index 0000000..c6bad99 --- /dev/null +++ b/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.cpp @@ -0,0 +1,36 @@ +/* + * CanMessage.cpp + * + * Created on: 18.01.2011 + * Author: istsveise + */ + +#include "CanMessage.h" + +CanMessage::CanMessage() { + // TODO Auto-generated constructor stub + +} + +CanMessage::~CanMessage() { + // TODO Auto-generated destructor stub +} +CanMessage::CanMessage(int pri, int per, int jit, int byteCnt, string& descr) +:prio(pri),period(per),jitter(jit),byteCount(byteCnt),desc(descr) +{ + +} +bool CanMessage::operator =(const CanMessage& rhs) +{ + this->prio = rhs.prio; + this->period = rhs.period; + this->jitter = rhs.jitter; + this->byteCount = rhs.byteCount; + this->desc = rhs.desc; + return *this; +} + +CanMessage& CanMessage::operator ==(const CanMessage& rhs) +{ + return (this->prio == rhs.prio) && (this->period == rhs.period) && (this->jitter == rhs.jitter) && (this->byteCount == rhs.byteCount) && (this->desc == rhs.desc); +} diff --git a/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.h b/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.h new file mode 100644 index 0000000..1a8066c --- /dev/null +++ b/Master/Real-Time Systems/RTS_P6/A1/src/CanMessage.h @@ -0,0 +1,30 @@ +/* + * CanMessage.h + * + * Created on: 18.01.2011 + * Author: istsveise + */ + +#ifndef CANMESSAGE_H_ +#define CANMESSAGE_H_ + +#include <string> + +using namespace std; + +class CanMessage { +public: + CanMessage(); + CanMessage(int,int,int,int,string&); + virtual ~CanMessage(); + bool operator==(const CanMessage&); + CanMessage& operator=(const CanMessage&); + + int prio; + int period; + int jitter; + int byteCount; + string desc; +}; + +#endif /* CANMESSAGE_H_ */ diff --git a/Master/Real-Time Systems/RTS_P6/A1/src/main.cpp b/Master/Real-Time Systems/RTS_P6/A1/src/main.cpp new file mode 100644 index 0000000..a8f1c00 --- /dev/null +++ b/Master/Real-Time Systems/RTS_P6/A1/src/main.cpp @@ -0,0 +1,13 @@ +/* + * main.cpp + * + * Created on: 18.01.2011 + * Author: istsveise + */ + +#include <stdlib.h> + +int main(int argc, char* argv[]) +{ + return EXIT_SUCCESS; +} |
