Best method to check RS485 serial 5 byte packet to see if one byte changed?

I have a pair of wireless Arduinos (Moteino) . One of them, battery operated, does a lot of processing:

  1. receives (wireless serial) sensor selection commands;
  2. sends (wireless serial) sensor data packets
  3. send and receive via RS485 on a long twisted, a 5 byte data packet from a proprietary microcontroller by half-duplex. I am using a MAX485 chip with the Arduino softserial library.

I would like to optimize the RS485 routines. The proprietary u-controller sends and receives a fixed sequence of 5 Hex bytes (0x02, 0x88, 0x31, 0x00, 0x04). All bytes remain exactly the same except for the 4th Hex byte sequence which can take on 4 different values (0x00 or 0x04 or 0x06 or 0x08) which represents different states of the device (motor controller).

What would be the fastest execution technique to read or peek at the 5 bytes to see if the 4th byte has changed? The simplest but requiring the most execution time overhead I thought would be to read in the serial data, check that the initial 3 bytes are in correct sequence (0x02, 0x88, 0x31...) and then read the 4th byte which carries the info I need. Are there any faster methods that could be used?


Are there any faster methods that could be used?

Reading a byte copies a value, if there is one, from a buffer. It is NOT a slow operation. Storing the value in another array is also very fast.

It is nearly impossible to think of a faster scheme, since ultimately you need to read the data anyway.