Ev3devMapping.ControlAttribute.GetTotalLength C# (CSharp) Method

GetTotalLength() public method

public GetTotalLength ( ) : ushort
return ushort
	public ushort GetTotalLength()
	{
		return (ushort)(CONTROL_ATTRIBUTE_HEADER_BYTES + length);
	}

Usage Example

Ejemplo n.º 1
0
	public void PutAttribute(ControlAttribute attribute)
	{
		if (ControlHeader.CONTROL_HEADER_BYTES + header.payload_length + attribute.GetTotalLength() > CONTROL_MAX_PAYLOAD_LENGTH)
			throw new ArgumentException ("Putting attribute would exceed maximum message length");

		attributes.Add (attribute);
		header.payload_length += attribute.GetTotalLength ();
	}
All Usage Examples Of Ev3devMapping.ControlAttribute::GetTotalLength