Field Class

class Field

Represents a Field within a packet

__construct(string $description)

Creates a new Field

Parameters:
  • $description (string) – The field description

Returns:

A Field instance

Return type:

Field

start(int $start)

Set the start bit (zero indexed) of the field

If this method is not called (i.e. the start bit is not set) the field starts immediately after the preceding field or at bit 0 if there are none

Parameters:
  • $start (int) – The start bit

Returns:

A new instance of Field with the start bit

Return type:

Field

end(int $end)

Set the end bit (zero indexed) of the field

This method can only be called after Field::start

Parameters:
  • $end (int) – The end bit

Returns:

A new instance of Field with the end bit

Return type:

Field

length(int $length)

Set the bit length of the field

This method cannot be called if Field::end has been called

Parameters:
  • $length (int) – The bit

Returns:

A new instance of Field with the bit length

Return type:

Field