need to copy in BT address too

This commit is contained in:
Eric House 2014-11-20 06:21:14 -08:00
parent e236a32c20
commit a35527ae88
2 changed files with 18 additions and 4 deletions

View file

@ -262,10 +262,19 @@ public class NetLaunchInfo {
CommsAddrRec result = new CommsAddrRec();
for ( CommsConnType typ : m_addrs.getTypes() ) {
result.conTypes.add( typ );
if ( CommsConnType.COMMS_CONN_RELAY == typ ) {
switch( typ ) {
case COMMS_CONN_RELAY:
String relayName = XWPrefs.getDefaultRelayHost( context );
int relayPort = XWPrefs.getDefaultRelayPort( context );
result.setRelayParams( relayName, relayPort, room );
break;
case COMMS_CONN_BT:
result.setBTParams( btAddress, btName );
break;
case COMMS_CONN_SMS:
default:
Assert.fail();
break;
}
}

View file

@ -137,11 +137,10 @@ public class CommsAddrRec {
setRelayParams( host, port );
}
public CommsAddrRec( String btHost, String btAddr )
public CommsAddrRec( String btName, String btAddr )
{
this( CommsConnType.COMMS_CONN_BT );
bt_hostName = btHost;
bt_btAddr = btAddr;
setBTParams( btAddr, btName );
}
public CommsAddrRec( String phone )
@ -174,6 +173,12 @@ public class CommsAddrRec {
ip_relay_advertiseRoom = false;
}
public void setBTParams( String btAddr, String btName )
{
bt_hostName = btName;
bt_btAddr = btAddr;
}
public void populate( Context context )
{
for ( CommsConnType typ : conTypes.getTypes() ) {