3 Copyright (c) 2006-2008 Hans-Christoph Steiner. All rights reserved.
4 Copyright (C) 2009-2016 Jeff Hoefs. All rights reserved.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 See file LICENSE.txt for further informations on licensing terms.
14 #ifndef FirmataMarshaller_h
15 #define FirmataMarshaller_h
17 #if defined(__cplusplus) && !defined(ARDUINO)
29 class FirmataMarshaller
31 friend class FirmataClass;
38 void begin(Stream &s);
41 /* serial send handling */
42 void queryFirmwareVersion(void) const;
43 void queryVersion(void) const;
44 void reportAnalogDisable(uint8_t pin) const;
45 void reportAnalogEnable(uint8_t pin) const;
46 void reportDigitalPortDisable(uint8_t portNumber) const;
47 void reportDigitalPortEnable(uint8_t portNumber) const;
48 void sendAnalog(uint8_t pin, uint16_t value) const;
49 void sendAnalogMappingQuery(void) const;
50 void sendCapabilityQuery(void) const;
51 void sendDigital(uint8_t pin, uint8_t value) const;
52 void sendDigitalPort(uint8_t portNumber, uint16_t portData) const;
53 void sendFirmwareVersion(uint8_t major, uint8_t minor, size_t bytec, uint8_t *bytev) const;
54 void sendVersion(uint8_t major, uint8_t minor) const;
55 void sendPinMode(uint8_t pin, uint8_t config) const;
56 void sendPinStateQuery(uint8_t pin) const;
57 void sendString(const char *string) const;
58 void sendSysex(uint8_t command, size_t bytec, uint8_t *bytev) const;
59 void setSamplingInterval(uint16_t interval_ms) const;
60 void systemReset(void) const;
64 void reportAnalog(uint8_t pin, bool stream_enable) const;
65 void reportDigitalPort(uint8_t portNumber, bool stream_enable) const;
66 void sendExtendedAnalog(uint8_t pin, size_t bytec, uint8_t * bytev) const;
67 void encodeByteStream (size_t bytec, uint8_t * bytev, size_t max_bytes = 0) const;
69 Stream * FirmataStream;
72 } // namespace firmata
74 #endif /* FirmataMarshaller_h */