Example #1
0
 /// <summary>
 /// Downloads a portion of a meerstetter firmware update file (*.mefw) to the device.
 /// This method must be called several times to download the whole content of the file.
 /// This method converts the data base64url and sends it.
 /// </summary>
 /// <param name="address">Device Address. Use null to use the DefaultDeviceAddress defined on MeComQuerySet.</param>
 /// <param name="buffer">Portion of *.mefw file.</param>
 /// <param name="length">Length of the portion to download.</param>
 /// <exception cref="ComCommandException">when the command fails. Check the inner exception for details.</exception>
 public void DownloadFirmwareData(byte?address, byte[] buffer, int length)
 {
     try
     {
         MeComPacket txFrame = new MeComPacket('#', address);
         MeComVarConvert.AddString(txFrame.Payload, "BS");
         MeComVarConvert.AddBase64url(txFrame.Payload, buffer, length);
         meQuerySet.Set(txFrame);
     }
     catch (Exception Ex)
     {
         throw new ComCommandException(String.Format("DownloadFirmwareData failed: Address: {0}; Detail: {1}", address, Ex.Message), Ex);
     }
 }