Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StdInOutStream.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #ifndef StdInOutStream_h
  20. #define StdInOutStream_h
  21. #include <stdlib.h>
  22. #include <stdio.h>
  23. #include <string.h>
  24. #include "Stream.h"
  25. /**
  26. * @brief A class that prints to stdout and reads from stdin
  27. */
  28. class StdInOutStream : public Stream
  29. {
  30. public:
  31. /**
  32. * @brief This function does nothing.
  33. *
  34. * @param baud Ignored parameter.
  35. */
  36. void begin(int baud);
  37. /**
  38. * @brief This function does nothing.
  39. *
  40. * @return always returns 1.
  41. */
  42. int available();
  43. /**
  44. * @brief Reads 1 key pressed from the keyboard.
  45. *
  46. * @return key character pressed cast to an int.
  47. */
  48. int read();
  49. /**
  50. * @brief Writes a single byte to stdout.
  51. *
  52. * @param b byte to write.
  53. * @return -1 if error else, number of bytes written.
  54. */
  55. size_t write(uint8_t b);
  56. /**
  57. * @brief Not supported.
  58. *
  59. * @return always returns -1.
  60. */
  61. int peek();
  62. /**
  63. * @brief Flush stdout.
  64. */
  65. void flush();
  66. /**
  67. * @brief Nothing to do, flush stdout.
  68. */
  69. void end();
  70. };
  71. #endif