multiplexer

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeParameterNegotiation
	TypeParameterNegotiation uint8 = 0x20

	// TypeTest used to check the RFCOMM connection
	TypeTest uint8 = 0x08

	// TypeFlowControlOn flow control mechanism which applies to all channels between two RFCOMM entities
	TypeFlowControlOn uint8 = 0x28

	// TypeFlowControlOff no flow control mechanism which applies to all channels between two RFCOMM entities
	TypeFlowControlOff uint8 = 0x18

	// TypeModemStatus a flow control mechanism which applies to a single channel
	TypeModemStatus uint8 = 0x38

	// TypeRemotePortNegotiation The Remote Port Negotiation (RPN) command is used to set communication settings at the remote end of a data link connection.
	TypeRemotePortNegotiation uint8 = 0x24

	// TypeRemoteLineStatus Sent when device needs to tell the other end of the link about an error
	TypeRemoteLineStatus uint8 = 0x14

	// TypeNotSupported sent whenever a device receives a command it does not support.
	TypeNotSupported uint8 = 0x04
)
View Source
const (
	RemotePortNegotiationSetupLength   uint8 = 8
	RemotePortNegotiationRequestLength uint8 = 1
)
View Source
const (
	MaskBaudRate uint8 = iota
	MaskDataBits
	MaskStopBits
	MaskParity
	MaskParityType
	MaskXONChar
	MaskXOFFChar
	MaskInputXONOFF
	MaskOutputXONOFF
	MaskInputRTR
	MaskOutputRTR
	MaskInputRTC
	MaskOutputRTC
)
View Source
const EA uint8 = 0x01
View Source
const FlowControlLength uint8 = 0
View Source
const HeaderSize int = 2
View Source
const ModemStatusLength uint8 = 2
View Source
const NotSupportedLength uint8 = 0x01
View Source
const ParameterNegotiationLength uint8 = 8

ParamsLength The length field in a PN message is always set to 8, and the value field contains 8 bytes

View Source
const RemoteLineStatusLength uint8 = 2
View Source
const TestLength uint8 = 1

Variables

This section is empty.

Functions

func MarshalBinary

func MarshalBinary(p Multiplexer) ([]byte, error)

Types

type FlowControlOff

type FlowControlOff struct {
	CommandResponse uint8
}

FlowControlOff The flow control command is used to handle the aggregate flow. When either entity is not able to receive information it transmits the FCoff command. The opposite entity is not allowed to transmit frames except on the control channel (DLC=0). [ETSI TS 101 369 V7.1.0, 5.4.6.3.6 ]

func (*FlowControlOff) GetCommandResponse

func (m *FlowControlOff) GetCommandResponse() uint8

func (*FlowControlOff) Len

func (m *FlowControlOff) Len() uint8

func (*FlowControlOff) MarshalBinary

func (m *FlowControlOff) MarshalBinary() ([]byte, error)

func (*FlowControlOff) SetCommandResponse

func (m *FlowControlOff) SetCommandResponse(l uint8)

func (*FlowControlOff) Type

func (m *FlowControlOff) Type() uint8

func (*FlowControlOff) UnmarshalBinary

func (m *FlowControlOff) UnmarshalBinary(b []byte) error

type FlowControlOn

type FlowControlOn struct {
	CommandResponse uint8
}

FlowControlOn The flow control command is used to handle the aggregate flow. When either entity is able to receive new information it transmits this command. [ETSI TS 101 369 V7.1.0, 5.4.6.3.5 ]

func (*FlowControlOn) GetCommandResponse

func (m *FlowControlOn) GetCommandResponse() uint8

func (*FlowControlOn) Len

func (m *FlowControlOn) Len() uint8

func (*FlowControlOn) MarshalBinary

func (m *FlowControlOn) MarshalBinary() ([]byte, error)

func (*FlowControlOn) SetCommandResponse

func (m *FlowControlOn) SetCommandResponse(l uint8)

func (*FlowControlOn) Type

