Comm.transmit - Communications transmit queue full / Error in comm callback

Former Member
Former Member
Making my first CIQ app with an Android companion app. The goal is to send activity data to the Android device during the activity. The CIQ app seems to work pretty well most of the time but I keep getting this intermittent crash that I can't seem to figure out. Whenever this crash occurs, I see lots of "WARNING: Communications transmit queue full" followed by lots of "Error in comm callback" in the CIQ_LOG.TXT file. I'm assuming the CIQ app eventually consumes too much memory and crashes. I haven't been able to get the simulator's ADB connection to work properly so I'm not able to monitor the Comm operations while this is happening.

I have tried multiple solutions but none seems to work completely. My current strategy is to keep a running count of the Comm transmit queue and to not let the queue exceed 3 Comm messages. I don't know if I'm not doing this correctly or if it's just not a good solution.

TLDR: I can't get Comm.transmit to work reliably

Here's some relevant code:
function onTimerUpdate() {
var info = Activity.getActivityInfo();

...

hrCur = (info.currentHeartRate != null)?info.currentHeartRate:0;

if(hrCur > 0){

...

var comString = hrCur;

if(myTxQueueCounter < 3){
comListener = new CardioTrackCommListener(method(:onTransmitComplete));
Comm.transmit(comString, null, comListener);
myTxQueueCounter++;
}
else{
myTxStatus = "Queue";
}

}
}

...

function onTransmitComplete(status) {
if (status == CardioTrackCommListener.SUCCESS) {
myTxQueueCounter--;
myTxStatus = "OK";
} else {
myTxQueueCounter++;
myTxStatus = "Fail";
}
comListener = null;
Ui.requestUpdate();
}

...

class CardioTrackCommListener extends Comm.ConnectionListener {
static var SUCCESS = 0;
static var FAILURE = 1;

hidden var mCallback;

//! Constructor
//! @param callback The method to call on a result
function initialize(callback) {
Comm.ConnectionListener.initialize();
mCallback = callback;
}

//! Call the callback with a result of CardioTrackCommListener.SUCCESS
function onComplete() {
mCallback.invoke(SUCCESS);
}

//! Call the callback with a result of CardioTrackCommListener.FAILURE
function onError() {
mCallback.invoke(FAILURE);
}
}
  • Hi, I've been messing with this communication between Garmin and Android for quite some time and have not been able to make it work correctly. I am doing a very similar thing as you are - sending accelerometric data to the phone, but also receiving some control messages from the phone.

    I think that what you are encountering is not a question of how many messages there are in the queue, but how fast are you filling it. How fast does your timer run? Could you grant at least a few seconds between the messages?
  • I've filed a ticket to have this investigated. Are you using the 2.2.6 SDK, or is this happening with the 2.3.0 beta (or both)?