fsfw/rmap/RmapDeviceCommunicationIF.cpp

48 lines
1.4 KiB
C++
Raw Permalink Normal View History

2020-08-13 20:53:35 +02:00
#include "RmapDeviceCommunicationIF.h"
#include "RMAP.h"
2018-07-13 18:28:26 +02:00
//TODO Cast here are all potential bugs
RmapDeviceCommunicationIF::~RmapDeviceCommunicationIF() {
}
2020-12-13 22:12:57 +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
}
2020-04-18 14:10:38 +02:00
ReturnValue_t RmapDeviceCommunicationIF::getSendSuccess(CookieIF* cookie) {
2018-07-13 18:28:26 +02:00
return RMAP::getWriteReply((RMAPCookie *) cookie);
}
ReturnValue_t RmapDeviceCommunicationIF::requestReceiveMessage(
2020-12-13 22:12:57 +01:00
CookieIF *cookie, size_t requestLen) {
2018-07-13 18:28:26 +02:00
return RMAP::sendReadCommand((RMAPCookie *) cookie,
((RMAPCookie *) cookie)->getMaxReplyLen());
}
2020-04-18 14:10:38 +02:00
ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(CookieIF* cookie,
2020-12-13 22:12:57 +01:00
uint8_t** buffer, size_t * size) {
2018-07-13 18:28:26 +02:00
return RMAP::getReadReply((RMAPCookie *) cookie, buffer, size);
}
2020-04-18 14:10:38 +02:00
ReturnValue_t RmapDeviceCommunicationIF::setAddress(CookieIF* cookie,
2018-07-13 18:28:26 +02:00
uint32_t address) {
((RMAPCookie *) cookie)->setAddress(address);
return HasReturnvaluesIF::RETURN_OK;
}
2020-04-18 14:10:38 +02:00
uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF* cookie) {
2018-07-13 18:28:26 +02:00
return ((RMAPCookie *) cookie)->getAddress();
}
2020-04-18 14:10:38 +02:00
ReturnValue_t RmapDeviceCommunicationIF::setParameter(CookieIF* cookie,
2018-07-13 18:28:26 +02:00
uint32_t parameter) {
//TODO Empty?
return HasReturnvaluesIF::RETURN_FAILED;
}
2020-04-18 14:10:38 +02:00
uint32_t RmapDeviceCommunicationIF::getParameter(CookieIF* cookie) {
2018-07-13 18:28:26 +02:00
return 0;
}