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-01 12:41:54 +02: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-01 12:41:54 +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-01 12:41:54 +02:00
|
|
|
CookieIF *cookie, size_t requestLen) {
|
2018-07-13 18:28:26 +02:00
|
|
|
return RMAP::sendReadCommand((RMAPCookie *) cookie,
|
|
|
|
((RMAPCookie *) cookie)->getMaxReplyLen());
|
|
|
|
}
|
|
|
|
|
2020-04-01 12:41:54 +02:00
|
|
|
ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(CookieIF* cookie,
|
|
|
|
uint8_t** buffer, size_t * size) {
|
2018-07-13 18:28:26 +02:00
|
|
|
return RMAP::getReadReply((RMAPCookie *) cookie, buffer, size);
|
|
|
|
}
|
|
|
|
|
2020-04-01 12:41:54 +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-01 12:41:54 +02:00
|
|
|
uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF* cookie) {
|
2018-07-13 18:28:26 +02:00
|
|
|
return ((RMAPCookie *) cookie)->getAddress();
|
|
|
|
}
|
|
|
|
|
2020-04-01 12:41:54 +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-01 12:41:54 +02:00
|
|
|
uint32_t RmapDeviceCommunicationIF::getParameter(CookieIF* cookie) {
|
2018-07-13 18:28:26 +02:00
|
|
|
return 0;
|
|
|
|
}
|