Documentation
¶
Index ¶
- Constants
- Variables
- func WatchDevices(ctx context.Context) (<-chan Result[DeviceEvent], error)
- type APNType
- type Access
- type Authentication
- type Band
- type Bearer
- type BearerEvent
- type BearerInfo
- type BearerStats
- type BusType
- type Capabilities
- type CellInfo
- type ConnectConfig
- type Device
- type DeviceEvent
- type DeviceEventType
- type Facility
- type FacilityLock
- type Feature
- type FirmwareUpdateInfo
- type FirmwareUpdateMethod
- type IPFamily
- type Info
- type InitialEPSConfig
- type Message
- type MessageConfig
- type MessageRef
- type MessageState
- type MessageStorage
- type MessageStorageInfo
- type Mode
- type Modem
- func (m *Modem) Access() Access
- func (m *Modem) Bands(ctx context.Context) ([]Band, error)
- func (m *Modem) Bearer(id uint64) (*Bearer, bool)
- func (m *Modem) Bearers() []*Bearer
- func (m *Modem) CancelUSSD(ctx context.Context) error
- func (m *Modem) Capabilities(ctx context.Context) (Capabilities, error)
- func (m *Modem) CellInfo(ctx context.Context) ([]CellInfo, error)
- func (m *Modem) ChangePIN(ctx context.Context, oldPIN, newPIN string) error
- func (m *Modem) Close() error
- func (m *Modem) Connect(ctx context.Context, cfg ConnectConfig) (*Bearer, error)
- func (m *Modem) CreateProfile(ctx context.Context, cfg ProfileConfig) (Profile, error)
- func (m *Modem) DeleteMessage(ctx context.Context, id uint32) error
- func (m *Modem) DeleteMessages(ctx context.Context, refs []MessageRef) error
- func (m *Modem) DeleteProfile(ctx context.Context, id int32) error
- func (m *Modem) DeleteStoredMessage(ctx context.Context, ref MessageRef) error
- func (m *Modem) DisconnectAll(ctx context.Context) error
- func (m *Modem) EnablePIN(ctx context.Context, pin string, enabled bool) error
- func (m *Modem) FacilityLocks(ctx context.Context) ([]FacilityLock, error)
- func (m *Modem) FirmwareUpdateInfo(ctx context.Context) (FirmwareUpdateInfo, error)
- func (m *Modem) Info(ctx context.Context) (Info, error)
- func (m *Modem) InitialEPSBearer(ctx context.Context) (InitialEPSConfig, error)
- func (m *Modem) InitialEPSSettings(ctx context.Context) (InitialEPSConfig, error)
- func (m *Modem) InitiateUSSD(ctx context.Context, text string) (USSDMessage, error)
- func (m *Modem) ListMessages(ctx context.Context) ([]Message, error)
- func (m *Modem) MBIMClient(ctx context.Context, slot uint8) (*mbimproto.Client, error)
- func (m *Modem) MessageStorages(ctx context.Context) (MessageStorageInfo, error)
- func (m *Modem) Modes(ctx context.Context) ([]Mode, Mode, error)
- func (m *Modem) NetworkStatus(ctx context.Context) (NetworkStatus, error)
- func (m *Modem) Port() Port
- func (m *Modem) PowerState(ctx context.Context) (PowerState, error)
- func (m *Modem) PreferredNetworks(ctx context.Context) ([]PreferredNetwork, error)
- func (m *Modem) Profiles(ctx context.Context) ([]Profile, error)
- func (m *Modem) Protocol() Protocol
- func (m *Modem) QMIClient(ctx context.Context, slot uint8) (*qcom.Client, error)
- func (m *Modem) ReadMessage(ctx context.Context, id uint32) (Message, error)
- func (m *Modem) ReadStoredMessage(ctx context.Context, ref MessageRef) (Message, error)
- func (m *Modem) Register(ctx context.Context, cfg RegisterConfig) error
- func (m *Modem) Reset(ctx context.Context) error
- func (m *Modem) RespondUSSD(ctx context.Context, text string) (USSDMessage, error)
- func (m *Modem) SAR(ctx context.Context) (SARState, error)
- func (m *Modem) SIMInfo(ctx context.Context) (SIMInfo, error)
- func (m *Modem) SIMSlots(ctx context.Context) ([]SIMSlot, error)
- func (m *Modem) ScanNetworks(ctx context.Context) ([]Operator, error)
- func (m *Modem) SendMessage(ctx context.Context, cfg MessageConfig) (SendResult, error)
- func (m *Modem) SendPDU(ctx context.Context, pdu []byte) (uint32, error)
- func (m *Modem) SendPIN(ctx context.Context, pin string) error
- func (m *Modem) SendPUK(ctx context.Context, puk, newPIN string) error
- func (m *Modem) SetBands(ctx context.Context, bands []Band) error
- func (m *Modem) SetCapabilities(ctx context.Context, technologies Technology) error
- func (m *Modem) SetFacilityLock(ctx context.Context, facility Facility, enabled bool, key string) error
- func (m *Modem) SetInitialEPSSettings(ctx context.Context, cfg InitialEPSConfig) (InitialEPSConfig, error)
- func (m *Modem) SetModes(ctx context.Context, mode Mode) error
- func (m *Modem) SetPacketServiceState(ctx context.Context, state PacketServiceState) error
- func (m *Modem) SetPowerState(ctx context.Context, state PowerState) error
- func (m *Modem) SetPreferredNetworks(ctx context.Context, networks []PreferredNetwork) error
- func (m *Modem) SetPrimarySIMSlot(ctx context.Context, slot uint8) error
- func (m *Modem) SetSAR(ctx context.Context, state SARState) error
- func (m *Modem) SetSignalThresholds(ctx context.Context, thresholds SignalThresholds) error
- func (m *Modem) Signal(ctx context.Context) (Signal, error)
- func (m *Modem) Status(ctx context.Context) (Status, error)
- func (m *Modem) StoreMessage(ctx context.Context, cfg MessageConfig) ([]Message, error)
- func (m *Modem) SupportedBands(ctx context.Context) ([]Band, error)
- func (m *Modem) UnblockFacilityLock(ctx context.Context, facility Facility, key string) error
- func (m *Modem) UpdateProfile(ctx context.Context, update ProfileUpdate) (Profile, error)
- func (m *Modem) WatchMessages(ctx context.Context) (<-chan Result[Message], error)
- func (m *Modem) WatchNetwork(ctx context.Context) (<-chan Result[NetworkStatus], error)
- func (m *Modem) WatchProfiles(ctx context.Context) (<-chan Result[[]Profile], error)
- func (m *Modem) WatchSIM(ctx context.Context) (<-chan Result[SIMInfo], error)
- func (m *Modem) WatchSignal(ctx context.Context) (<-chan Result[Signal], error)
- func (m *Modem) WatchStatus(ctx context.Context) (<-chan Result[Status], error)
- func (m *Modem) WatchUSSD(ctx context.Context) (<-chan Result[USSDMessage], error)
- type NetworkConfig
- type NetworkStatus
- type Operator
- type PacketServiceState
- type Port
- type PortRole
- type PortType
- type PowerState
- type PreferredNetwork
- type Profile
- type ProfileConfig
- type ProfileUpdate
- type Protocol
- type QMIEndpoint
- type QMIEndpointType
- type RadioSignal
- type RegisterConfig
- type RegistrationState
- type Result
- type SARState
- type SIMInfo
- type SIMSlot
- type SIMState
- type SendResult
- type Signal
- type SignalThresholds
- type SignalValue
- type Status
- type Technology
- type USBIdentity
- type USBInterface
- type USSDMessage
- type USSDState
Constants ¶
const ( ProtocolUnknown = contract.ProtocolUnknown ProtocolQMI = contract.ProtocolQMI ProtocolMBIM = contract.ProtocolMBIM )
const ( AccessAuto = contract.AccessAuto AccessProxy = contract.AccessProxy AccessDirect = contract.AccessDirect )
const ( TechnologyGSM = contract.TechnologyGSM TechnologyUMTS = contract.TechnologyUMTS TechnologyLTE = contract.TechnologyLTE TechnologyLTECatM = contract.TechnologyLTECatM TechnologyLTENB = contract.TechnologyLTENB TechnologyNR5GNSA = contract.TechnologyNR5GNSA TechnologyNR5GSA = contract.TechnologyNR5GSA TechnologyAny = contract.TechnologyAny )
const ( FeatureMultiSIM = contract.FeatureMultiSIM FeatureProfileManagement = contract.FeatureProfileManagement FeatureSMS = contract.FeatureSMS FeatureUSSD = contract.FeatureUSSD FeatureSignalThresholds = contract.FeatureSignalThresholds FeatureCellInfo = contract.FeatureCellInfo FeatureSAR = contract.FeatureSAR FeatureFirmwareUpdate = contract.FeatureFirmwareUpdate FeatureFacilityLocks = contract.FeatureFacilityLocks FeatureInitialEPSBearer = contract.FeatureInitialEPSBearer )
const ( IPFamilyUnknown = contract.IPFamilyUnknown IPFamilyIPv4 = contract.IPFamilyIPv4 IPFamilyIPv6 = contract.IPFamilyIPv6 IPFamilyIPv4v6 = contract.IPFamilyIPv4v6 )
const ( AuthenticationNone = contract.AuthenticationNone AuthenticationPAP = contract.AuthenticationPAP AuthenticationCHAP = contract.AuthenticationCHAP AuthenticationMSCHAPv2 = contract.AuthenticationMSCHAPv2 )
const ( APNTypeDefault = contract.APNTypeDefault APNTypeIMS = contract.APNTypeIMS APNTypeMMS = contract.APNTypeMMS APNTypeTethering = contract.APNTypeTethering APNTypeSUPL = contract.APNTypeSUPL APNTypeEmergency = contract.APNTypeEmergency APNTypeAny = contract.APNTypeAny )
const ( PowerStateUnknown = contract.PowerStateUnknown PowerStateOff = contract.PowerStateOff PowerStateLow = contract.PowerStateLow PowerStateOn = contract.PowerStateOn )
const ( SIMStateUnknown = contract.SIMStateUnknown SIMStateAbsent = contract.SIMStateAbsent SIMStateLocked = contract.SIMStateLocked SIMStateReady = contract.SIMStateReady SIMStateFailure = contract.SIMStateFailure )
const ( RegistrationUnknown = contract.RegistrationUnknown RegistrationIdle = contract.RegistrationIdle RegistrationSearching = contract.RegistrationSearching RegistrationHome = contract.RegistrationHome RegistrationRoaming = contract.RegistrationRoaming RegistrationDenied = contract.RegistrationDenied )
const ( PacketServiceUnknown = contract.PacketServiceUnknown PacketServiceAttaching = contract.PacketServiceAttaching PacketServiceAttached = contract.PacketServiceAttached PacketServiceDetaching = contract.PacketServiceDetaching PacketServiceDetached = contract.PacketServiceDetached )
const ( FacilityNetwork = contract.FacilityNetwork FacilityNetworkSubset = contract.FacilityNetworkSubset FacilityServiceProvider = contract.FacilityServiceProvider FacilityCorporate = contract.FacilityCorporate )
const ( MessageStateUnknown = contract.MessageStateUnknown MessageStateReceivedUnread = contract.MessageStateReceivedUnread MessageStateReceivedRead = contract.MessageStateReceivedRead MessageStateStoredUnsent = contract.MessageStateStoredUnsent MessageStateStoredSent = contract.MessageStateStoredSent )
const ( MessageStorageUnknown = contract.MessageStorageUnknown MessageStorageDevice = contract.MessageStorageDevice MessageStorageSIM = contract.MessageStorageSIM )
const ( USSDStateUnknown = contract.USSDStateUnknown USSDStateIdle = contract.USSDStateIdle USSDStateActive = contract.USSDStateActive USSDStateUserResponse = contract.USSDStateUserResponse USSDStateNetworkResponse = contract.USSDStateNetworkResponse USSDStateTerminated = contract.USSDStateTerminated )
const ( DevicePresent = contract.DevicePresent DeviceAdded = contract.DeviceAdded DeviceRemoved = contract.DeviceRemoved DeviceChanged = contract.DeviceChanged )
const ( FirmwareUpdateUnknown = contract.FirmwareUpdateUnknown FirmwareUpdateFastboot = contract.FirmwareUpdateFastboot FirmwareUpdateQDL = contract.FirmwareUpdateQDL FirmwareUpdateQDU = contract.FirmwareUpdateQDU )
const ( PortUnknown = contract.PortUnknown PortQMI = contract.PortQMI PortMBIM = contract.PortMBIM PortAT = contract.PortAT PortNetwork = contract.PortNetwork PortGPS = contract.PortGPS PortQCDM = contract.PortQCDM PortDebug = contract.PortDebug PortAudio = contract.PortAudio PortRoleUnknown = contract.PortRoleUnknown PortRolePrimary = contract.PortRolePrimary PortRoleSecondary = contract.PortRoleSecondary PortRolePPP = contract.PortRolePPP BusUnknown = contract.BusUnknown BusUSB = contract.BusUSB BusPlatform = contract.BusPlatform QMIEndpointUnknown = contract.QMIEndpointUnknown QMIEndpointHSIC = contract.QMIEndpointHSIC QMIEndpointHSUSB = contract.QMIEndpointHSUSB QMIEndpointPCIe = contract.QMIEndpointPCIe QMIEndpointEmbedded = contract.QMIEndpointEmbedded QMIEndpointBAMDMUX = contract.QMIEndpointBAMDMUX )
Variables ¶
var ( ErrNotSupported = contract.ErrNotSupported ErrClosed = errors.New("modem is closed") ErrProtocolUnknown = errors.New("modem control port protocol is unknown") ErrPortChanged = errors.New("modem control port changed since discovery") )
Functions ¶
func WatchDevices ¶
func WatchDevices(ctx context.Context) (<-chan Result[DeviceEvent], error)
WatchDevices reports an initial Present snapshot and later kernel-driven changes until ctx is canceled.
Types ¶
type Authentication ¶
type Authentication = contract.Authentication
type Bearer ¶
type Bearer struct {
// contains filtered or unexported fields
}
Bearer owns one modem-side packet data session.
func (*Bearer) Info ¶
func (b *Bearer) Info() BearerInfo
type BearerEvent ¶
type BearerEvent = contract.BearerEvent
type BearerInfo ¶
type BearerInfo = contract.BearerInfo
type BearerStats ¶
type BearerStats = contract.BearerStats
type Capabilities ¶
type Capabilities = contract.Capabilities
type ConnectConfig ¶
type ConnectConfig = contract.ConnectConfig
type DeviceEvent ¶
type DeviceEvent = contract.DeviceEvent
type DeviceEventType ¶
type DeviceEventType = contract.DeviceEventType
type FacilityLock ¶
type FacilityLock = contract.FacilityLock
type FirmwareUpdateInfo ¶
type FirmwareUpdateInfo = contract.FirmwareUpdateInfo
type FirmwareUpdateMethod ¶
type FirmwareUpdateMethod = contract.FirmwareUpdateMethod
type InitialEPSConfig ¶
type InitialEPSConfig = contract.InitialEPSConfig
type MessageConfig ¶
type MessageConfig = contract.MessageConfig
type MessageRef ¶
type MessageRef = contract.MessageRef
type MessageState ¶
type MessageState = contract.MessageState
type MessageStorage ¶
type MessageStorage = contract.MessageStorage
type MessageStorageInfo ¶
type MessageStorageInfo = contract.MessageStorageInfo
type Modem ¶
type Modem struct {
// contains filtered or unexported fields
}
Modem is one opened QMI or MBIM control node.
func Open ¶
Open opens a QMI or MBIM control port through the selected access method. The port protocol must come from kernel discovery or be set explicitly by the caller. Open never probes or falls back to another protocol.
func (*Modem) Capabilities ¶
func (m *Modem) Capabilities(ctx context.Context) (Capabilities, error)
func (*Modem) CreateProfile ¶
func (*Modem) DeleteMessages ¶
func (m *Modem) DeleteMessages(ctx context.Context, refs []MessageRef) error
func (*Modem) DeleteStoredMessage ¶
func (m *Modem) DeleteStoredMessage(ctx context.Context, ref MessageRef) error
func (*Modem) FacilityLocks ¶
func (m *Modem) FacilityLocks(ctx context.Context) ([]FacilityLock, error)
func (*Modem) FirmwareUpdateInfo ¶
func (m *Modem) FirmwareUpdateInfo(ctx context.Context) (FirmwareUpdateInfo, error)
func (*Modem) InitialEPSBearer ¶
func (m *Modem) InitialEPSBearer(ctx context.Context) (InitialEPSConfig, error)
func (*Modem) InitialEPSSettings ¶
func (m *Modem) InitialEPSSettings(ctx context.Context) (InitialEPSConfig, error)
func (*Modem) InitiateUSSD ¶
func (*Modem) MBIMClient ¶
MBIMClient opens an independently owned MBIM client using the modem's resolved device and access method. The caller must close the returned client. Direct clients share the process-wide MBIM dispatcher.
func (*Modem) MessageStorages ¶
func (m *Modem) MessageStorages(ctx context.Context) (MessageStorageInfo, error)
func (*Modem) NetworkStatus ¶
func (m *Modem) NetworkStatus(ctx context.Context) (NetworkStatus, error)
func (*Modem) PowerState ¶
func (m *Modem) PowerState(ctx context.Context) (PowerState, error)
func (*Modem) PreferredNetworks ¶
func (m *Modem) PreferredNetworks(ctx context.Context) ([]PreferredNetwork, error)
func (*Modem) QMIClient ¶
QMIClient opens an independently owned QMI client using the modem's resolved device and access method. The caller must close the returned client. Direct clients share the process-wide transport but own their QMI service client IDs.
func (*Modem) ReadMessage ¶
func (*Modem) ReadStoredMessage ¶
func (*Modem) RespondUSSD ¶
func (*Modem) SendMessage ¶
func (m *Modem) SendMessage(ctx context.Context, cfg MessageConfig) (SendResult, error)
func (*Modem) SetCapabilities ¶
func (m *Modem) SetCapabilities(ctx context.Context, technologies Technology) error
func (*Modem) SetFacilityLock ¶
func (*Modem) SetInitialEPSSettings ¶
func (m *Modem) SetInitialEPSSettings(ctx context.Context, cfg InitialEPSConfig) (InitialEPSConfig, error)
func (*Modem) SetPacketServiceState ¶
func (m *Modem) SetPacketServiceState(ctx context.Context, state PacketServiceState) error
func (*Modem) SetPowerState ¶
func (m *Modem) SetPowerState(ctx context.Context, state PowerState) error
SetPowerState requests a power state and waits for the modem to report it.
func (*Modem) SetPreferredNetworks ¶
func (m *Modem) SetPreferredNetworks(ctx context.Context, networks []PreferredNetwork) error
func (*Modem) SetPrimarySIMSlot ¶
func (*Modem) SetSignalThresholds ¶
func (m *Modem) SetSignalThresholds(ctx context.Context, thresholds SignalThresholds) error
func (*Modem) StoreMessage ¶
func (*Modem) UnblockFacilityLock ¶
func (*Modem) UpdateProfile ¶
func (*Modem) WatchMessages ¶
func (*Modem) WatchNetwork ¶
func (*Modem) WatchProfiles ¶
func (*Modem) WatchSignal ¶
func (*Modem) WatchStatus ¶
type NetworkConfig ¶
type NetworkConfig = contract.NetworkConfig
type NetworkStatus ¶
type NetworkStatus = contract.NetworkStatus
type PacketServiceState ¶
type PacketServiceState = contract.PacketServiceState
type PowerState ¶
type PowerState = contract.PowerState
type PreferredNetwork ¶
type PreferredNetwork = contract.PreferredNetwork
type ProfileConfig ¶
type ProfileConfig = contract.ProfileConfig
type ProfileUpdate ¶
type ProfileUpdate = contract.ProfileUpdate
type QMIEndpoint ¶
type QMIEndpoint = contract.QMIEndpoint
type QMIEndpointType ¶
type QMIEndpointType = contract.QMIEndpointType
type RadioSignal ¶
type RadioSignal = contract.RadioSignal
type RegisterConfig ¶
type RegisterConfig = contract.RegisterConfig
type RegistrationState ¶
type RegistrationState = contract.RegistrationState
type SendResult ¶
type SendResult = contract.SendResult
type SignalThresholds ¶
type SignalThresholds = contract.SignalThresholds
type SignalValue ¶
type SignalValue = contract.SignalValue
type Technology ¶
type Technology = contract.Technology
type USBIdentity ¶
type USBIdentity = contract.USBIdentity
type USBInterface ¶
type USBInterface = contract.USBInterface
type USSDMessage ¶
type USSDMessage = contract.USSDMessage