Ejemplo n.º 1
0
        /*
         * public async void WriteMD5()
         * {
         *  int i = 0;
         *  boolean flag;
         *  byte abyte1[];
         *  if(abyte0.length == 16)
         *      flag = true;
         *  else
         *      flag = false;
         *  v.a(flag);
         *  abyte1 = new byte[17];
         *  abyte1[0] = 4;
         *  for(; i < 16; i++)
         *      abyte1[i + 1] = abyte0[i];
         *
         *  return write(m_CharTest, abyte1);
         *
         * } // este no se pa que es
         *
         * public async void UpdateFirmware(int i, int j, int k, byte[] abyte0)
         * {
         *  sendFirmwareInfo(i, j, abyte0.Length, k);
         *  sendFirmwareData(abyte0);
         * } // pendiente
         *
         * private async void sendFirmwareData(byte[] abyte0)
         * {
         * /*
         *  int i;
         *  int j;
         *  int k;
         *  int l;
         *  v.d();
         *  i = abyte0.length;
         *  j = i / 20;
         *  v.a((new StringBuilder()).append("totalPackets = ").append(j).toString());
         *  m_FirmwareUpdatingProgress.total = i;
         *  m_FirmwareUpdatingProgress.progress = 0;
         *  k = 0;
         *  l = 0;
         * _L5:
         *  if(k >= j) goto _L2; else goto _L1
         * _L1:
         *  boolean flag1;
         *  byte abyte2[] = new byte[20];
         *  for(int k1 = 0; k1 < 20; k1++)
         *      abyte2[k1] = abyte0[k1 + k * 20];
         *
         *  flag1 = write(m_CharFirmwareData, abyte2);
         *  v.a(flag1);
         *  if(flag1) goto _L4; else goto _L3
         * _L3:
         *  return false;
         * _L4:
         *  IMiLiProfile.Progress progress1 = m_FirmwareUpdatingProgress;
         *  progress1.progress = 20 + progress1.progress;
         *  int l1 = l + 20;
         *  v.a((new StringBuilder()).append("transferedPackets = ").append(l1).toString());
         *  if(l1 >= 1000)
         *  {
         *      _sync();
         *      l1 = 0;
         *  }
         *  k++;
         *  l = l1;
         *    goto _L5
         * _L2:
         *  if(i % 20 == 0)
         *  {
         *      _sync();
         *      v.a("transferFirmwareData: complete");
         *      return true;
         *  }
         *  byte abyte1[] = new byte[i % 20];
         *  for(int i1 = 0; i1 < i % 20; i1++)
         *      abyte1[i1] = abyte0[i1 + j * 20];
         *
         *  boolean flag = write(m_CharFirmwareData, abyte1);
         *  v.a(flag);
         *  if(flag)
         *  {
         *      IMiLiProfile.Progress progress = m_FirmwareUpdatingProgress;
         *      progress.progress = progress.progress + i % 20;
         *      int j1 = l + i % 20;
         *      v.a((new StringBuilder()).append("transferedPackets = ").append(j1).toString());
         *      _sync();
         *      v.a("transferFirmwareData: complete");
         *      return true;
         *  }
         *    goto _L3
         *
         * } // pendiente
         *
         * private async void sendFirmwareInfo(int i, int j, int k, int l)
         * {
         *
         *  v.d();
         *  BluetoothGattCharacteristic bluetoothgattcharacteristic = m_CharControlPoint;
         *  byte abyte0[] = new byte[13];
         *  abyte0[0] = 7;
         *  abyte0[1] = (byte)i;
         *  abyte0[2] = (byte)(i >> 8);
         *  abyte0[3] = (byte)(i >> 16);
         *  abyte0[4] = (byte)(i >> 24);
         *  abyte0[5] = (byte)j;
         *  abyte0[6] = (byte)(j >> 8);
         *  abyte0[7] = (byte)(j >> 16);
         *  abyte0[8] = (byte)(j >> 24);
         *  abyte0[9] = (byte)k;
         *  abyte0[10] = (byte)(k >> 8);
         *  abyte0[11] = (byte)l;
         *  abyte0[12] = (byte)(l >> 8);
         *  return write(bluetoothgattcharacteristic, abyte0);
         *
         * } // pendiente
         */
        #endregion

        public async Task <bool> SyncData()
        {
            return(await activityTracker.SyncData());
        }