mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	AIS: Fix string decoding in safetey messages. #2094
This commit is contained in:
		
							parent
							
								
									217c900609
								
							
						
					
					
						commit
						4f2b03646f
					
				@ -502,7 +502,7 @@ AISSafetyMessage::AISSafetyMessage(QByteArray ba) :
 | 
				
			|||||||
    m_sequenceNumber = ba[4] & 0x3;
 | 
					    m_sequenceNumber = ba[4] & 0x3;
 | 
				
			||||||
    m_destinationId = ((ba[5] & 0xff) << 22) | ((ba[6] & 0xff) << 14) | ((ba[7] & 0xff) << 6) | ((ba[8] >> 2) & 0x3f);
 | 
					    m_destinationId = ((ba[5] & 0xff) << 22) | ((ba[6] & 0xff) << 14) | ((ba[7] & 0xff) << 6) | ((ba[8] >> 2) & 0x3f);
 | 
				
			||||||
    m_retransmitFlag = (ba[8] >> 1) & 0x1;
 | 
					    m_retransmitFlag = (ba[8] >> 1) & 0x1;
 | 
				
			||||||
    m_safetyRelatedText = AISMessage::getString(ba, 9, 0, (ba.size() - 9) * 8 / 6);
 | 
					    m_safetyRelatedText = AISMessage::getString(ba, 9, 8, (ba.size() - 9) * 8 / 6);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString AISSafetyMessage::toString()
 | 
					QString AISSafetyMessage::toString()
 | 
				
			||||||
@ -518,7 +518,7 @@ AISSafetyAck::AISSafetyAck(QByteArray ba) :
 | 
				
			|||||||
AISSafetyBroadcast::AISSafetyBroadcast(QByteArray ba) :
 | 
					AISSafetyBroadcast::AISSafetyBroadcast(QByteArray ba) :
 | 
				
			||||||
    AISMessage(ba)
 | 
					    AISMessage(ba)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    m_safetyRelatedText = AISMessage::getString(ba, 5, 0, (ba.size() - 6) * 8 / 6);
 | 
					    m_safetyRelatedText = AISMessage::getString(ba, 5, 8, (ba.size() - 5) * 8 / 6);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString AISSafetyBroadcast::toString()
 | 
					QString AISSafetyBroadcast::toString()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user