2323 #include < string.h>
2424#endif
2525
26+ #include " FirmataConstants.h"
27+
2628// ******************************************************************************
2729// * Support Functions
2830// ******************************************************************************
3234 * @param value The 16-bit value to be split and written separately.
3335 */
3436void FirmataMarshaller::sendValueAsTwo7bitBytes (uint16_t value)
37+ const
3538{
3639 FirmataStream->write (value & 0x7F ); // LSB
3740 FirmataStream->write (value >> 7 & 0x7F ); // MSB
@@ -87,6 +90,7 @@ void FirmataMarshaller::end(void)
8790 * The maximum value is 14-bits (16384).
8891 */
8992void FirmataMarshaller::sendAnalog (uint8_t pin, uint16_t value)
93+ const
9094{
9195 if ( (Stream *)NULL == FirmataStream ) { return ; }
9296 // pin can only be 0-15, so chop higher bits
@@ -101,6 +105,7 @@ void FirmataMarshaller::sendAnalog(uint8_t pin, uint16_t value)
101105 * @param value The value of the pin.
102106 */
103107void FirmataMarshaller::sendDigital (uint8_t pin, uint16_t value)
108+ const
104109{
105110 /* TODO add single pin digital messages to the protocol, this needs to
106111 * track the last digital data sent so that it can be sure to change just
@@ -129,6 +134,7 @@ void FirmataMarshaller::sendDigital(uint8_t pin, uint16_t value)
129134 * @param portData The value of the port. The value of each pin in the port is represented by a bit.
130135 */
131136void FirmataMarshaller::sendDigitalPort (uint8_t portNumber, uint16_t portData)
137+ const
132138{
133139 if ( (Stream *)NULL == FirmataStream ) { return ; }
134140 FirmataStream->write (DIGITAL_MESSAGE | (portNumber & 0xF ));
@@ -144,6 +150,7 @@ void FirmataMarshaller::sendDigitalPort(uint8_t portNumber, uint16_t portData)
144150 * @param bytev A pointer to the array of data bytes to send in the message.
145151 */
146152void FirmataMarshaller::sendSysex (uint8_t command, size_t bytec, uint8_t *bytev)
153+ const
147154{
148155 if ( (Stream *)NULL == FirmataStream ) { return ; }
149156 size_t i;
@@ -160,6 +167,7 @@ void FirmataMarshaller::sendSysex(uint8_t command, size_t bytec, uint8_t *bytev)
160167 * @param string A pointer to the char string
161168 */
162169void FirmataMarshaller::sendString (const char *string)
170+ const
163171{
164172 sendSysex (STRING_DATA, strlen (string), (uint8_t *)string);
165173}
0 commit comments