0

I have an issue where I when I send a message from the Android side (within a broadcast receiver) the messages don't always make it to the Pebble watch. It's inconsistent, sometimes it works.

I'm not getting an APP_MSG_BUSY result any longer (I am only trying to send exactly one message Android->Pebble).

This is quite simply how I'm sending the small amount of data (<64 bytes):

PebbleKit.sendDataToPebble(context, appUuid, dict)

I have the inbox and outbox size configured for their maximum.

And on the pebble side I've registered my callback and I deal with the message as so:

static void inbox_received_callback(DictionaryIterator *iter, void *context) {
   // A new message has been successfully received
   APP_LOG(APP_LOG_LEVEL_INFO, "Message received");
}

Note: There is also an inbox_dropped_callback registered but I've not included that for brevity.

I've properly N/ACK'd the message on the Android side (learned that the hard way), but I don't see a way to N/ACK the message on the Pebble side. I'm assuming that providing a callback is enough?

The good news is that it sometimes works, so I know I have everything configured properly. The bad news is that when it stops working it stops working almost entirely and for quite some time (15 minutes or longer). I suspect the inbox is filling, but I don't know how to check.

EDIT: I added both an Ack and a Nack handler on the Android side and I'm getting a Nack when I send a message. I need to figure out why my Pebble watch is not allowing things. Any guesses?

I also find this in logcat from Android:

10-05 13:16:37.206 8361-2610/? W/Pbl: [AppMessage]  there is not UUID for transactionId : -1

I have confirmed that my UUID is set properly.

BK-
  • 527
  • 7
  • 19

1 Answers1

0

This appears to be a timing issue. After researching online and finding the referenced post I added a psleep(1000) to my code and it works fine. I was sending the message while the app was still starting up.

I did find the event listener, but this is JS based and my app is written in C.

Hope this helps someone!

BK-
  • 527
  • 7
  • 19