fsfw/rmap/RmapDeviceCommunicationIF.cpp

48 lines
1.4 KiB
C++
Raw Normal View History

2018-07-13 18:28:26 +02:00
#include <framework/rmap/RmapDeviceCommunicationIF.h>
#include <framework/rmap/RMAP.h>
//TODO Cast here are all potential bugs
RmapDeviceCommunicationIF::~RmapDeviceCommunicationIF() {
}
2020-04-18 14:10:38 +02:00
ReturnValue_t RmapDeviceCommunicationIF::sendMessage(CookieIF* cookie,
2018-07-13 18:28:26 +02:00
uint8_t* data, uint32_t len) {
return RMAP::sendWriteCommand((RMAPCookie *) cookie, data, len);
}
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-04-18 14:10:38 +02:00
CookieIF* cookie) {
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,
2018-07-13 18:28:26 +02:00
uint8_t** buffer, uint32_t* size) {
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;
}