/// <summary> /// Remove an app from the Pebble, using an App instance retrieved from the Appbank. /// </summary> /// <param name="app"></param> /// <param name="async">When true, this returns null immediately. Otherwise it waits for the event and sends /// the appropriate AppbankInstallMessageEventArgs.</param> /// <returns></returns> public AppbankInstallMessageEventArgs RemoveApp(AppBank.App app, bool async = false) { byte[] msg = new byte[1]; msg[0] = 2; msg = msg.Concat(BitConverter.GetBytes(app.ID)).ToArray(); msg = msg.Concat(BitConverter.GetBytes(app.Index)).ToArray(); if (BitConverter.IsLittleEndian) { Array.Reverse(msg, 1, 4); Array.Reverse(msg, 5, 4); } sendMessage(Endpoints.APP_MANAGER, msg); if (!async) { var wait = new EndpointSync<AppbankInstallMessageEventArgs>(this, Endpoints.APP_MANAGER); return wait.WaitAndReturn(); } else { return null; } }
/// <summary> /// Remove an app from the Pebble, using an App instance retrieved from the Appbank. /// </summary> /// <param name="app"></param> /// <param name="async">When true, this returns null immediately. Otherwise it waits for the event and sends /// the appropriate AppbankInstallMessageEventArgs.</param> /// <returns></returns> public AppbankInstallMessageEventArgs RemoveApp(AppBank.App app, bool async = false) { var msg = Util.Pack("!bII", 2, app.ID, app.Index); sendMessage(Endpoints.APP_MANAGER, msg); if (!async) { var wait = new EndpointSync<AppbankInstallMessageEventArgs>(this, Endpoints.APP_MANAGER); return wait.WaitAndReturn(); } else { return null; } }
public AppbankContentsReceivedEventArgs(Pebble.Endpoints endpoint, byte[] payload) : base(endpoint, payload) { AppBank = new AppBank(Payload); }
public AppbankContentsReceivedEventArgs(Pebble.Endpoints endpoint, byte[] payload) : base(endpoint, payload) { AppBank = new AppBank(Payload); }