Does the OutputPort class work correctly with blobs? I can’t seem to get anything to transfer.
With the following code and ‘12345’ in the blob i get the following at the other end of an http request (JSON)
body{ “channel”: 1, “target”: “30ba9435da0aa736” } (no blob at all)
and
body{ “channel”: 1, “target”: “30ba9435da0aa736”, “value”: “12345” } (blob converted to string before ‘set’)
`class impeeOut extends OutputPort
{
name = “UART In”;
type = “string”;
function set(s)
{
log("impeeOut",s);
base.set(s); // send the blob
imp.sleep(0.1);
local out = "";
s.seek(0);
while(!s.eos())
{
out += s.readn('b').tochar(); //convert the blob to string (painful, must be a better way)
}
base.set(out); // send the string
}
}`