0

I'm trying to send a message from an Android companion app to a Pebble watchface app, but this fails with an APP_MSG_BUSY error. Reading the logs, I can reconstruct the following sequence of events, which is happening repeatedly:

  1. Pebble app calls app_message_outbox_send.
  2. Android companion app receives PebbleDataReceiver.receiveData call.
  3. Android companion app calls PebbleDataReceiver.sendAckToPebble(context, id).
  4. Pebble app receives outbox_sent call.
  5. Android companion app does some work which takes less about 70ms.
  6. Android companion app calls PebbleKit.sendDataToPebble.
  7. Pebble app receives inbox_dropped call with APP_MSG_BUSY.
  8. adb logcat shows the following warnings:

Pbl : [AppMessage] there is not UUID for transactionId : -1
Pbl : [JsInAppMessageHandler] sendAckNackToJs: run: can not send ack message to javascript code because uuid is null

APP_MSG_BUSY suggests there is an incoming or outgoing message in progress. However, you can see from the events above that there is no outgoing message. Also, this is happening for every incoming message, even the first that the Pebble app receives after restarting.

Can anyone offer some insight into what's going on here?

Joshua Tacoma
  • 408
  • 5
  • 13

1 Answers1

0

I found my mistake: when I called app_message_open, I passed a value for size_inbound that was too small to receive any of the messages that were being sent. Unfortunately, the AppMessageResult given to my inbox_dropped function wasn't APP_MSG_BUFFER_OVERFLOW as one might expect, but APP_MSG_BUSY.

Now for sheer speculation: what might have exacerbated this was that size_outbound was large enough. In fact, my mistake was swapping the size_inbound and size_outbound arguments. Maybe, by some logic, it didn't make sense to send APP_MSG_BUFFER_OVERFLOW because at least one of the buffers was large enough?

Joshua Tacoma
  • 408
  • 5
  • 13