Documentation ¶
Overview ¶
Package rewind implements the Simple External Application rewind protocol as described at https://wiki.brandmeister.network/index.php/Simple_External_Application
Index ¶
Constants ¶
const ( Sign = "REWIND01" SignLength = len(Sign) CallLength = 10 DefaultKeepAliveInterval = time.Second * 5 DefaultTimeout = time.Second * 15 DefaultPort = 54005 )
Defaults
const ( ClassRewindControl = 0x0000 ClassSystemConsole = 0x0100 ClassServiceNotice = 0x0200 ClassDeviceData = 0x0800 ClassApplication = 0x0900 )
Packet classes
const ( TypeKeepAlive = ClassRewindControl + iota TypeClose TypeChallenge TypeAuthentication )
Control types
const ( TypeBusyNotice = ClassServiceNotice + iota TypeAddressNotice TypeBindingNotice )
Service Notice types
const ( ClassKairosData = ClassDeviceData + 0x00 ClassHyteraData = ClassDeviceData + 0x10 )
Device Data types for various vendors
const ( TypeKairosExternalServer = ClassKairosData + iota TypeKairosRemoteControl TypeKairosSNMPTrap )
Kairos Data types
const ( TypeHyteraPeerData = ClassHyteraData + iota TypeHyteraRDACData TypeHyteraMediaData )
Hytera Data types
const ( TypeConfiguration = ClassApplication + iota TypeSubscription TypeDMRDataBase = ClassApplication + 0x10 TypeDMRAudioBase = ClassApplication + 0x20 TypeDMREmbeddedData = ClassApplication + 0x27 TypeSuperHeader = ClassApplication + 0x28 TypeFailureCode = ClassApplication + 0x29 )
Application types
const ( FlagNone = 0 FlagRealTime1 = 1 << iota FlagRealTime2 FlagDefaultSet = FlagNone )
Flags
const ( RoleRepeaterAgent = 0x10 RoleApplication = 0x20 )
Roles
const ( // OptionSuperHeader enables sending of super header metadata OptionSuperHeader = 1 << iota // OptionLinearFrame enables sending of linear coded AMBE without FEC OptionLinearFrame )
Options
const ( DataLength = SignLength + 10 DescriptionLength = 96 SuperHeaderLength = 12 + 2*CallLength )
Packet sizes
const (
ServiceSimpleApplication = RoleApplication + 0
)
Services
const (
TypeReport = ClassSystemConsole + iota
)
System Console types
Variables ¶
var Debug bool
Debug enables debug messages
Functions ¶
This section is empty.
Types ¶
type AddressData ¶
AddressData contains a network address
type BindingData ¶
type BindingData []uint16
type Client ¶
type Client struct { KeepAlive time.Duration Timeout time.Duration // Description of the client Description string // RemoteID of the client RemoteID uint32 // Options Options uint32 // Subscriptions is a map of Target ID and session type Subscriptions map[uint32]SessionType // contains filtered or unexported fields }
Client implementing the Rewind protocol
func (*Client) Close ¶
Close the client socket and stop the receiver loop after it has been started by ListenAndServe.
func (*Client) ListenAndServe ¶
ListenAndServe starts the packet receiver and decoder. Decoded payloads that are not part of the Rewind protocol are sent to channel p.
type ConfigurationData ¶
type ConfigurationData uint32
ConfigurationData contains Options
func (ConfigurationData) Len ¶
func (c ConfigurationData) Len() int
type Data ¶
type Data struct { // Sign of protocol Sign [SignLength]byte // Type of data Type uint16 // Flags for data Flags uint16 // Sequence number Sequence uint32 // Length of data Length uint16 }
Data header
type SessionType ¶
type SessionType uint32
SessionType type of transmission
const ( PrivateVoice SessionType = 5 GroupVoice SessionType = 7 )
Session types
type SubscriptionData ¶
type SubscriptionData struct { // Type of session Type SessionType // Target ID Target uint32 }
SubscriptionData contains Session types
func (SubscriptionData) Len ¶
func (d SubscriptionData) Len() int
type SuperHeader ¶
type SuperHeader struct { // Type of session Type uint32 // Source ID Source uint32 // Target ID Target uint32 // SourceCall is the source call (or zeros) SourceCall Call // TargetCall is the target call (or zeros) TargetCall Call }
SuperHeader contains metadata about a transmission
func (SuperHeader) Len ¶
func (h SuperHeader) Len() int
type VersionData ¶
type VersionData struct { // RemoteID is the remote application ID RemoteID uint32 // Service type Service uint8 // Description of software and version Description [DescriptionLength]byte }
VersionData informs the server about the client