My setup is a 4d systems screen and a spi connection to the arduino.
Ok, Arduino uses SPI to talk to the 4D Systems display shield...
Arduino hardware serial is in use by a bluetooth adapter and all works well.
Ok...
Any Serial read on the arduino messes things up.
Whut? You just said all works well.
The 4d systems screen receives the GPS data on a hardware serial port and does that job very well without any impact on the screen. I then send and receive an SPI packet where the GPS data is transferred to the arduino as byte arrays.
...and this makes no sense to me. You send and receive an SPI packet? The screen receives the GPS data without any impact on the screen?
If I could pass the whole byte array to the parser as ublox binary...
I do not understand the description of your system, so I'll give you an answer to a question you probably did not ask:
If you have the entire message in a byte array, including the SYNC bytes, you should verify the checksum. It's just the Fletcher checksum over everything except the first two bytes (SYNC 1 and 2) and the last two bytes (CS A and B). If that passes, you can simply "map" the buffer onto a struct you define that matches the UBX message:
ubxMgaGPSephMessageStruct *mgaGPSeph = &buffer[2];
if (mgaGPSeph->uraIndex == 7) ...
If you don't have the SYNC bytes, map it starting at 0:
ubxMgaGPSephMessageStruct *mgaGPSeph = &buffer[0]; // no SYNC bytes at the beginning
if (mgaGPSeph->uraIndex == 7) ...
If the message is one of the messages supported by NeoGPS (NAV POSLLH, NAV VELNED, NAV STATUS, NAV TIMEGPS, NAV TIMEUTC or NAV SVINFO), you can use ubxGPS.h to get the message structure definitions:
#include "ubxGPS.h"
.
:
ublox::nav_posllh_t *posllh = &buffer[2]; // map the bytes onto a struct
// just access the posllh structure members
display.print( posllh->lat ); // integer latitude * 10000000
display.print( posllh->lon ); // integer longitude * 10000000
There is no parsing required if you already have all the bytes. Just map it onto C data types in a struct. ubxGPS.h is a C++ way to declare the struct so that it matches the ublox message spec.
Did that help?
Cheers,
/dev