public static final LocoNetMessage createSetUr92GroupPasswordPacket(String sGroupPassword) throws jmri.jmrix.loconet.LocoNetException {
  int gr_p1=sGroupPassword.charAt(0);
  int gr_p2=sGroupPassword.charAt(1);
  int gr_p3=sGroupPassword.charAt(2);
  int gr_p4=sGroupPassword.charAt(3);
  int i;
  if (validateGroupPassword(sGroupPassword) == false) {
    if (getLimitPasswordToNumericOnly() == true) {
      throw new jmri.jmrix.loconet.LocoNetException("Invalid Duplex Group Password - must be a 4 digit number between 0000 and 9999, inclusive");
    }
 else {
      throw new jmri.jmrix.loconet.LocoNetException("Invalid Duplex Group Password - must be a 4 character value using only digits, 'A', 'B', and/or 'C'");
    }
  }
  gr_p1-=(gr_p1 > '9') ? ('A' - '9' - 1) : 0;
  gr_p2-=(gr_p2 > '9') ? ('A' - '9' - 1) : 0;
  gr_p3-=(gr_p3 > '9') ? ('A' - '9' - 1) : 0;
  gr_p4-=(gr_p4 > '9') ? ('A' - '9' - 1) : 0;
  LocoNetMessage m=new LocoNetMessage(LnConstants.RE_DPLX_OP_LEN);
  i=0;
  m.setElement(i++,LnConstants.OPC_PEER_XFER);
  m.setElement(i++,LnConstants.RE_DPLX_OP_LEN);
  m.setElement(i++,LnConstants.RE_DPLX_GP_PW_TYPE);
  m.setElement(i++,LnConstants.RE_DPLX_OP_TYPE_WRITE);
  m.setElement(i++,0);
  m.setElement(i++,gr_p1);
  m.setElement(i++,gr_p2);
  m.setElement(i++,gr_p3);
  m.setElement(i++,gr_p4);
  for (; i < (LnConstants.RE_DPLX_OP_LEN - 1); i++) {
    m.setElement(i,0);
  }
  return m;
}

public static final LocoNetMessage createSetUr92GroupPasswordPacket ( String sGroupPassword ) throws jmri . jmrix . loconet . LocoNetException { int gr_p1 = sGroupPassword . charAt ( 0 ) ; int gr_p2 = sGroupPassword . charAt ( 1 ) ; int gr_p3 = sGroupPassword . charAt ( 2 ) ; int gr_p4 = sGroupPassword . charAt ( 3 ) ; int i ; if ( validateGroupPassword ( sGroupPassword ) == false ) { if ( getLimitPasswordToNumericOnly ( ) == true ) { throw new jmri . jmrix . loconet . LocoNetException ( "Invalid Duplex Group Password - must be a 4 digit number between 0000 and 9999, inclusive" ) ; } else { throw new jmri . jmrix . loconet . LocoNetException ( "Invalid Duplex Group Password - must be a 4 character value using only digits, 'A', 'B', and/or 'C'" ) ; } } gr_p1 -= ( gr_p1 > '9' ) ? ( 'A' - '9' - 1 ) : 0 ; gr_p2 -= ( gr_p2 > '9' ) ? ( 'A' - '9' - 1 ) : 0 ; gr_p3 -= ( gr_p3 > '9' ) ? ( 'A' - '9' - 1 ) : 0 ; gr_p4 -= ( gr_p4 > '9' ) ? ( 'A' - '9' - 1 ) : 0 ; LocoNetMessage m = new LocoNetMessage ( LnConstants . RE_DPLX_OP_LEN ) ; i = 0 ; m . setElement ( i ++ , LnConstants . OPC_PEER_XFER ) ; m . setElement ( i ++ , LnConstants . RE_DPLX_OP_LEN ) ; m . setElement ( i ++ , LnConstants . RE_DPLX_GP_PW_TYPE ) ; m . setElement ( i ++ , LnConstants . RE_DPLX_OP_TYPE_WRITE ) ; m . setElement ( i ++ , 0 ) ; m . setElement ( i ++ , gr_p1 ) ; m . setElement ( i ++ , gr_p2 ) ; m . setElement ( i ++ , gr_p3 ) ; m . setElement ( i ++ , gr_p4 ) ; for ( ; i < ( LnConstants . RE_DPLX_OP_LEN - 1 ) ; i ++ ) { m . setElement ( i , 0 ) ; } return m ; }
create a loconet packet to set the duplex group password . < p > if s provides anything other than a 4 character length group password which uses only valid group id characters ( 0 - 9 , a - c , a - c ) , a bogus loconet message is returned . < p >
