public static void sendLcdIdle() { var bitmap = createLcdIdle(); //Protocol.loadTemplate(0); BtProtocol.sendLcdBitmap(bitmap, MetaWatchService.WatchBuffers.IDLE); //Protocol.activateBuffer(); BtProtocol.updateDisplay(0); }
public static void processNotificationQueue() { if (isSending) { return; } else { isSending = true; } Thread thread = new Thread(() => { if (notificationQueue.Count > 0) { MetaWatchService.watchState = MetaWatchService.WatchStates.NOTIFICATION; MetaWatchService.WatchModes.NOTIFICATION = true; } while (notificationQueue.Count > 0) { NotificationType notification = notificationQueue.ElementAt(0); //Protocol.loadTemplate(2); if (notification.bitmap != null) { BtProtocol.sendLcdBitmap(notification.bitmap, MetaWatchService.WatchBuffers.NOTIFICATION); } // else if (notification.array != null) // BtProtocol.sendLcdArray(notification.array, MetaWatchService.WatchBuffers.NOTIFICATION); // else if (notification.buffer != null) // BtProtocol.sendLcdBuffer(notification.buffer, MetaWatchService.WatchBuffers.NOTIFICATION); BtProtocol.updateDisplay(2); if (notification.vibratePattern._vibrate) { BtProtocol.vibrate(notification.vibratePattern.on, notification.vibratePattern.off, notification.vibratePattern.cycles); } // Log.d(MetaWatch.TAG, "notif bitmap sent from thread"); MetaWatchService.nap(notification.timeout); if (MetaWatchService.WatchModes.CALL == true) { isSending = false; return; } notificationQueue.RemoveAt(0); } isSending = false; exitNotification(); } ); thread.Start(); }