def shutdown(self):
        """
        Shuts down connection to the device safely.

        :raise cam.CanError: is closing the connection did not work
        """
        status = self.can.close(self.handle)

        if status != CANAL_ERROR_SUCCESS:
            raise CanError("could not shut down bus: status == {}".format(status))
Shuts down connection to the device safely.

        :raise cam.CanError: is closing the connection did not work