parameters: (tag_block_message)
return_statement: return decoded
docstring: Decode the payload of one (but NOT more) NMEA TAG block.
  
    Args:
      tag_block_message: dict, A dictionary with a matches entry.
  
    Returns:
      A message dictionary compatible with vdm.BareQueue.
docstring_summary: Decode the payload of one (but NOT more) NMEA TAG block.
docstring_tokens: Decode the payload of one ( but NOT more ) NMEA TAG block .
function: def DecodeTagSingle(tag_block_message):
    """Decode the payload of one (but NOT more) NMEA TAG block.
  
    Args:
      tag_block_message: dict, A dictionary with a matches entry.
  
    Returns:
      A message dictionary compatible with vdm.BareQueue.
    """
    line = tag_block_message['matches'][0]['payload']
    match = vdm.Parse(line)
    if not match:
      logger.info('Single line NMEA TAG block decode failed for: %s',
                   tag_block_message)
      return
  
    sentence_total = int(match['sen_tot'])
    if sentence_total != 1:
      logger.error('Multi-line message? %s', tag_block_message)
      return
  
    body = match['body']
    fill_bits = int(match['fill_bits'])
    try:
      decoded = ais.decode(body, fill_bits)
    except ais.DecodeError as error:
      logger.error('Unable to decode: %s', error)
      return
  
    decoded['md5'] = hashlib.md5(body.encode('utf-8')).hexdigest()
    return decoded
function_tokens: def DecodeTagSingle ( tag_block_message ) : line = tag_block_message [ 'matches' ] [ 0 ] [ 'payload' ] match = vdm . Parse ( line ) if not match : logger . info ( 'Single line NMEA TAG block decode failed for: %s' , tag_block_message ) return sentence_total = int ( match [ 'sen_tot' ] ) if sentence_total != 1 : logger . error ( 'Multi-line message? %s' , tag_block_message ) return body = match [ 'body' ] fill_bits = int ( match [ 'fill_bits' ] ) try : decoded = ais . decode ( body , fill_bits ) except ais . DecodeError as error : logger . error ( 'Unable to decode: %s' , error ) return decoded [ 'md5' ] = hashlib . md5 ( body . encode ( 'utf-8' ) ) . hexdigest ( ) return decoded