def next_message(self, ping=True, fetch=True):

        # optionally ping the modem, to give it a
        # chance to deliver any waiting messages
        if ping:
            self.ping()

        # optionally check the storage for unread messages.
        # we must do this just as often as ping, because most
        # handsets don't support CNMI-style delivery
        if fetch:
            self._fetch_stored_messages()

        # abort if there are no messages waiting
        if not self.incoming_queue:
            return None

        # remove the message that has been waiting
        # longest from the queue, and return it
        return self.incoming_queue.pop(0)
Returns the next waiting IncomingMessage object, or None if the
dataset/ETHPy150Open sahana/eden/modules/pygsm/gsmmodem.py/GsmModem.next_message