Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. bool isPositionRequest( std::uint8_t formatSpecifier, std::uint8_t category, std::uint8_t natureOfDistressOfTelecommand1, std::uint8_t typeOfCommunicationOrTelecommand2 )
  2. {
  3.     return formatSpecifier == FormatSpecifierIndividualStations
  4.         && category == CategorySafety
  5.         && ( natureOfDistressOfTelecommand1 == FirstTelecommandInvalid || natureOfDistressOfTelecommand1 == FirstTelecommandShipPositionOrLocationRegistrationUpdating )
  6.         && ( typeOfCommunicationOrTelecommand2 == SecondTelecommandInvalid || typeOfCommunicationOrTelecommand2 == SecondTelecommandNoInformation );
  7. }
  8.  
  9. MMSI mmsi;
  10. if ( DSCTarget::isPositionRequest( formatSpecifier, category, natureOfDistressOr1stTelecommand, subseqComModeOr2ndTelecommand ) )
  11. {
  12.     mmsi = address; // mmsi is taken from field 2 of DSC
  13. }
  14. else
  15. {
  16.     mmsi = mmsiOfShipInDistress; // mmsi is taken from field 8 of DSC
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement