Open troywweber7 opened 8 years ago
There is no way to do this because StandardFirmata running on the Arduino does not implement an RPC protocol. Many commands are only one direction.
Also there is a proposal to add the ability to query the sampling interval: https://github.com/firmata/protocol/pull/34.
I have poured over the
firmata.js
file extensively. For some of the functions available on a board there is a callback that ensures the data has been sent because a response comes in. For other functions, you just send it and hope it happens. What is the preferred way to ensure a function likeboard.setSamplingInterval
has actually completed? There is no callback function or response from the Arduino Board associated with this function.My thought for how to resolve this: maybe I should call a dummy
queryPinState
function right after and use its callback? Or maybe usingboard.transport.drain
will ensure that whatever I just queued up will be sent before I proceed?