mercredi 3 février 2016

Conversion to 6 bit NMEA ASCII

G'day.

I'm trying to convert 8 bit ASCII to NMEA 0183 6 bit to decode AIS messages. To do this you subtract 48 from the 8 bit value and if the value is still greater than 40 subtract 8. Here's as far as I can get;

for (int i = 0; i < j; I++)
       {
       int a = myvector[i];
       int b = a - 48;
       myvector.push_back(b);
       }

All attempts I make to subtract 8 from the required values don't work.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire