Posted 26 February 2012 - 08:40 AM
Modems don't seem to be able to send strings containing arbitrary binary data and have it arrive intact. Assume that on one computer, number 14, I run the following:
I then go to a second computer, number 13, and run the following:
On computer 14, I get the following output:
To which I say, what the heck? It seems that every byte from 0 to 127 works fine, but those above do not. Since binary data is easier to work with programmatically than text data, it would be nice if modems provided a binary-safe transmission medium.
rednet.open("top")
sender, message = rednet.receive()
rednet.close("top")
print("sender=", sender)
print("len=", message:len())
for i = 1, message:len() do
print("message[", i, "] = ", message:byte(i))
end
I then go to a second computer, number 13, and run the following:
rednet.open("top")
rednet.send(14, string.char(135))
rednet.close("top")
On computer 14, I get the following output:
sender=13
len=3
message[1] = 239
message[2] = 190
message[3] = 135
To which I say, what the heck? It seems that every byte from 0 to 127 works fine, but those above do not. Since binary data is easier to work with programmatically than text data, it would be nice if modems provided a binary-safe transmission medium.