Documentation ¶
Index ¶
Constants ¶
View Source
const ( BoolEntry = EntryType(iota) Int8Entry UInt8Entry IntEntry UIntEntry Float32Entry StringEntry ListEntry ModifyEntry )
View Source
const ( UDPPort = 28000 TCPPort = 27000 )
Pip boy ports
View Source
const ( PacketTypeKeepAlive = PacketType(iota) PacketTypeConnectionAccepted PacketTypeConnectionRefused PacketTypeDataUpdate PacketTypeMapUpdate PacketTypeCommand PacketTypeCommandResult PacketTypeCount )
Well-known packet types
View Source
const AutoDiscover string = `{"cmd": "autodiscover"}`
AutoDiscover is the command for autodiscovery
View Source
const (
Bytes32Bit = 4
)
Variables ¶
View Source
var ( //ErrShortEntryHeader indicates that not enough bytes were available to read a //data entry ErrShortEntryHeader = fmt.Errorf("not enough bytes for data entry header") //ErrShortData indicates that for the type indicated by the header, not //enough bytes remain for the vaulue expected ErrShortData = fmt.Errorf("not enough bytes for data entry value") )
View Source
var PipByteOrder = binary.LittleEndian
PipByteOrder is the binary endianness of integers in the pip protocol
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet struct { PacketType PacketType Body []byte // contains filtered or unexported fields }
Packet is the PIPProtocol wire format
func ReadPacket ¶
ReadPacket returns a packet from an io.Reader.
type PacketType ¶
type PacketType uint8
PacketType accounts for the possible packet types
func (PacketType) String ¶
func (i PacketType) String() string
Click to show internal directories.
Click to hide internal directories.