Vote count:
0
my android app send this message:
... data.addBytes(NUMBER, toByteArray(563.231)); PebbleKit.sendDataToPebble(getApplicationContext(), PEBBLE_APP_UUID, data); ...
in pebble:
case NUMBER: vibrateTest(); double aDouble=1.09; memcpy(&aDouble, t->value->data, sizeof(double));
static char buffer[] = "ASDASDASDASDASDASDAS"; char *point = &buffer[4]; snprintf(point, 15, "%d", (int)aDouble); text_layer_set_text(text_row1, buffer); break;
aDouble it seem to be always 0. (I expect 563) What I do wrong?
Thanks in advance,
asked 32 secs ago
Android to pebble app send a double, byte array to double conversion doesn't work
Aucun commentaire:
Enregistrer un commentaire