This is an extraction and large cleanup of AMSA's COSPAS-SARSAT First Generation Beacon hexId and detection message decode java source code (originally in aussar-oracle-java project). The decode is compliant with the C/S T.001 Issue 4 Revision 10 specification with the exception of the ELT(DT) Location Protocol (see #117). The specification can be downloaded from COSPAS-SARSAT System Documents.
The cleanup included:
- use JSON types like int, double, boolean instead of pure text fields (YES = true etc)
- search through 100,000 historical FGB messages to increase test coverage to over 90%
- create enumerated types
- a large refactoring to deal with a huge amount of copy-and-paste!
There's plenty of legacy ugliness in there still but should be enough for AMSA's use cases.
Status: production
Maven reports including javadocs
See also: sgb-decoder to decode Second Generation Beacon Hex Ids and detection messages.
Add this dependency to your pom.xml:
<dependency>
<groupId>au.gov.amsa</groupId>
<artifactId>fgb-decoder</artifactId>
<version>VERSION_HERE</version>
</dependency>
To decode a 15 character hex beacon identifier:
String json = Beacon15HexId.decodeHexToJson(hex);
To decode a 30 character hex beacon detection message:
String json = Detection.decodeHexToJson(hex);
The hexId ADCC40504000185
decodes to:
{
"messageType": "User (Format - Unknown)",
"hexData": "Unknown",
"hexId": "ADCC40504000185",
"countryCode": 366,
"userProtocolType": "Serial",
"beaconType": "Aviation",
"cSCertNumberPresent": true,
"serialNumber": 5136,
"nationalUse": "0000000000",
"cSTypeApprovalNumber": 97,
"auxiliaryRadioLocatingDevice": "121.5 MHz",
"uSManufacturerId": 1,
"uSSequenceNumber": 1040,
"uSModelId": 0,
"uSRunNumber": 0,
"uSNationalUse": "01100001"
}
The detection message D6E6202820000C29FF51041775302D
decodes to:
{
"messageType": "User Location (Long)",
"hexData": "D6E6202820000C29FF51041775302D",
"hexId": "ADCC40504000185",
"countryCode": 366,
"userProtocolType": "Serial",
"beaconType": "Aviation",
"cSCertNumberPresent": true,
"serialNumber": 5136,
"nationalUse": "0000000000",
"cSTypeApprovalNumber": 97,
"auxiliaryRadioLocatingDevice": "121.5 MHz",
"uSManufacturerId": 1,
"uSSequenceNumber": 1040,
"uSModelId": 0,
"uSRunNumber": 0,
"uSNationalUse": "01100001",
"errorCorrectingCode1": "001111111110101000100",
"encodedPositionSource": "EXTERNAL",
"latitude": 32.733333333333334,
"longitude": -117.2,
"errorCorrectingCode2": "000000101101"
}
mvn clean install
To build a release:
git checkout master
./release.sh <VERSION>
- go to Github project and publish a release (look at previous releases to see what goes in the release description field)
- in the Github project go to Actions and check to see if the release has made its way to Maven Central successfully
-
git checkout <VERSION> && ./generate-site.sh
(requires repo amsa-code.github.io to be sitting next to fgb-decoder) - change the fgb-decoder version in beacon-decoder-aws and run its release script (which deploys it to AWS)
- change the fgb-decoder version in parent/beacon-decoder and redeploy it to Tomcat on sar*.