Documentation
¶
Overview ¶
Package frame is the dev-mode wire between the device proxy, the relay in `nimbus native dev` and the app process on the laptop: typed, length-prefixed frames over TCP.
Index ¶
- Constants
- func HelloPayload(role byte, schema uint64) []byte
- func ParseHello(p []byte) (role byte, schema uint64, ok bool)
- func Reply(id uint32, rc byte, b []byte) []byte
- func SplitID(p []byte) (uint32, []byte, bool)
- func SplitReply(p []byte) (id uint32, rc byte, b []byte, ok bool)
- func WithID(id uint32, b []byte) []byte
- func Write(w io.Writer, t Type, payload []byte) error
- type Type
Constants ¶
View Source
const ( RoleDevice byte = 1 RoleApp byte = 2 )
Roles in a Hello frame.
Variables ¶
This section is empty.
Functions ¶
func HelloPayload ¶
HelloPayload is a Hello frame's payload.
func ParseHello ¶
ParseHello reads a Hello payload.
func SplitReply ¶
SplitReply splits a reply payload.
Types ¶
type Type ¶
type Type uint8
Type says what a frame carries.
const ( Hello Type = 1 // role byte + schema hash (u64 LE): who connected ToGo Type = 2 // host → Go async message (device → app) FromGo Type = 3 // Go → host async message (app → device) Call Type = 4 // host → Go sync call: id u32 + request CallReply Type = 5 // id u32 + rc u8 + reply HostCall Type = 6 // Go → host sync call: id u32 + request HostReply Type = 7 // id u32 + rc u8 + reply Reset Type = 8 // relay → device: a new app process is taking over )
Click to show internal directories.
Click to hide internal directories.