=3);
if (finite(o2))
{
/* assign out-of-range values to sentinel values */
if (o2>=61439) O2=0xefff; else if (o2<=-4095) O2=0xf001;
/* encode the oxygen frequency (rounded) */
else O2 = (unsigned int)(o2 + ((o2<0) ? -0.5 : 0.5));
/* express in 16-bit 2's-complement form */
if (O2<0) O2+=0x10000L;
}
return O2;
}
/*------------------------------------------------------------------------*/
/* function to encode pressure as a 2-byte unsigned integer */
/*------------------------------------------------------------------------*/
/**
This function implements the hex-encoding of IEEE-formattted floating
point pressure data into 2-byte signed integers with 2's complement
representation. The encoding formula accounts for the full range of
32-bit IEEE floating point values but only values in the open range:
-3276.7=3);
if (finite(p))
{
/* assign out-of-range values to sentinel values */
if (p>=3276.7) P=0x7fffL; else if (p<=-3276.7) P=0x8001L;
/* encode the pressure as the number of centibars (rounded) */
else P = (long int)(10*(p + ((p<0) ? -0.05 : 0.05)));
/* express in 16-bit 2's-complement form */
if (P<0) P+=0x10000L;
}
return P;
}
/*------------------------------------------------------------------------*/
/* function to encode salinity as a 2-byte unsigned long integer */
/*------------------------------------------------------------------------*/
/**
This function implements the hex-encoding of IEEE-formattted floating
point salinity data into 16-bit unsigned integers with 2's complement
representation. The encoding formula accounts for the full range of
32-bit IEEE floating point values but only values in the open range:
-4.095~~=3);
if (finite(s))
{
/* assign out-of-range values to sentinel values */
if (s>=61.439) S=0xefffL; else if (s<=-4.095) S=0xf001L;
/* encode the salinity as the number of parts-per-ten-million (rounded) */
else S = (long int)(1000*(s + ((s<0) ? -0.0005 : 0.0005)));
/* express in 16-bit 2's-complement form */
if (S<0) S+=0x10000L;
}
return S;
}
/*------------------------------------------------------------------------*/
/* function to encode temperature as a 2-byte unsigned integer */
/*------------------------------------------------------------------------*/
/**
This function implements the hex-encoding of IEEE-formattted floating
point temperature data into 16-bit unsigned integers with 2's complement
representation. The encoding formula accounts for the full range of
32-bit IEEE floating point values but only values in the open range:
-4.095=3);
if (finite(t))
{
/* assign out-of-range values to sentinel values */
if (t>=61.439) T=0xefffL; else if (t<=-4.095) T=0xf001L;
/* encode the temperature as the number of tenths of millidegrees (rounded) */
else T = (long int)(1000*(t + ((t<0) ? -0.0005 : 0.0005)));
/* express in 16-bit 2's-complement form */
if (T<0) T+=0x10000L;
}
return T;
}
5) GPS fix format.
------------------
Each telemetry cycle begins with the float attempting to acquire a GPS
fix. The fix includes the amount of time required to acquire the fix,
the longitude and latitude (degrees), the date & time of the fix, and the
number of satellites used to determine the fix. For example:
# GPS fix obtained in 98 seconds.
# lon lat mm/dd/yyyy hhmmss nsat
Fix: -152.945 22.544 09/01/2005 104710 8
Positive values of longitude, latitude represent east, north hemispheres,
respectively. Negative values of longitude, latitude represent west,
south hemispheres, respectively. The date is given in month-day-year
format and the time is given in hours-minutes-seconds format.
If no fix was acquired then the following note is entered into the
iridium message:
# Attempt to get GPS fix failed after 600 seconds.
6) Biographical & engineering data.
-----------------------------------
These data have the format, "key"="value", as shown in the following
examples:
ActiveBallastAdjustments=5
AirBladderPressure=119
AirPumpAmps=91
AirPumpVolts=192
BuoyancyPumpOnTime=1539
Interpretation of these data requires detailed knowledge of firmware
implementations.
~~