#include "BpxDummy.h"

#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>

BpxDummy::BpxDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
    : DeviceHandlerBase(objectId, comif, comCookie) {}

BpxDummy::~BpxDummy() {}

void BpxDummy::doStartUp() {}

void BpxDummy::doShutDown() {}

ReturnValue_t BpxDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }

ReturnValue_t BpxDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
  return NOTHING_TO_SEND;
}

ReturnValue_t BpxDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
                                                const uint8_t *commandData, size_t commandDataLen) {
  return RETURN_OK;
}

ReturnValue_t BpxDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
                                     size_t *foundLen) {
  return RETURN_OK;
}

ReturnValue_t BpxDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
  return RETURN_OK;
}

void BpxDummy::fillCommandAndReplyMap() {}

uint32_t BpxDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }

ReturnValue_t BpxDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
                                                LocalDataPoolManager &poolManager) {
  localDataPoolMap.emplace(BpxBattery::BATT_TEMP_1, &battTemp1);
  localDataPoolMap.emplace(BpxBattery::BATT_TEMP_2, &battTemp2);
  localDataPoolMap.emplace(BpxBattery::BATT_TEMP_3, &battTemp3);
  localDataPoolMap.emplace(BpxBattery::BATT_TEMP_4, &battTemp4);
  localDataPoolMap.emplace(BpxBattery::CHARGE_CURRENT, &chargeCurrent);
  localDataPoolMap.emplace(BpxBattery::DISCHARGE_CURRENT, &dischargeCurrent);
  localDataPoolMap.emplace(BpxBattery::HEATER_CURRENT, &heaterCurrent);
  localDataPoolMap.emplace(BpxBattery::BATT_VOLTAGE, &battVolt);
  localDataPoolMap.emplace(BpxBattery::REBOOT_COUNTER, &rebootCounter);
  localDataPoolMap.emplace(BpxBattery::BOOTCAUSE, &bootCause);

  localDataPoolMap.emplace(BpxBattery::BATTERY_HEATER_MODE, &battheatMode);
  localDataPoolMap.emplace(BpxBattery::BATTHEAT_LOW_LIMIT, &battheatLow);
  localDataPoolMap.emplace(BpxBattery::BATTHEAT_HIGH_LIMIT, &battheatHigh);
  return HasReturnvaluesIF::RETURN_OK;
}