firmata/arduino — pull request #157 by soundanalogous (2014-10-26 02:50:57+00:00)
Title: force digital or analog message when enabling digital port or analog pin reporting

This change reports the digital port value upon the client enabling a digital port and it reports the analog pin value upon the client enabling that analog pin for reporting. This is a feature that has been requested to better support non-serial based connections such as ethernet, wi-fi and bluetooth where it's possible the connection may be broken and reestablished. If a client library reenables analog pins and digital pins upon reestablishing a connection, then with this change the respective values will be reported so the client is updated with the current state of the pins. Care may be needed in the client library however to ensure that there are no false triggers due to the reported port and pin values.

This feature has been used in ConfigurableFirmata for almost a year with no issues reported.