Hello Rich,
sorry for the delay. I've tested this with DashBoard 9.6.1 and seems to be working fine.
Here is a small example of a custom panel which communicates with a simple server I had running locally.
Each button would send a different integer value to the server.
You can see that the `sendAsBytesWithResponse` takes the provided value and a terminator; '0A' in this case.
The server receives the integer value and then returns a series of bytes followed by a 0x0A.
DashBoard then invokes the callback function where `result` is the data received from the server.
<abs contexttype="opengear" id="_top" keepalive="false">
<meta>
<api immediate="true">function callback(success, sentData, result, exception)
{
var resultString = result.map(String);
ogscript.debug('Got success: ' + success + ', sentData: ' + sentData + ', result: ' + resultString + ', exception: ' + exception);
}
function sendInt(value)
{
rosstalk.sendAsBytesWithResponse('127.0.0.1', 4442, value, '0A', callback);
}</api>
</meta>
<button buttontype="push" height="108" left="21" name="Send 0" top="20" width="107">
<task tasktype="ogscript">sendInt(0);</task>
</button>
<button buttontype="push" height="104" left="21" name="Send 1" top="141" width="103">
<task tasktype="ogscript">sendInt(1);</task>
</button>
<button buttontype="push" height="94" left="150" name="Send 2" top="148" width="103">
<task tasktype="ogscript">sendInt(2);</task>
</button>
</abs>
Hope this helps. Best regards,
------------------------------
Marc-André Parent
Ross Video
------------------------------