Documentation
¶
Index ¶
- Constants
- func Close(object *Object) error
- func CloseSession(session nxtypes.SessionHandle) error
- func PackIPCRequest(rq *Request, object Object, marshalBuffer *[0x40]uint32) error
- func PackMessage(msg *PackedMessage, buffer *[0x40]uint32) error
- func Send(object Object, rq *Request, rs *ResponseFmt) error
- func UnflattenResponse(msg *Message, rs *ResponseFmt, object Object) error
- func UnpackIPCMessage(msg *Message, buffer *[0x40]uint32) error
- type Buffer
- type BufferFamily
- type Direction
- type Domain
- type Family
- type Message
- type Object
- type PackedMessage
- type Request
- type ResponseFmt
- type Type
Constants ¶
const ( BufferFamilyA BufferFamily = 0 BufferFamilyB BufferFamily = 1 BufferFamilyC BufferFamily = 2 BufferFamilyX BufferFamily = 3 DirectionInput Direction = 1 // 0b01 DirectionOutput Direction = 2 // 0b10 FamilyA Family = 1 // 0b01 FamilyB Family = 1 // 0b01 FamilyX Family = 2 // 0b10 FamilyC Family = 2 // 0b10 )
Variables ¶
This section is empty.
Functions ¶
func CloseSession ¶
func CloseSession(session nxtypes.SessionHandle) error
func PackIPCRequest ¶
PackIPCRequest is equivalent to libtransistor ipc_pack_request call
func PackMessage ¶
func PackMessage(msg *PackedMessage, buffer *[0x40]uint32) error
PackMessage is equivalent to libtransistor ipc_pack_message call
func UnflattenResponse ¶
func UnflattenResponse(msg *Message, rs *ResponseFmt, object Object) error
UnflattenResponse is equivalent to libtransistor ipc_unflatten_response
func UnpackIPCMessage ¶
UnpackIPCMessage is equivalent to libtransistor ipc_unpack call
Types ¶
type BufferFamily ¶
type BufferFamily int
type Message ¶
type Message struct {
MessageType uint16
RawDataSectionSize uint32 // in Words
NumXDescriptors uint32
NumADescriptors uint32
NumBDescriptors uint32
NumWDescriptors uint32
CDescriptorFlags uint32
XDescriptors []uint32
ADescriptors []uint32
BDescriptors []uint32
WDescriptors []uint32
CDescriptors []uint32
NumCopyHandles uint32
NumMoveHandles uint32
CopyHandles []uint32
MoveHandles []uint32
HasPID bool
PID uint64
PrePadding int
PostPadding int
DataSection []uint32
}
Message Describes an incoming IPC message. Used as an intermediate during unpacking.
type Object ¶
type Object struct {
ObjectID int32 // -1 if this represents a session, >= 0 if this represents a domain object
Content uint64
IsBorrowed bool
}
IPCObject Represents either an object within an IPC domain or a standalone object
func (Object) GetSession ¶
func (o Object) GetSession() nxtypes.SessionHandle
func (*Object) SetSession ¶
type PackedMessage ¶
type PackedMessage struct {
Type Type
Buffers []*Buffer
DataSection []byte
CopyHandles []nxtypes.Handle
MoveHandles []nxtypes.Handle
SendPID bool
}
PackedMessage represents a IPC Message Data to be packed
type Request ¶
type Request struct {
Type Type
Buffers []*Buffer
RequestID uint32
RawData []byte
SendPID bool
CopyHandles []nxtypes.Handle
MoveHandles []nxtypes.Handle
Objects []Object
CloseObject bool
}
Request Represents an unmarshalled outgoing IPC request see http://switchbrew.org/index.php?title=IPC_Marshalling#IPC_Command_Structure
func MakeDefaultRequest ¶
func (*Request) SetRawDataFromUint32Slice ¶
func (*Request) SetRawDataFromUint64 ¶
type ResponseFmt ¶
type ResponseFmt struct {
CopyHandles []nxtypes.Handle
MoveHandles []nxtypes.Handle
Objects []Object
RawData []byte
HasPID bool
PID *uint64
}
ResponseFmt Describes format expectations for an incoming IPC response
Represents the expectations for an IPC response and contains pointers to buffers for response data to be written to.