aboutsummaryrefslogtreecommitdiff
path: root/applications/message_process/include/message_process.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'applications/message_process/include/message_process.hpp')
-rw-r--r--applications/message_process/include/message_process.hpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/applications/message_process/include/message_process.hpp b/applications/message_process/include/message_process.hpp
index 96da30e..62788b8 100644
--- a/applications/message_process/include/message_process.hpp
+++ b/applications/message_process/include/message_process.hpp
@@ -53,28 +53,18 @@ public:
bool empty() const;
size_t available() const;
size_t capacity() const;
+ void reset();
bool read(uint8_t *dst, uint32_t length);
bool write(const Vec *vec, size_t length);
bool write(const uint32_t type, const void *src = nullptr, uint32_t length = 0);
- bool skip(uint32_t length);
-
- template <typename T>
- bool read(T &dst) {
- return read(reinterpret_cast<uint8_t *>(&dst), sizeof(dst));
- }
-
template <typename T>
- bool readOrSkip(T &dst, uint32_t expectedLength) {
- if (expectedLength == sizeof(dst)) {
- return read(reinterpret_cast<uint8_t *>(&dst), sizeof(dst));
- } else {
- return skip(expectedLength);
- }
+ bool write(const uint32_t type, const T &src) {
+ return write(type, reinterpret_cast<const void *>(&src), sizeof(src));
}
template <typename T>
- bool write(const uint32_t type, const T &src) {
- return write(type, reinterpret_cast<const void *>(&src), sizeof(src));
+ bool read(T &dst) {
+ return read(reinterpret_cast<uint8_t *>(&dst), sizeof(dst));
}
private:
@@ -96,6 +86,8 @@ public:
void run();
bool handleMessage();
void sendPong();
+ void sndErrorRspAndResetQueue(ethosu_core_msg_err_type type, const char *message);
+ void sendVersionRsp();
void sendInferenceRsp(uint64_t userArg,
std::vector<InferenceProcess::DataPtr> &ofm,
bool failed,