parameters: (self, msg: bytes)
docstring: extract the payload data from a obp message
  
          Parameters
          ----------
          msg:
              a obp message
  
          Returns
          -------
          data:
              the payload contained in the message
docstring_summary: extract the payload data from a obp message
docstring_tokens: extract the payload data from a obp message
function: def _extract_message_data(self, msg: bytes) -> bytes:
          """extract the payload data from a obp message
  
          Parameters
          ----------
          msg:
              a obp message
  
          Returns
          -------
          data:
              the payload contained in the message
          """
          payload_length = len(msg) - 44 - 20  # - HeaderLength - FooterLength
          if not (payload_length >= 0):
              raise SeaBreezeError("Received message < 64 bytes: %d" % payload_length)
          payload_fmt = "%ds" % payload_length
          FMT = self.OBP.HEADER_FMT + payload_fmt + self.OBP.FOOTER_FMT
  
          data = struct.unpack(FMT, msg)
  
          msg_type = data[4]
  
          immediate_length: int = data[8]
          immediate_data: bytes = data[9]
          payload: bytes = data[11]
  
          if (immediate_length > 0) and len(payload) > 0:
              raise SeaBreezeError("Got immediate AND payload data? cmd: '%d'" % msg_type)
          elif immediate_length > 0:
              return immediate_data[:immediate_length]
          elif payload_length > 0:
              return payload
          else:
              return b""
function_tokens: def _extract_message_data ( self , msg : bytes ) -> bytes : payload_length = len ( msg ) - 44 - 20 # - HeaderLength - FooterLength if not ( payload_length >= 0 ) : raise SeaBreezeError ( "Received message < 64 bytes: %d" % payload_length ) payload_fmt = "%ds" % payload_length FMT = self . OBP . HEADER_FMT + payload_fmt + self . OBP . FOOTER_FMT data = struct . unpack ( FMT , msg ) msg_type = data [ 4 ] immediate_length : int = data [ 8 ] immediate_data : bytes = data [ 9 ] payload : bytes = data [ 11 ] if ( immediate_length > 0 ) and len ( payload ) > 0 : raise SeaBreezeError ( "Got immediate AND payload data? cmd: '%d'" % msg_type ) elif immediate_length > 0 : return immediate_data [ : immediate_length ] elif payload_length > 0 : return payload else : return b""