func (m *FlowControlOn) Type() uint8

func (*FlowControlOn) UnmarshalBinary

func (m *FlowControlOn) UnmarshalBinary(b []byte) error

type ModemStatus

type ModemStatus struct {
	CommandResponse uint8

	ServerChannel uint8

	FlowControl uint8

	ReadyToCommunicate uint8

	ReadyToReceive uint8

	IncomingCall uint8

	DataValid uint8
}

ModemStatus It is desired to convey virtual V.24 control signals to a data stream, this is done by sending the MSC command. The MSC command has one mandatory control signal byte and an optional break signal byte. This command is only relevant when the basic option is chosen. [ETSI TS 101 369 V7.1.0, 5.4.6.3.7 ]

func (*ModemStatus) GetCommandResponse

func (m *ModemStatus) GetCommandResponse() uint8

func (*ModemStatus) Len

func (m *ModemStatus) Len() uint8

func (*ModemStatus) MarshalBinary

func (m *ModemStatus) MarshalBinary() ([]byte, error)

func (*ModemStatus) SetCommandResponse

func (m *ModemStatus) SetCommandResponse(l uint8)

func (*ModemStatus) Type

func (m *ModemStatus) Type() uint8

func (*ModemStatus) UnmarshalBinary

func (m *ModemStatus) UnmarshalBinary(b []byte) error

type Multiplexer

type Multiplexer interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler

	Type() uint8
	Len() uint8

	GetCommandResponse() uint8
	SetCommandResponse(l uint8)
}

func UnmarshalBinary

func UnmarshalBinary(data []byte) (Multiplexer, error)

type NotSupported

type NotSupported struct {
	CommandResponse uint8

	NSCommandResponse uint8

	CommandType uint8
}

func (*NotSupported) GetCommandResponse

func (m *NotSupported) GetCommandResponse() uint8

func (*NotSupported) Len

func (m *NotSupported) Len() uint8

func (*NotSupported) MarshalBinary

func (m *NotSupported) MarshalBinary() ([]byte, error)

func (*NotSupported) SetCommandResponse

func (m *NotSupported) SetCommandResponse(l uint8)

func (*NotSupported) Type

func (m *NotSupported) Type() uint8

func (*NotSupported) UnmarshalBinary

func (m *NotSupported) UnmarshalBinary(b []byte) error

type ParameterNegotiation

type ParameterNegotiation struct {

	// CommandResponse
	CommandResponse uint8

	// DLCI Data link connection for which parameters are being negotiated
	ServerChannel uint8

	// FrameTypes The type of frames used to carry information on the channel
	// UIH frames indicated by the value 0x1000
	FrameType uint8

	// ConvergenceLayer RFCOMM uses Type 1 (unstructured octet stream) 0x0000
	// in versions after 1.0b this may also be set to 0x0F to enable credit
	// based flow control
	ConvergenceLayer uint8

	// CreditBasedFlowControl overwrites values for ConvergenceLayer and FrameType
	CreditBasedFlowControl bool

	// Priority Assign a priority to the data link connection: 0 (lowest) - 63 (highest)
	Priority uint8

	// Timer In RFCOMM is the timer elapses, the connection is closed down. The
	// timers value is not negotiable but is fixed at 60s. This field is set to
	// 0 to indicate that the timer is not negotiable
	Timer uint8

	// MaxSize The maximum size of the frame
	MaxSize uint16

	// MaxRetransmissions The maximum number of retransmissions. Because the
	// Bluetooth baseband gives RFCOMM a reliable transport layer, RFCOMM will
	// not retransmit, so this value is set to zero
	MaxRetransmissions uint8

	// WindowSize The window size for error recovery mode. RFCOMM uses basic
	// mode, so these bits are not interpreted by RFCOMM
	WindowSize uint8
}

ParameterNegotiation Before a DLC is set up using the mechanism in subclause 5.4.1, the TE and MS must agree on the parameters to be used for that DLC. These parameters are determined by parameter negotiation. [ETSI TS 101 369 V7.1.0, 5.4.6.3.1 ]

