Class UhlenbrockSlotManager

  • All Implemented Interfaces:
    java.util.EventListener, PropertyChangeFirer, PropertyChangeProvider, CommandStation, Disposable, LocoNetListener, Programmer

    public class UhlenbrockSlotManager
    extends SlotManager
    Only change compared to standard LocoNet SlotManager is CV programming. The Uhlenbrock IB-COM / Intellibox II uses some special and undocumented means (OPC_IMM_PACKET). PC -> IB: BB 7F 00 3B OPC_RQ_SL_DATA, 127(Command Station Options ), 0 IB -> PC: B4 3B 00 70 OPC_LONG_ACK, on OPC_RQ_SL_DATA, 0 # start of programming session PC -> IB: E5 07 01 49 42 41 56 OPC_PEER_XFER, src=7, dst=9345, ?? PC -> IB: 82 7D OPC_GPOFF # read cv 1 R CV CV PC -> IB: ED 1F 01 49 42 71 72 01 00 00 70 00 00 00 00 10 OPC_IMM_PACKET 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 IB -> PC: B4 6D 01 27 OPC_LONG_ACK, on OPC_IMM_PACKET # cv 1 has value 3 VV IB -> PC: E7 0E 7C 00 00 00 72 06 00 00 03 00 00 1D OPC_SL_RD_DATA, len, PT slot, # end off programming session PC -> IB: E5 07 01 49 42 40 57 OPC_PEER_XFER, src=7, dst= # start of programming session PC -> IB: E5 07 01 49 42 41 56 OPC_PEER_XFER, src=7, dst= PC -> IB: 82 7D OPC_GPOFF # write cv 1 W CV CV VV PC -> IB: ED 1F 01 49 42 71 71 01 00 03 70 00 00 00 00 10 OPC_IMM_PACKET 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 IB -> PC: B4 6D 01 27 OPC_LONG_ACK, on OPC_IMM_PACKET # cv 1 has value 3 VV IB -> PC: E7 0E 7C 00 00 00 71 06 00 00 03 00 00 1E OPC_SL_RD_DATA, len, PT slot, # end off programming session PC -> IB: E5 07 01 49 42 40 57 OPC_PEER_XFER, src=7, dst= # write 254 in cv 27 HB W CV CV VV ED 1F 01 49 42 79 71 1B 00 7E 70 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A # HB = high bit for CV value # response HB VV E7 0E 7C 00 00 00 71 06 02 00 7E 00 00 61 # write 255 in cv 545 HB W CV CV VV ED 1F 01 49 42 79 71 21 02 7F 70 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 # read cv 393 HB R CV CV VV ED 1F 01 49 42 73 72 09 02 00 70 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6D
    • Method Detail

      • loadSlots

        protected void loadSlots​(boolean initialize)
        Provide Uhlenbrock-specific slot implementation
        Overrides:
        loadSlots in class SlotManager
        Parameters:
        initialize - - not used by Uhlenbrock
      • checkLackByte1

        protected boolean checkLackByte1​(int Byte1)
        Description copied from class: SlotManager
        Check CV programming LONG_ACK message byte 1

        The following methods are for parsing LACK as response to CV programming. It is divided into numerous small methods so that each bit can be overridden for special parsing for individual command station types.

        Overrides:
        checkLackByte1 in class SlotManager
        Parameters:
        Byte1 - from the LocoNet message
        Returns:
        true if byte1 encodes a response to a OPC_SL_WRITE or an Expanded Slot Write
      • checkLackTaskAccepted

        protected boolean checkLackTaskAccepted​(int Byte2)
        Description copied from class: SlotManager
        Checks the status byte of an OPC_LONG_ACK when performing CV programming operations.
        Overrides:
        checkLackTaskAccepted in class SlotManager
        Parameters:
        Byte2 - status byte
        Returns:
        True if status byte indicates acceptance of the command, else false.
      • checkLackAcceptedBlind

        protected boolean checkLackAcceptedBlind​(int Byte2)
        Description copied from class: SlotManager
        Checks the OPC_LONG_ACK status byte response to a programming operation to see if the programmer accepted the operation "blindly".
        Overrides:
        checkLackAcceptedBlind in class SlotManager
        Parameters:
        Byte2 - from the OPC_LONG_ACK message
        Returns:
        true if the programmer indicated a "blind operation", else false
      • progOnMainMessage

        protected LocoNetMessage progOnMainMessage​(int hopsa,
                                                   int lopsa,
                                                   int val,
                                                   int cvnum)
        Internal method to create the LocoNetMessage for programming on main The table below contains value observed from an Intellibox II when doing programming on main. Address CV Value Element Decimal Hex Decimal Hex Decimal Hex 4 5 60 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 01 2 02 1 01 ED 1F 1 49 42 71 5E 1 0 2 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4A 1 01 115 73 127 7F ED 1F 1 49 42 71 5E 1 0 73 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 45 56 38 2 02 1 01 ED 1F 1 49 42 71 5E 38 0 2 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 73 87 57 255 FF 1 01 ED 1F 1 49 42 79 5E 57 0 7F 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 69 87 57 255 FF 127 7F ED 1F 1 49 42 79 5E 57 0 7F 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 87 57 255 FF 255 FF ED 1F 1 49 42 79 5E 57 0 7F 72 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 87 57 256 100 1 01 ED 1F 1 49 42 71 5E 57 0 0 70 1 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1F 87 57 256 100 127 7F ED 1F 1 49 42 71 5E 57 0 0 70 1 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 87 57 256 100 255 FF ED 1F 1 49 42 71 5E 57 0 0 72 1 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 87 57 513 201 1 01 ED 1F 1 49 42 71 5E 57 0 1 70 2 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1D 87 57 513 201 127 7F ED 1F 1 49 42 71 5E 57 0 1 70 2 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 87 57 513 201 255 FF ED 1F 1 49 42 71 5E 57 0 1 72 2 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 87 57 1024 400 1 01 ED 1F 1 49 42 71 5E 57 0 0 70 4 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1A 87 57 1024 400 127 7F ED 1F 1 49 42 71 5E 57 0 0 70 4 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 87 57 1024 400 255 FF ED 1F 1 49 42 71 5E 57 0 0 72 4 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 66 120 78 127 7F 127 7F ED 1F 1 49 42 71 5E 78 0 7F 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 120 78 255 FF 127 7F ED 1F 1 49 42 79 5E 78 0 7F 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 120 78 255 FF 128 80 ED 1F 1 49 42 79 5E 78 0 7F 72 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 45 120 78 255 FF 254 FE ED 1F 1 49 42 79 5E 78 0 7F 72 0 7E 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3B 120 78 255 FF 255 FF ED 1F 1 49 42 79 5E 78 0 7F 72 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3A 127 7F 3 03 1 01 ED 1F 1 49 42 71 5E 7F 0 3 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 35 127 7F 3 03 127 7F ED 1F 1 49 42 71 5E 7F 0 3 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4B 127 7F 3 03 128 80 ED 1F 1 49 42 71 5E 7F 0 3 72 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 36 255 FF 3 03 1 01 ED 1F 1 49 42 73 5E 7F 0 3 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 255 FF 255 FF 127 7F ED 1F 1 49 42 7B 5E 7F 0 7F 70 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3D 255 FF 255 FF 128 80 ED 1F 1 49 42 7B 5E 7F 0 7F 72 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 256 100 2 02 1 01 ED 1F 1 49 42 71 5E 0 1 2 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4A 256 100 255 FF 255 FF ED 1F 1 49 42 79 5E 0 1 7F 72 0 7F 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 43 1000 3E8 3 03 1 01 ED 1F 1 49 42 73 5E 68 3 3 70 0 1 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23

        Element 0: OPC_IMM_PACKET Element 1: Always 1F Element 2: Always 01 Element 3: Always 49 Element 4: Always 42 Element 5: Basic value 71. Bit 1 (value 02) equals bit 7 in address. Bit 3 (value 08) equals bit 7 in CV number. Element 6: 5E=Write on main, 71=Write on PT, 72=Read on PT Element 7: LOPSA, i.e. Bit 0-6 of address Element 8: Bit 8-14 of address. This is not equal to HOPSA, since bit 7 is stored in element 5. Element 9: Bit 0-6 of CV number. Element 10: Basic value 70. Bit 1 (value 02) equals bit 7 in CV value. Element 11: Bit 8-11 of CV number. Element 12: Bit 0-6 in CV value. Element 15: Always 10 Element 30: Checksum

        Parameters:
        hopsa - high status byte for message
        lopsa - low status byte for message
        val - Value for programming operation
        cvnum - CV number for programming operation
        Returns:
        formatted message
      • progOnProgrammingTrackMessage

        protected LocoNetMessage progOnProgrammingTrackMessage​(int element6,
                                                               int val,
                                                               int cvnum)
        Internal method to create the LocoNetMessage for programming on programming track. The table below contains value observed from an Intellibox II when doing programming on programming track. Operation CV Value Byte # Decimal Hex Decimal Hex 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Read 1 01 ED 1F 1 49 42 71 72 1 0 0 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 Write 1 01 3 03 ED 1F 1 49 42 71 71 1 0 3 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 Write 27 1B 254 FE ED 1F 1 49 42 79 71 1B 0 7E 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0A Write 545 221 255 FF ED 1F 1 49 42 79 71 21 2 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33 Read 393 189 ED 1F 1 49 42 73 72 9 1 0 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6D Write n 01 ED 1F 1 49 42 73 71 7F 0 1 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1B Write 255 FF 127 7F ED 1F 1 49 42 73 71 7F 0 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 Write 255 FF 255 FF ED 1F 1 49 42 7B 71 7F 0 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6D Write 256 100 1 01 ED 1F 1 49 42 71 71 0 1 1 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 Write 256 100 127 7F ED 1F 1 49 42 71 71 0 1 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 Write 256 100 255 FF ED 1F 1 49 42 79 71 0 1 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 Write 513 201 1 01 ED 1F 1 49 42 71 71 1 2 1 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 Write 513 201 127 7F ED 1F 1 49 42 71 71 1 2 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1B Write 513 201 255 FF ED 1F 1 49 42 79 71 1 2 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 Write 1024 400 1 01 ED 1F 1 49 42 71 71 0 4 1 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 Write 1024 400 127 7F ED 1F 1 49 42 71 71 0 4 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1C Write 1024 400 255 FF ED 1F 1 49 42 79 71 0 4 7F 70 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14

        Element 0: OPC_IMM_PACKET Element 1: Always 1F Element 2: Always 01 Element 3: Always 49 Element 4: Always 42 Element 5: Basic value 71. Bit 1 (value 02) equals bit 7 in CV number. Bit 3 (value 08) equals bit 7 in CV value. Element 6: 5E=Write on main, 71=Write on PT, 72=Read on PT Element 7: Bit 0-6 of CV number Element 8: Bit 8-11 of CV number. Element 9: Bit 0-6 of CV value. Element 10: Always 70. Element 15: Always 10 Element 30: Checksum

        Parameters:
        element6 - Byte from message
        val - Value for programming operation
        cvnum - CV number for programming operation
        Returns:
        formatted message
      • progTaskStart

        protected LocoNetMessage progTaskStart​(int pcmd,
                                               int val,
                                               int cvnum,
                                               boolean write)
        Description copied from class: SlotManager
        Internal method to create the LocoNetMessage for programmer task start.
        Overrides:
        progTaskStart in class SlotManager
        Parameters:
        pcmd - programmer command
        val - value to be used
        cvnum - CV number
        write - true if write, else false
        Returns:
        a LocoNet message containing a programming task start operation
      • startIBComPT

        protected LocoNetMessage startIBComPT()
        Internal method to create the LocoNetMessage for enabling programming track in IB-COM / Intellibox II Note: This method is specific to Uhlenbrock
        Returns:
        Message to send to do this function
      • stopIBComPT

        protected LocoNetMessage stopIBComPT()
        Internal method to create the LocoNetMessage for disabling programming track in IB-COM / Intellibox II Note: This method is currently not used
        Returns:
        Message to send to do this function