def handleevent(self, msg):
        ''' Handle an Event Message used to start, stop, or pause 
            mobility scripts for a given WlanNode.
        '''
        eventtype = msg.gettlv(coreapi.CORE_TLV_EVENT_TYPE)
        nodenum = msg.gettlv(coreapi.CORE_TLV_EVENT_NODE)
        name = msg.gettlv(coreapi.CORE_TLV_EVENT_NAME)
        try:
            node = self.session.obj(nodenum)
        except KeyError:
            self.session.warn("Ignoring event for model '%s', unknown node " \
                              "'%s'" % (name, nodenum))
            return
        
        # name is e.g. "mobility:ns2script"
        models = name[9:].split(',')
        for m in models:
            try:
                cls = self._modelclsmap[m]
            except KeyError:
                self.session.warn("Ignoring event for unknown model '%s'" % m)
                continue
                _name = "waypoint"
            if cls._type == coreapi.CORE_TLV_REG_WIRELESS:
                model = node.mobility
            elif cls._type == coreapi.CORE_TLV_REG_MOBILITY:
                model = node.mobility
            else:
                continue
            if model is None:
                self.session.warn("Ignoring event, %s has no model" % node.name)
                continue
            if cls._name != model._name:
                self.session.warn("Ignoring event for %s wrong model %s,%s" % \
                                  (node.name, cls._name, model._name))
                continue
            
            if eventtype == coreapi.CORE_EVENT_STOP or \
                eventtype == coreapi.CORE_EVENT_RESTART:
                model.stop(move_initial=True)
            if eventtype == coreapi.CORE_EVENT_START or \
                eventtype == coreapi.CORE_EVENT_RESTART:
                model.start()
            if eventtype == coreapi.CORE_EVENT_PAUSE:
                model.pause()
dataset/ETHPy150Open coreemu/core/daemon/core/mobility.py/MobilityManager.handleevent/original