Represents the Appbank present on the Pebble.
Data structure gleaned from https://github.com/pebble/libpebble/blob/f230d8c96e3ffbf011adbba95443c447852ff707/pebble/pebble.py#L678
Ejemplo n.º 1
0
 /// <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;
     }
 }
Ejemplo n.º 2
0
 /// <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;
     }
 }
Ejemplo n.º 3
0
 public AppbankContentsReceivedEventArgs(Pebble.Endpoints endpoint, byte[] payload)
     : base(endpoint, payload)
 {
     AppBank = new AppBank(Payload);
 }
Ejemplo n.º 4
0
 public AppbankContentsReceivedEventArgs(Pebble.Endpoints endpoint, byte[] payload)
     : base(endpoint, payload)
 {
     AppBank = new AppBank(Payload);
 }