public void slotFromLocoAddress(int i,SlotListener l){
  mLocoAddrHash.put(Integer.valueOf(i),l);
  LocoNetMessage m=new LocoNetMessage(4);
  m.setOpCode(LnConstants.OPC_LOCO_ADR);
  m.setElement(1,(i / 128) & 0x7F);
  m.setElement(2,i & 0x7F);
  tc.sendLocoNetMessage(m);
}

public void slotFromLocoAddress ( int i , SlotListener l ) { mLocoAddrHash . put ( Integer . valueOf ( i ) , l ) ; LocoNetMessage m = new LocoNetMessage ( 4 ) ; m . setOpCode ( LnConstants . OPC_LOCO_ADR ) ; m . setElement ( 1 , ( i / 128 ) & 0x7F ) ; m . setElement ( 2 , i & 0x7F ) ; tc . sendLocoNetMessage ( m ) ; }
obtain a slot for a particular loco address . < p > this requires access to the command station , even if the locomotive address appears in the current contents of the slot array , to ensure that our local image is up - to - date . < p > this method sends an info request . when the echo of this is returned from the loconet , the next slot - read is recognized as the response . < p > the object that ' s looking for this information must provide a slotlistener to notify when the slot id becomes available . < p > the slotlistener is not subscribed for slot notifications ; it can do that later if it wants . we don ' t currently think that ' s a race condition .
