From 456c7873eb3192eacfcc54498a9491d07bbe69d8 Mon Sep 17 00:00:00 2001 From: Eric Wild Date: Wed, 23 Sep 2026 17:51:04 +0200 Subject: [PATCH] bip: answer proactive commands the relay does not implement pySim-smpp2sim currently claims to support every feature flag that exists, but this immediately dies here with a SJA5: NotImplementedError: No handler method for ProvideLocalInformation(...) Answer anything unhandled with "performed_successfully" and log. Never "command_beyond_terminal_capability", tho, answering that for PROVIDE LOCAL INFORMATION refuses to open the session at all. Change-Id: I1e55d6f88c872a04b89a3946dd840d30b329621e --- pySim/bip.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pySim/bip.py b/pySim/bip.py index a23741e2..d4c28752 100644 --- a/pySim/bip.py +++ b/pySim/bip.py @@ -219,6 +219,25 @@ class Proact(ProactiveHandler): self.sms_sink = sms_sink self.channels = ProactChannels(on_data_available=self._on_channel_data_available) + def receive_fetch(self, pcmd: ProactiveCommand): + """Answer anything this handler has no specific handler for. + + A card coming up will usually issue PROVIDE LOCAL INFORMATION, + POLL INTERVAL or TIMER MANAGEMENT before it gets anywhere near a BIP channel + because we claim to support every feature flag there is. + + Note that this is not the spec-correct answer. TS 102 223 6.8.7 + says a successful TERMINAL RESPONSE to PROVIDE LOCAL INFORMATION "shall" carry the + requested Local information data object, and 6.8.13/6.8.14 says the same for TIMER + MANAGEMENT, this returns empty results for all of them, which works with real cards. + + Always "performed_successfully", never "command_beyond_terminal_capability" because + answering that to PROVIDE LOCAL INFORMATION makes a card refuse to open the session. + """ + logger.info("no handler for %s, answering performed_successfully", + type(pcmd.decoded).__name__) + return self.prepare_response(pcmd, 'performed_successfully') + @staticmethod def _find_first_element_of_type(instlist, cls): for i in instlist: