Porrey.Uwp.IoT.Devices.Ds1307.WriteMemory C# (CSharp) Method

WriteMemory() public method

public WriteMemory ( byte data ) : System.Threading.Tasks.Task
data byte
return System.Threading.Tasks.Task
		public async Task WriteMemory(byte[] data)
		{
			if (data.Length <= MEMORY_SIZE)
			{
				byte[] writeBuffer = new byte[MEMORY_SIZE + 1];
				writeBuffer[0] = MEMORY_ADDRESS;
                data.CopyTo(writeBuffer, 1);
				await this.WriteAsync(writeBuffer);
			}
			else
			{
				throw new ArgumentOutOfRangeException(string.Format("The buffer size cannot exceed {0} bytes.", MEMORY_SIZE));
			}
		}
	}