4 Replies Latest reply on Jun 22, 2010 8:54 AM by 843851

    Connect to Return channel: ERROR

      Hi everyone,
      I am testing return channel, using code as following:
      try {
           myRCInterface.setTarget(new ConnectionParameters("1269", "vnn1269","vnn1269"));
      //...Here is something for exchange data beetwen receiver and server
      catch(IncompleteTargetException e)
           System.out.println("IncompleteTargetException: " + e.getMessage());
      catch(PermissionDeniedException e)
           System.out.println("PermissionDeniedException: " + e.getMessage());

      When i test this code on DTT-4500 stb, error occurs just at line myRCInterface.setTarget(...): PermissionDeniedException:null

      I wonder if this code is wrong? or modem of my stb is fault?

      Please tell me why this error occurs?

      I also need help for DTT-4000 much. The function "Modem Test" of this stb always says "connected successfully" while dialing to any phone number (even unavailable numbers).
      What i know is that DTT-4500 are sold mainly in Italia. If someone in Italia or have used this stb, please tell me how to setup modem for it.

      Thanks alot,
        • 1. Re: Connect to Return channel: ERROR

          this is quite weird, because it looks like resource reservation did not succeed. but failure to reserve should be reported during the call to reserve().

          this looks pretty much like a bug in the stb (well, this is theoretically possible that something reserved the modem just after your reserve, but very unlikely), but maybe it has something to do with the NULL ResourceClient you pass to reserve() - i think you shouldnt do it, because behavior of reserve() with NULL argument is unspecified. I suggest you write something like

          myRCInterface.reserve(new ResourceClient() { void notifyRelease(ResourceProxy proxy) { ... } ... and so on.

          try this and see if it helps.

          is this is development stb or one from a store shelf? i wonder because later you may hit SecurityException, as access to modem is restricted to applications signed with a certificate, which you will not have unless you have a dev. stb. i dont know that stb, but you may lucky because mhp security model didnt actually survive in the italian dtt market, so maybe there wont be any problem.

          • 2. Re: Connect to Return channel: ERROR
            Thanks Nestor_P,
            Your recommended code is very helpful. The exception PermissionDeniedException isnot thrown longer. Also no exception is thrown after three commands reserve(), setTarget(), connect(). But something weird happens again. I think the connection is not really successful because of:
            - It always throws exception UnknownHostException when i create a socket to any host(ex: "google.com" on port 80).
            - Even when i unplug the line out of modem, three commands for making dial connection are excuted perfectly (no exception).
            - I donot hear dial tone.

            I tried the available function of modem "Modem Test". It cannot connect when i unplug line. That proves modem is not quite fault.

            Can anybody tell me what's wrong with my modem or code?
            Appreciate for your help.
            • 3. Re: Connect to Return channel: ERROR
              Another problem with the code is that it assumes the connection is established and ready to use as soon as connect() method returns, which is not true. Outcome of connection attempt is signalled with an instance of a subclass of ConnectionRCEvent: ConnectionEstablishedEvent if success, ConnectionFailedEvent if failed. To receive such an event, register your listener with addConnectionListener(ConnectionListener l) in the RC interface. Basically, you may want to place all code after connect() into listener's connectionChanged method (executed IF the event indicates connection success).
              Without this, any socket connection attempted prior to ConnectionEstablishedEvent will fail. Depending on what's later in your code, the RC may be disconnected even before accessing the line.
              • 4. Re: Connect to Return channel: ERROR
                Thank Nestor_P much.
                My problem is solved.