def _write_public_funcs(self, fp):      
      fp.write('\n'.join(_genCommentHeader('Public Functions'))+'\n')
      self._write_rte_start(fp)
      if len(self.partition.upperLayerAPI.read)>0:
        self._genRead(fp, sorted(self.partition.upperLayerAPI.final['read'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.write)>0:
        self._genWrite(fp, sorted(self.partition.upperLayerAPI.final['write'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.receive)>0:
        self._genReceive(fp, sorted(self.partition.upperLayerAPI.final['receive'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.send)>0:
        self._genSend(fp, sorted(self.partition.upperLayerAPI.final['send'], key=lambda x: x.shortname))
      #if len(self.partition.upperLayerAPI.call)>0:
      #  self._genCall(fp, sorted(self.partition.upperLayerAPI.final['call'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.get)>0:
        self._genGet(fp, sorted(self.partition.upperLayerAPI.final['get'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.setReadData)>0:
        self._genFunctionBodies(fp, sorted(self.partition.upperLayerAPI.final['setReadData'], key=lambda x: x.shortname))
      if len(self.partition.upperLayerAPI.setReadResult)>0:
        self._genFunctionBodies(fp, sorted(self.partition.upperLayerAPI.setReadResult.values(), key=lambda x: x.shortname))
      if self.mode_switch_enable and len(self.partition.mode_switch_functions)>0:
         self._genFunctionBodies(fp, [self.partition.mode_switch_functions[key] for key in sorted(self.partition.mode_switch_functions.keys())])
      if len(self.extra_public_functions)>0:
         self._genFunctionBodies(fp, [self.extra_public_functions[key] for key in sorted(self.extra_public_functions.keys())])