module Message:Read and write messages from the 10 message queues. This can be thought as advanced direct commands.sig..end
Interesting information concerning this can be found in Sivan
Toledo's paper:
Analysis
of the NXT Bluetooth-Communication Protocol.
typemailbox =[ `B0 | `B1 | `B2 | `B3 | `B4 | `B5 | `B6 | `B7 | `B8 | `B9 ]
typeremote =[ `R0 | `R1 | `R2 | `R3 | `R4 | `R5 | `R6 | `R7 | `R8 | `R9 ]
val write : ?check_status:bool ->
'a Mindstorm.conn -> mailbox -> string -> unitwrite conn box msg writes the message msg to the inbox
box on the NXT. This is used to send messages to a
currently running program.check_status : whether to request a status code from the
brick. If true (the default for this fonction), the NXT
only send a reply when it is able to queue the message without
overflowing the queue (this prevent message loss). If
false, the message may delete the oldest message in the NXT
queue if it is full (the NXT queues are 5 messages long).val read : 'a Mindstorm.conn ->
?remove:bool ->
[ `B0
| `B1
| `B2
| `B3
| `B4
| `B5
| `B6
| `B7
| `B8
| `B9
| `R0
| `R1
| `R2
| `R3
| `R4
| `R5
| `R6
| `R7
| `R8
| `R9 ] -> stringread conn box returns the message from the inbox box on
the NXT.remove : if true, clears the message from the remote inbox.
Default: false.