func (*ParameterNegotiation) GetCommandResponse

func (p *ParameterNegotiation) GetCommandResponse() uint8

func (*ParameterNegotiation) Len

func (p *ParameterNegotiation) Len() uint8

func (*ParameterNegotiation) MarshalBinary

func (p *ParameterNegotiation) MarshalBinary() ([]byte, error)

Marshal ...

func (*ParameterNegotiation) SetCommandResponse

func (p *ParameterNegotiation) SetCommandResponse(l uint8)

func (*ParameterNegotiation) Type

func (p *ParameterNegotiation) Type() uint8

func (*ParameterNegotiation) UnmarshalBinary

func (p *ParameterNegotiation) UnmarshalBinary(b []byte) error

Unmarshal ...

type RemoteLineStatus

type RemoteLineStatus struct {
	CommandResponse uint8

	ServerChannel uint8

	LineStatus uint8
}

func (*RemoteLineStatus) GetCommandResponse

func (m *RemoteLineStatus) GetCommandResponse() uint8

func (*RemoteLineStatus) Len

func (m *RemoteLineStatus) Len() uint8

func (*RemoteLineStatus) MarshalBinary

func (m *RemoteLineStatus) MarshalBinary() ([]byte, error)

func (*RemoteLineStatus) SetCommandResponse

func (m *RemoteLineStatus) SetCommandResponse(l uint8)

func (*RemoteLineStatus) Type

func (m *RemoteLineStatus) Type() uint8

func (*RemoteLineStatus) UnmarshalBinary

func (m *RemoteLineStatus) UnmarshalBinary(b []byte) error

type RemotePortNegotiation

type RemotePortNegotiation struct {

	// CommandResponse
	CommandResponse uint8

	// DLCI is composed of a direction bit and a 5 bit server number 1 - 30
	ServerChannel uint8

	Setup bool
	// contains filtered or unexported fields
}

RemotePortNegotiation Remote Port Negotiation used to set communication settings at the remote end of the data link connection

func (*RemotePortNegotiation) Change

func (p *RemotePortNegotiation) Change(mask uint8, value uint8)

func (*RemotePortNegotiation) GetCommandResponse

func (p *RemotePortNegotiation) GetCommandResponse() uint8

func (*RemotePortNegotiation) IsChanged

func (p *RemotePortNegotiation) IsChanged(mask uint8) bool

func (*RemotePortNegotiation) Len

func (p *RemotePortNegotiation) Len() uint8

func (*RemotePortNegotiation) MarshalBinary

func (p *RemotePortNegotiation) MarshalBinary() ([]byte, error)

Marshal ...

func (*RemotePortNegotiation) SetCommandResponse

func (p *RemotePortNegotiation) SetCommandResponse(l uint8)

func (*RemotePortNegotiation) Type

func (p *RemotePortNegotiation) Type() uint8

func (*RemotePortNegotiation) UnmarshalBinary

func (p *RemotePortNegotiation) UnmarshalBinary(b []byte) error

Unmarshal ...

func (*RemotePortNegotiation) Value

func (p *RemotePortNegotiation) Value(mask uint8) uint8

type Test

type Test struct {
	CommandResponse uint8

	Data uint8
}

Test The test command is used to test the connection between MS and the TE. The length byte describes the number of values bytes, which are used as a verification pattern. The opposite entity shall respond with exactly the same value bytes. [ETSI TS 101 369 V7.1.0, 5.4.6.3.4 ]

func (*Test) GetCommandResponse

func (m *Test) GetCommandResponse() uint8

func (*Test) Len

func (m *Test) Len() uint8

func (*Test) MarshalBinary

func (m *Test) MarshalBinary() ([]byte, error)

func (*Test) SetCommandResponse

func (m *Test) SetCommandResponse(l uint8)

func (*Test) Type

func (m *Test) Type() uint8

func (*Test) UnmarshalBinary

func (m *Test) UnmarshalBinary(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL