hayes

package
v0.0.0-...-5372b76 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResetCmd         Cmd = "ATZ"
	InfoCmd              = "ATI%d"
	VolumnCmd            = "ATL%d"
	FaxClassesCmd        = "AT+FCLASS=?"
	FaxClassCmd          = "AT+FCLASS?"
	SetFaxClassCmd       = "AT+FCLASS=%s"
	CallerIDModesCmd     = "AT+VCID=?"
	CallerIDCmd          = "AT+VCID?"
	SetCallerIDCmd       = "AT+VCID=%s"
	AnswerCmd            = "ATA"
	HangupCmd            = "ATH0"
)
View Source
const (
	FaxClass0   FaxClass = "0"
	FaxClass1            = "1"
	FaxClass1_0          = "1.0"
	FaxClass2            = "2"
	FaxClass8            = "8"
)
View Source
const (
	CallerIDOff         CallerIDMode = "0"
	CallerIDOn                       = "1"
	CallerIDUnformatted              = "2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	Time   time.Time
	Name   string
	Number string
	// contains filtered or unexported fields
}

func (*Call) Block

func (c *Call) Block() error

type CallHandler

type CallHandler interface {
	Handle(c *Call)
}

type CallerIDMode

type CallerIDMode string

func ParseCallerIDMode

func ParseCallerIDMode(s string) (CallerIDMode, error)

ParseCallerIDMode parses a string and returns a CallerIDMode.

type Cmd

type Cmd string

func FmtCmd

func FmtCmd(c Cmd, a ...interface{}) Cmd

type FaxClass

type FaxClass string

func ParseFaxClass

func ParseFaxClass(s string) (FaxClass, error)

ParseFaxClass parses a string and returns a FaxClass.

type Modem

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

func Open

func Open(conn string) (*Modem, error)

func (*Modem) Answer

func (m *Modem) Answer() error

func (*Modem) CallerIDMode

func (m *Modem) CallerIDMode() (CallerIDMode, error)

CallerIDMode returns the current caller ID mode.

func (*Modem) CallerIDModes

func (m *Modem) CallerIDModes() ([]CallerIDMode, error)

CallerIDModes returns the supported caller ID modes.

func (*Modem) Close

func (m *Modem) Close()

func (*Modem) EnableSoftwareCache

func (m *Modem) EnableSoftwareCache(v bool)

func (*Modem) FaxClass

func (m *Modem) FaxClass() (FaxClass, error)

FaxClass returns the current fax class.

func (*Modem) FaxClasses

func (m *Modem) FaxClasses() ([]FaxClass, error)

FaxClasses returns the supported fax service classes.

func (*Modem) Hangup

func (m *Modem) Hangup() error

func (*Modem) Info

func (m *Modem) Info() ([]string, error)

func (*Modem) Reset

func (m *Modem) Reset() error

func (*Modem) Send

func (m *Modem) Send(req *Request) error

func (*Modem) SetCallHandler

func (m *Modem) SetCallHandler(ch CallHandler)

func (*Modem) SetCallerIDMode

func (m *Modem) SetCallerIDMode(mode CallerIDMode) error

SetCallerIDMode sets the caller ID mode.

func (*Modem) SetFaxClass

func (m *Modem) SetFaxClass(fc FaxClass) error

SetFaxClass sets the current fax class.

func (*Modem) SetVolume

func (m *Modem) SetVolume(n int) error

SetVolume sets the modem's speaker volume, if it has one. n must be 0 - 3

type Request

type Request struct {
	Cmd      Cmd
	Response chan *Response
}

func NewRequest

func NewRequest(c Cmd) *Request

func NewRequestFmt

func NewRequestFmt(c Cmd, a ...interface{}) *Request

type Response

type Response struct {
	Data string
	Err  error
}

Jump to

Keyboard shortcuts

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