From 436d3c2ad002b048e63fd38075a26c9e5991da7a Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 4 Jun 2020 11:37:07 -0700 Subject: [PATCH] fix crashes rematching from linux a games started on android Didn't handle the case where a game included NFC or BT. I should probably be stripping those on receipt as I think the android side does when the devices doesn't support 'em. And that in turn should be common/ code. So just fix it for now so testing can continue. --- xwords4/common/nli.c | 6 ++++++ xwords4/linux/linuxbt.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xwords4/common/nli.c b/xwords4/common/nli.c index a2e8dcc5b..18c23a835 100644 --- a/xwords4/common/nli.c +++ b/xwords4/common/nli.c @@ -58,6 +58,12 @@ nli_init( NetLaunchInfo* nli, const CurGameInfo* gi, const CommsAddrRec* addr, case COMMS_CONN_MQTT: nli_setMQTTDevID( nli, &addr->u.mqtt.devID ); break; + case COMMS_CONN_BT: + XP_STRCAT( nli->btAddress, addr->u.bt.btAddr.chars ); + XP_STRCAT( nli->btName, addr->u.bt.hostName ); + break; + case COMMS_CONN_NFC: + break; default: XP_ASSERT(0); break; diff --git a/xwords4/linux/linuxbt.c b/xwords4/linux/linuxbt.c index 3f9979f6c..c06a060bc 100644 --- a/xwords4/linux/linuxbt.c +++ b/xwords4/linux/linuxbt.c @@ -289,10 +289,10 @@ lbt_register( LinBtStuff* btStuff, unsigned short l2_psm, // and disconnect session = sdp_connect( BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY ); if ( NULL == session ) { - XP_LOGF( "%s: sdp_connect->%s", __func__, strerror(errno) ); + XP_LOGFF( "sdp_connect->%s", strerror(errno) ); + } else { + sdp_record_register( session, &record, 0 ); } - XP_ASSERT( NULL != session ); - sdp_record_register( session, &record, 0 ); // cleanup sdp_data_free( psm );