|
On Mon, December 5, 2005 8:58 am, Elizabeth Mabrey wrote:
> Hi
>
> In order to avoid unwanted interruption, such as remote shutdown, from other
> RCX during execution time, I wonder if the only thing can be done to
> safe-guard my RCX will be having an independent task dedicated to receive
> message (mail). This, of course, might be quite time consuming to the RCX.
> I wonder if there is anyone out there using the same hacking method and
> observe any negative impact to the actual working task. Or, the negative
> impact may be negligible. Or, perhaps there is better and smarter way to do
> this.
If you have an event waiting for a message, I doubt it will have much impact on the
speed of the rest of the program.
However, this will not catch the messages you're looking for. You can't use the
"mail" function to receive op-code, such as power off.
A real quick intro to op-codes: (I don't have all the exact numbers, so this may not
be 100% correct, and this is really not that quick...)
When you send an op-code to the standard firmware, it should be of the format:
0x55,0xff,0x00,
[command],[command_complement],
[optional_argument],[optional_argument_complement],
[check-sum],[check-sum_complement]
The first three numbers (the header) tell the RCX the following message is something
it should listen to (an op-code)
The next two are the command, and the complement of the command. The command is a
number, usually written in hex, like 0x60 or as a decimal, like 96. The complement
is FF (or 255 dec) minus the command. The RCX uses this value to make sure the data
is valid.
After the command, there may be arguments, and their complements.
Finally, is the check-sum (sum of command and arguments) and the complement of that
sum.
Clear as mud? :)
So, if you send a message (mail) value of "3", the complete message that's sent via
IR would be something like:
0x55, 0xff, 0x00, (header)
0xf7 (command to send message), 0x08 (complement),
0x03 (message to send), 0xfc (complement),
0xfa (checksum), 0x05 (complement)
If you want to send a power off command:
0x55, 0xff, 0x00, (header)
0x60 (command to power off), 0x9f (complement),
0x60 (checksum), 0x9f (complement)
The robolab mailbox will only receive the 'f7' command, which tells it to store the
argument in the mailbox.
With BrickOS, you can change the message handler, so your program can receive all
messages (op-codes). But it's not as clear and easy as using Robolab.
You should build a wall in front of your IR window. :)
Steve
|
|
Message has 1 Reply: | | RE: avoid messaging
|
| Yes, I indeed have an attachment which will act like blockage, but not a full one though. Sounds like this is the fastest and easiest to do. I fully understand the opcodes concept, as I myself wrote compile code before. However, these kids age only (...) (19 years ago, 5-Dec-05, to lugnet.robotics.rcx.robolab, lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | avoid messaging
|
| Hi In order to avoid unwanted interruption, such as remote shutdown, from other RCX during execution time, I wonder if the only thing can be done to safe-guard my RCX will be having an independent task dedicated to receive message (mail). This, of (...) (19 years ago, 5-Dec-05, to lugnet.robotics.rcx.robolab, lugnet.robotics.rcx.legos)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|