MmiSystemModule connection fails
Whenever an MMI handler is registered with the Stack (whether the resident handler or the OCAP-J handler), a new MmiSystemModule is created for this handler. The handler attempts to call connect() on itself if its connected flag is false. The underlying implementation of connect in the platform will only allow a connection to happen once, and will return an error on subsequent attempts.
This causes a problem. When the stack boots up, it registers a resident MMI handler, which creates a MmiSystemModule, which then calls connect. The problem occurs if an OCAP-J application tries to register a handler. The handler will be registered, and a new MmiSystemModule will be created. Connect will be called on the new module, but it will fail (since the connection already exists in the stack), so the connection fails. As a result, the OCAP-J will never be able to send any APDUs to the CableCARD.
I think the root cause of this is the fact that it shouldn't be the MmiSystemModule performing the connection, but this should be the stack that sets up the connection once for all sessions.
What do you think? Does that make sense?