This commit is contained in:
Eric House 2020-09-05 14:56:03 -07:00
parent 3510268752
commit 8c3c1b59f6
2 changed files with 13 additions and 5 deletions

View file

@ -1045,8 +1045,9 @@ comms_augmentHostAddr( CommsCtxt* comms, XWEnv xwe, const CommsAddrRec* addr )
}
} /* comms_setHostAddr */
void comms_addMQTTDevID( CommsCtxt* comms, XP_PlayerAddr channelNo,
const MQTTDevID* devID )
void
comms_addMQTTDevID( CommsCtxt* comms, XP_PlayerAddr channelNo,
const MQTTDevID* devID )
{
XP_LOGFF( "(devID: " MQTTDevID_FMT ")", *devID );
XP_Bool found = XP_FALSE;
@ -2989,7 +2990,14 @@ augmentAddr( CommsAddrRec* destAddr, const CommsAddrRec* srcAddr )
}
if ( !!dest ) {
if ( 0 != XP_MEMCMP( dest, src, siz ) ) {
XP_LOGFF( "actually changing addr info for typ %s", ConnType2Str(typ) );
#ifdef DEBUG
CommsAddrRec dummy = {0};
if ( 0 == XP_MEMCMP( &dummy, dest, siz ) ) {
XP_LOGFF( "setting %s-type addr for first time", ConnType2Str(typ) );
} else if ( 0 != XP_MEMCMP( dest, src, siz ) ) {
XP_LOGFF( "actually changing addr info for typ %s", ConnType2Str(typ) );
}
#endif
XP_MEMCPY( dest, src, siz );
}
}

View file

@ -97,11 +97,11 @@ dvc_getMQTTDevID( XW_DUtilCtxt* dutil, XWEnv xwe, MQTTDevID* devID )
XP_UCHAR buf[32];
formatMQTTDevID( &tmp, buf, VSIZE(buf) );
/* This log statement is required by discon_ok2.py!!! (keep in sync) */
XP_LOGFF( "generated id: %s", buf );
XP_LOGFF( "generated id: %s; key: %s", buf, MQTT_DEVID_KEY );
#endif
}
*devID = tmp;
// LOG_RETURNF( MQTTDevID_FMT, *devID );
// LOG_RETURNF( MQTTDevID_FMT " key: %s", *devID, MQTT_DEVID_KEY );
}
typedef enum { CMD_INVITE, CMD_MSG, CMD_DEVGONE, } MQTTCmd;