fsfw/src/fsfw/rmap/RmapDeviceCommunicationIF.cpp

42 lines
1.5 KiB
C++
Raw Permalink Normal View History

2021-07-13 20:58:45 +02:00
#include "fsfw/rmap/RmapDeviceCommunicationIF.h"
2022-02-02 10:29:30 +01:00
2021-07-13 20:58:45 +02:00
#include "fsfw/rmap/RMAP.h"
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
// TODO Cast here are all potential bugs
RmapDeviceCommunicationIF::~RmapDeviceCommunicationIF() {}
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::sendMessage(CookieIF *cookie, const uint8_t *sendData,
size_t sendLen) {
return RMAP::sendWriteCommand((RMAPCookie *)cookie, sendData, sendLen);
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::getSendSuccess(CookieIF *cookie) {
return RMAP::getWriteReply((RMAPCookie *)cookie);
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::requestReceiveMessage(CookieIF *cookie,
size_t requestLen) {
return RMAP::sendReadCommand((RMAPCookie *)cookie, ((RMAPCookie *)cookie)->getMaxReplyLen());
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
size_t *size) {
return RMAP::getReadReply((RMAPCookie *)cookie, buffer, size);
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::setAddress(CookieIF *cookie, uint32_t address) {
((RMAPCookie *)cookie)->setAddress(address);
2022-08-16 01:08:26 +02:00
return returnvalue::OK;
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF *cookie) {
return ((RMAPCookie *)cookie)->getAddress();
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
ReturnValue_t RmapDeviceCommunicationIF::setParameter(CookieIF *cookie, uint32_t parameter) {
// TODO Empty?
2022-08-16 01:08:26 +02:00
return returnvalue::FAILED;
2018-07-13 18:28:26 +02:00
}
2022-02-02 10:29:30 +01:00
uint32_t RmapDeviceCommunicationIF::getParameter(CookieIF *cookie) { return 0; }