code: def add_license(self, contents):
          
          buf_size = len(contents)
          buf = (ctypes.c_char * (buf_size + 1))(*contents.encode())
  
          res = self._dll.JLINK_EMU_AddLicense(buf)
  
          if res == -1:
              raise errors.JLinkException('Unspecified error.')
          elif res == -2:
              raise errors.JLinkException('Failed to read/write license area.')
          elif res == -3:
              raise errors.JLinkException('J-Link out of space.')
  
          return (res == 0)
docs: Adds the given ``contents`` as a new custom license to the J-Link.
  
          Args:
            self (JLink): the ``JLink`` instance
            contents: the string contents of the new custom license
  
          Returns:
            ``True`` if license was added, ``False`` if license already existed.
  
          Raises:
            JLinkException: if the write fails.
  
          Note:
            J-Link V9 and J-Link ULTRA/PRO V4 have 336 Bytes of memory for
            licenses, while older versions of 80 bytes.