/* Blinker
   Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
   Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
   a blinkenarea.org project */

#include <iostream>
#include <string>

#include "Device.h"
#include "Io.h"
#include "SerCfg.h"

namespace Blinker {

/**
 * @brief constructor
 * @param[in] path path to device
 */
Device::Device(const std::string &path)
{
  std::cerr << "output to devices (\"" << path
            << "\") is not supported on Windows (yet)" << std::endl;
}

/// destructor
Device::~Device()
{
}

/**
 * @brief set serial port configuration
 * @param[in] serCfg serial port configuration
 * @return if configuration succeeded
 *
 * This function should only be used if device is a serial port.
 */
bool Device::setSerCfg(const SerCfg& serCfg)
{
  (void)serCfg;
  return false; // devices not supported on Windows
}

/**
 * @brief write data to device
 * @param[in] data data to write
 * @param[out] len number of byte written to device
 * @return if some (or zero) data could be written,
 *         i.e. if the device is still operational
 */
bool Device::write(const std::string &data, std::string::size_type &len)
{
  (void)data;
  len = 0;
  return false; // devices not supported on Windows
}

} // namespace Blinker


