Documentation ¶
Index ¶
- Constants
- Variables
- func ReadPackets(ctx context.Context, id uint32, reader io.Reader) <-chan PacketData
- func ReliableStreamReader(ctx context.Context, id uint32, reader io.Reader, ch chan PacketData)
- func WritePacket(id, dataType uint32, writer io.Writer, data []byte) error
- type DeviceMetadata
- func (*DeviceMetadata) Descriptor() ([]byte, []int)
- func (m *DeviceMetadata) GetID() uint32
- func (m *DeviceMetadata) GetName() string
- func (m *DeviceMetadata) GetTypes() []uint32
- func (m *DeviceMetadata) Marshal() (dAtA []byte, err error)
- func (m *DeviceMetadata) MarshalTo(dAtA []byte) (int, error)
- func (m *DeviceMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DeviceMetadata) ProtoMessage()
- func (m *DeviceMetadata) Reset()
- func (m *DeviceMetadata) Size() (n int)
- func (m *DeviceMetadata) String() string
- func (m *DeviceMetadata) Unmarshal(dAtA []byte) error
- func (m *DeviceMetadata) XXX_DiscardUnknown()
- func (m *DeviceMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DeviceMetadata) XXX_Merge(src proto.Message)
- func (m *DeviceMetadata) XXX_Size() int
- func (m *DeviceMetadata) XXX_Unmarshal(b []byte) error
- type PacketData
- func (*PacketData) Descriptor() ([]byte, []int)
- func (m *PacketData) GetData() []byte
- func (m *PacketData) GetType() uint32
- func (m *PacketData) Marshal() (dAtA []byte, err error)
- func (m *PacketData) MarshalTo(dAtA []byte) (int, error)
- func (m *PacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PacketData) ProtoMessage()
- func (m *PacketData) Reset()
- func (m *PacketData) Size() (n int)
- func (m *PacketData) String() string
- func (m *PacketData) Unmarshal(dAtA []byte) error
- func (m *PacketData) XXX_DiscardUnknown()
- func (m *PacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PacketData) XXX_Merge(src proto.Message)
- func (m *PacketData) XXX_Size() int
- func (m *PacketData) XXX_Unmarshal(b []byte) error
- type PacketHeader
- func (*PacketHeader) Descriptor() ([]byte, []int)
- func (m *PacketHeader) GetCRC() uint32
- func (m *PacketHeader) GetID() uint32
- func (m *PacketHeader) GetMagic() uint32
- func (m *PacketHeader) GetTailSize() uint32
- func (m *PacketHeader) Marshal() (dAtA []byte, err error)
- func (m *PacketHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *PacketHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PacketHeader) ProtoMessage()
- func (m *PacketHeader) Reset()
- func (m *PacketHeader) Size() (n int)
- func (m *PacketHeader) String() string
- func (m *PacketHeader) Unmarshal(dAtA []byte) error
- func (m *PacketHeader) XXX_DiscardUnknown()
- func (m *PacketHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PacketHeader) XXX_Merge(src proto.Message)
- func (m *PacketHeader) XXX_Size() int
- func (m *PacketHeader) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ( PacketMotorConfig = iota PacketKinematicsConfig PacketSetState PacketGetState PacketGetStateResult )
Variables ¶
View Source
var ( AnyID uint32 = 0xFFFFFFFF Magic uint32 = 0xBADAB00A BufferSize = maxHeaderSize + 64 )
Functions ¶
func ReadPackets ¶
Reliable transport Packets always start with header
func ReliableStreamReader ¶
Types ¶
type DeviceMetadata ¶
type DeviceMetadata struct { ID uint32 `protobuf:"fixed32,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Types []uint32 `protobuf:"varint,3,rep,packed,name=Types,proto3" json:"Types,omitempty"` }
func (*DeviceMetadata) Descriptor ¶
func (*DeviceMetadata) Descriptor() ([]byte, []int)
func (*DeviceMetadata) GetID ¶
func (m *DeviceMetadata) GetID() uint32
func (*DeviceMetadata) GetName ¶
func (m *DeviceMetadata) GetName() string
func (*DeviceMetadata) GetTypes ¶
func (m *DeviceMetadata) GetTypes() []uint32
func (*DeviceMetadata) Marshal ¶
func (m *DeviceMetadata) Marshal() (dAtA []byte, err error)
func (*DeviceMetadata) MarshalToSizedBuffer ¶
func (m *DeviceMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DeviceMetadata) ProtoMessage ¶
func (*DeviceMetadata) ProtoMessage()
func (*DeviceMetadata) Reset ¶
func (m *DeviceMetadata) Reset()
func (*DeviceMetadata) Size ¶
func (m *DeviceMetadata) Size() (n int)
func (*DeviceMetadata) String ¶
func (m *DeviceMetadata) String() string
func (*DeviceMetadata) Unmarshal ¶
func (m *DeviceMetadata) Unmarshal(dAtA []byte) error
func (*DeviceMetadata) XXX_DiscardUnknown ¶
func (m *DeviceMetadata) XXX_DiscardUnknown()
func (*DeviceMetadata) XXX_Marshal ¶
func (m *DeviceMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeviceMetadata) XXX_Merge ¶
func (m *DeviceMetadata) XXX_Merge(src proto.Message)
func (*DeviceMetadata) XXX_Size ¶
func (m *DeviceMetadata) XXX_Size() int
func (*DeviceMetadata) XXX_Unmarshal ¶
func (m *DeviceMetadata) XXX_Unmarshal(b []byte) error
type PacketData ¶
type PacketData struct { Type uint32 `protobuf:"varint,1,opt,name=Type,proto3" json:"Type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` }
func (*PacketData) Descriptor ¶
func (*PacketData) Descriptor() ([]byte, []int)
func (*PacketData) GetData ¶
func (m *PacketData) GetData() []byte
func (*PacketData) GetType ¶
func (m *PacketData) GetType() uint32
func (*PacketData) Marshal ¶
func (m *PacketData) Marshal() (dAtA []byte, err error)
func (*PacketData) MarshalToSizedBuffer ¶
func (m *PacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PacketData) ProtoMessage ¶
func (*PacketData) ProtoMessage()
func (*PacketData) Reset ¶
func (m *PacketData) Reset()
func (*PacketData) Size ¶
func (m *PacketData) Size() (n int)
func (*PacketData) String ¶
func (m *PacketData) String() string
func (*PacketData) Unmarshal ¶
func (m *PacketData) Unmarshal(dAtA []byte) error
func (*PacketData) XXX_DiscardUnknown ¶
func (m *PacketData) XXX_DiscardUnknown()
func (*PacketData) XXX_Marshal ¶
func (m *PacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PacketData) XXX_Merge ¶
func (m *PacketData) XXX_Merge(src proto.Message)
func (*PacketData) XXX_Size ¶
func (m *PacketData) XXX_Size() int
func (*PacketData) XXX_Unmarshal ¶
func (m *PacketData) XXX_Unmarshal(b []byte) error
type PacketHeader ¶
type PacketHeader struct { Magic uint32 `protobuf:"fixed32,1,opt,name=Magic,proto3" json:"Magic,omitempty"` ID uint32 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` TailSize uint32 `protobuf:"varint,3,opt,name=TailSize,proto3" json:"TailSize,omitempty"` CRC uint32 `protobuf:"varint,4,opt,name=CRC,proto3" json:"CRC,omitempty"` }
func (*PacketHeader) Descriptor ¶
func (*PacketHeader) Descriptor() ([]byte, []int)
func (*PacketHeader) GetCRC ¶
func (m *PacketHeader) GetCRC() uint32
func (*PacketHeader) GetID ¶
func (m *PacketHeader) GetID() uint32
func (*PacketHeader) GetMagic ¶
func (m *PacketHeader) GetMagic() uint32
func (*PacketHeader) GetTailSize ¶
func (m *PacketHeader) GetTailSize() uint32
func (*PacketHeader) Marshal ¶
func (m *PacketHeader) Marshal() (dAtA []byte, err error)
func (*PacketHeader) MarshalToSizedBuffer ¶
func (m *PacketHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PacketHeader) ProtoMessage ¶
func (*PacketHeader) ProtoMessage()
func (*PacketHeader) Reset ¶
func (m *PacketHeader) Reset()
func (*PacketHeader) Size ¶
func (m *PacketHeader) Size() (n int)
func (*PacketHeader) String ¶
func (m *PacketHeader) String() string
func (*PacketHeader) Unmarshal ¶
func (m *PacketHeader) Unmarshal(dAtA []byte) error
func (*PacketHeader) XXX_DiscardUnknown ¶
func (m *PacketHeader) XXX_DiscardUnknown()
func (*PacketHeader) XXX_Marshal ¶
func (m *PacketHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PacketHeader) XXX_Merge ¶
func (m *PacketHeader) XXX_Merge(src proto.Message)
func (*PacketHeader) XXX_Size ¶
func (m *PacketHeader) XXX_Size() int
func (*PacketHeader) XXX_Unmarshal ¶
func (m *PacketHeader) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.