Example #1
0
        /// <summary>
        /// Removes a weather message from the time line
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        private async Task <bool> RemoveWeatherMessage(int ID)
        {
            try
            {
                //Construct Message ID
                List <byte> MessageID = new List <byte>();
                MessageID.AddRange(new byte[] { 0x61, 0xb2, 0x2b, 0xc8, 0x1e, 0x29, 0x46, 0x0d, 0xa2, 0x36, 0x3f, 0xe4, 0x09, 0xa4, 0x39 });
                MessageID.Add((byte)ID);
                Guid _ID = new Guid(MessageID.ToArray());


                //Send remove item command to Pebble
                P3bble.Messages.TimeLineCalenderRemoveMessage _tlcm = new P3bble.Messages.TimeLineCalenderRemoveMessage(_PebbleConnector.GetNextMessageIdentifier(), _ID);
                _tlcm.ToBuffer();
                await _PebbleConnector.Pebble.WriteTimeLineCalenderAsync(_tlcm);

                Log.Add("Remove weather forecast: " + ID.ToString());

                return(true);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception:" + ID);
            }

            return(true);
        }
        /// <summary>
        /// Remove the calender item from the pebble timeline
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        private async Task <bool> RemoveCalenderItem(Guid ID)
        {
            try
            {
                //Send remove item command to Pebble
                P3bble.Messages.TimeLineCalenderRemoveMessage _tlcm = new P3bble.Messages.TimeLineCalenderRemoveMessage(_PebbleConnector.GetNextMessageIdentifier(), ID);
                _tlcm.ToBuffer();
                await _PebbleConnector.Pebble.WriteTimeLineCalenderAsync(_tlcm);

                Log.Add("Remove appointment: " + ID.ToString());

                return(true);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception:" + ID);
            }

            return(true);
        }