//BLOB implementation is available in extended version
//please contact info@iq2-development.de for more information
#if false
using iq2dev.com.IQCommLib;
using iq2dev.com.IQCommLib.BLOB;
using iq2dev.com.IQCommLib.Example;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iqCommLib.Example
{
    static internal class BlobExample
    {
		const Int16 READ_BLOB_ID = -4096;

		public static void BLOB_ReadWrite_Example(ProtocolCommunicator protocolCommunicator)
		{
			var blob = new Blob(protocolCommunicator);
			blob.LoggingEvent += Program.LoggingEvent;

			var blobData = blob.ReadBlob(READ_BLOB_ID);

			Console.WriteLine($"BLOB ID {READ_BLOB_ID}, \n Data {string.Join(":", blobData.ToArray()):2X} \n");

			blobData.Reverse();

			blob.WriteBlob(-READ_BLOB_ID, blobData, false);

			//validate
			Console.WriteLine($"Validate written data\n");
			var blobDataChanged = blob.ReadBlob(READ_BLOB_ID);

			if (blobDataChanged.SequenceEqual(blobData) == false)
			{
				throw new Exception($"Writing BLOB failed. they are not equal: \n" +
					$"written: {string.Join(":", blobData.ToArray()):2X}" +
					$"actual: {string.Join(":", blobDataChanged.ToArray()):2X}");
			}
			blob.LoggingEvent -= Program.LoggingEvent;
		}
	}
}

#endif