pc

package
v0.0.0-...-1c86a79 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pc provides Point Code converting from some variants and translation to IP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PointCode

type PointCode struct {
	// contains filtered or unexported fields
}

PointCode represents a Signaling Point Code with its variant.

func NewPointCode

func NewPointCode(raw uint32, variant Variant) *PointCode

NewPointCode creates a new PointCode from raw(uint32) value.

func NewPointCodeFrom

func NewPointCodeFrom(pc string, variant Variant) *PointCode

NewPointCodeFrom creates a new PointCode from formatted Signaling Point Code.

func (*PointCode) ConvertTo

func (pc *PointCode) ConvertTo(variant Variant) (string, error)

ConvertTo converts raw Signaling Point Code into specified Variant and returns converted PC value in string. The converted value is stored in PointCode and can be retrieved with String() without re-calculation.

func (*PointCode) String

func (pc *PointCode) String() string

String returns PointCode in formatted string.

func (*PointCode) Uint32

func (pc *PointCode) Uint32() uint32

Uint32 returns PointCode values in uint32.

func (*PointCode) Variant

func (pc *PointCode) Variant() string

Variant returns the variant of PointCode in string.

type Variant

type Variant string

Variant is a variant of Signaling Point Code represented in string.

const (
	VariantNone Variant = ""
	Variant383  Variant = "3-8-3"   // ITU
	Variant437  Variant = "4-3-7"   // ITU
	Variant4343 Variant = "4-3-4-3" // ITU
	Variant446  Variant = "4-4-6"   // ??
	Variant545  Variant = "5-4-5"   // ??
	Variant662  Variant = "6-6-2"   // ??
	Variant68   Variant = "6-8"     // ??
	Variant745  Variant = "7-4-5"   // Japan
	Variant77   Variant = "7-7"     // ??
	Variant888  Variant = "8-8-8"   // ANSI & China
)

PointCode variant definitions.

func (Variant) BitLength

func (v Variant) BitLength() int

BitLength returns the defined bit length of Variant in int.

func (Variant) String

func (v Variant) String() string

String returns Variant in string representation.

Jump to

Keyboard shortcuts

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