juergenH87 / python-can-j1939

The package provides SAE J1939 support for Python developers
MIT License
90 stars 51 forks source link

ControllerApplication.on_request looks like dead code #58

Open grant-allan-ctct opened 10 months ago

grant-allan-ctct commented 10 months ago

The public function on_request on the ControllerApplication class here does nothing and is never called.

    def on_request(self, src_address, dest_address, pgn):
        """Callback for PGN requests
        :param int src_address:
            The address the request comes from
        :param int dest_address:
            The address the request was sent to; normally ours, but can also be GLOBAL
        :param int pgn:
            Parameter Group Number requested
        """
        pass

It seems like in the times gone by, a consumer was expected to subclass the ControllerApplication class and then override this function. You can see that in this line in the original benkfra project. The new way is instead to inject a subscriber using subscribe_request, but the on_request function missed out on deletion when that changed.