qmi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DMSGetCapabilities uint16 = 0x0020
	DMSGetManufacturer uint16 = 0x0021
	DMSGetModel        uint16 = 0x0022
	/* Defined in frame.go / 在 frame.go 中定义
	DMSGetDeviceRevID         uint16 = 0x0023
	DMSUIMGetState      uint16 = 0x0044
	DMSUIMVerifyPIN     uint16 = 0x0028
	*/
	DMSGetMSISDN           uint16 = 0x0024
	DMSGetPowerState       uint16 = 0x0026
	DMSGetHardwareRevision uint16 = 0x002C
	DMSGetTime             uint16 = 0x002F
	DMSGetPRLVersion       uint16 = 0x0030
	DMSGetActivationState  uint16 = 0x0031
	DMSUIMSetPINProtection uint16 = 0x0027
	DMSUIMUnblockPIN       uint16 = 0x0029
	DMSUIMChangePIN        uint16 = 0x002A
	DMSGetUserLockState    uint16 = 0x0034
	DMSSetUserLockState    uint16 = 0x0035
	DMSSetUserLockCode     uint16 = 0x0036
	DMSReadUserData        uint16 = 0x0037
	DMSWriteUserData       uint16 = 0x0038
	DMSUIMGetICCID         uint16 = 0x003C
	DMSGetBandCapabilities uint16 = 0x0045
	DMSGetFactorySKU       uint16 = 0x0046
	DMSGetSoftwareVersion  uint16 = 0x0051
	DMSGetMACAddress       uint16 = 0x005C
)
View Source
const (
	DMSDataServiceCapabilityNone                uint8 = 0
	DMSDataServiceCapabilityCS                  uint8 = 1
	DMSDataServiceCapabilityPS                  uint8 = 2
	DMSDataServiceCapabilitySimultaneousCSPS    uint8 = 3
	DMSDataServiceCapabilityNonSimultaneousCSPS uint8 = 4
)
View Source
const (
	DMSSIMCapabilityNotSupported uint8 = 1
	DMSSIMCapabilitySupported    uint8 = 2
)
View Source
const (
	DMSRadioInterfaceCDMA20001X uint8 = 1
	DMSRadioInterfaceEVDO       uint8 = 2
	DMSRadioInterfaceGSM        uint8 = 4
	DMSRadioInterfaceUMTS       uint8 = 5
	DMSRadioInterfaceLTE        uint8 = 8
	DMSRadioInterfaceTDS        uint8 = 9
	DMSRadioInterfaceNR5G       uint8 = 10
)
View Source
const (
	DMSPowerStateExternalSource   uint8 = 1 << 0
	DMSPowerStateBatteryConnected uint8 = 1 << 1
	DMSPowerStateBatteryCharging  uint8 = 1 << 2
	DMSPowerStateFault            uint8 = 1 << 3
)
View Source
const (
	DMSTimeSourceDevice      uint16 = 0
	DMSTimeSourceCDMANetwork uint16 = 1
	DMSTimeSourceHDRNetwork  uint16 = 2
)
View Source
const (
	DMSMACTypeWLAN uint32 = 0
	DMSMACTypeBT   uint32 = 1
)
View Source
const (
	QMIErrNone                   uint16 = 0x0000 // Success / 成功
	QMIErrMalformedMsg           uint16 = 0x0001 // Malformed message / 消息格式错误
	QMIErrNoMemory               uint16 = 0x0002 // No memory / 内存不足
	QMIErrInternal               uint16 = 0x0003 // Internal error / 内部错误
	QMIErrInvalidID              uint16 = 0x0029 // Invalid client ID / 无效客户端 ID
	QMIErrNoEffect               uint16 = 0x001A // No effect / 无效果
	QMIErrInvalidArg             uint16 = 0x0004 // Invalid argument / 无效参数
	QMIErrDeviceNotReady         uint16 = 0x0005 // Device not ready / 设备未就绪
	QMIErrNetworkNotReady        uint16 = 0x0006 // Network not ready / 网络未就绪
	QMIErrNoThresholds           uint16 = 0x0008 // No thresholds / 未设置阈值
	QMIErrCallFailed             uint16 = 0x000E // Call failed / 呼叫失败
	QMIErrOutOfCall              uint16 = 0x000F // Out of call / 未建立数据呼叫
	QMIErrPolicyMismatch         uint16 = 0x004A // Policy mismatch / 策略不匹配
	QMIErrInvalidProfile         uint16 = 0x0019 // Invalid profile / 无效配置文件
	QMIErrClientIDsExhausted     uint16 = 0x001F // Client IDs exhausted / 客户端 ID 耗尽
	QMIErrInvalidRegisterAction  uint16 = 0x0020 // Invalid register action / 无效驻网动作
	QMIErrInvalidQmiCmd          uint16 = 0x0047 // Invalid QMI command / 不支持的QMI命令
	QMIErrNotSupported           uint16 = 0x005E // Not supported / 不支持
	QMIErrOpDeviceUnsupported    uint16 = 0x0034 // Operation not supported by device (EC20 对 WMS 0x004A 的常见回应)
	QMIErrCardCallControlRefFail uint16 = 0x0030 // Card APDU call control reference failed (卡片执行 EnableProfile+refresh 触发内部 RESET 时的预期返回码)
)

Common QMI error codes / 常见 QMI 错误码

View Source
const (
	ServiceControl uint8 = 0x00 // CTL - Control
	ServiceWDS     uint8 = 0x01 // WDS - Wireless Data Service
	ServiceDMS     uint8 = 0x02 // DMS - Device Management Service
	ServiceNAS     uint8 = 0x03 // NAS - Network Access Stratum
	ServiceQOS     uint8 = 0x04 // QOS - Quality of Service
	ServiceWMS     uint8 = 0x05 // WMS - Wireless Messaging Service
	ServicePDS     uint8 = 0x06 // PDS - Position Determination Service
	ServiceAUTH    uint8 = 0x07 // AUTH - Authentication
	ServiceVOICE   uint8 = 0x09 // VOICE - Voice Service
	ServiceCAT2    uint8 = 0x0A // CAT2 - Card Application Toolkit
	ServiceUIM     uint8 = 0x0B // UIM - User Identity Module
	ServicePBM     uint8 = 0x0C // PBM - Phonebook Manager
	ServiceIMS     uint8 = 0x12 // IMS - IP Multimedia Subsystem Settings
	ServiceWDA     uint8 = 0x1A // WDA - Wireless Data Admin
	ServiceIMSP    uint8 = 0x1F // IMSP - IMS Presence Service
	ServiceWDSIPv6 uint8 = 0x1B // WDS for IPv6 (internal use)
	ServiceIMSA    uint8 = 0x21 // IMSA - IMS Application Service
	ServiceCOEX    uint8 = 0x22 // COEX - Coexistence
)
View Source
const (
	WDSSetEventReport        uint16 = 0x0001 // QMIWDS_SET_EVENT_REPORT_REQ
	WDSEventReportInd        uint16 = 0x0001 // QMIWDS_EVENT_REPORT_IND
	WDSStartNetworkInterface uint16 = 0x0020 // QMIWDS_START_NETWORK_INTERFACE_REQ
	WDSStopNetworkInterface  uint16 = 0x0021 // QMIWDS_STOP_NETWORK_INTERFACE_REQ
	WDSGetPktSrvcStatus      uint16 = 0x0022 // QMIWDS_GET_PKT_SRVC_STATUS_REQ
	WDSGetPktSrvcStatusInd   uint16 = 0x0022 // QMIWDS_GET_PKT_SRVC_STATUS_IND
	WDSGetCurrentChannelRate uint16 = 0x0023 // QMIWDS_GET_CURRENT_CHANNEL_RATE_REQ
	WDSGetPktStatistics      uint16 = 0x0024 // QMIWDS_GET_PKT_STATISTICS_REQ
	WDSGetProfileList        uint16 = 0x002A // QMIWDS_GET_PROFILE_LIST_REQ
	WDSGetProfileSettings    uint16 = 0x002B // QMIWDS_GET_PROFILE_SETTINGS_REQ
	WDSGetDefaultSettings    uint16 = 0x002C // QMIWDS_GET_DEFAULT_SETTINGS_REQ
	WDSGetRuntimeSettings    uint16 = 0x002D // QMIWDS_GET_RUNTIME_SETTINGS_REQ
	WDSSetClientIPFamilyPref uint16 = 0x004D // QMIWDS_SET_CLIENT_IP_FAMILY_PREF_REQ
	WDSBindMuxDataPort       uint16 = 0x00A2 // QMIWDS_BIND_MUX_DATA_PORT_REQ
)
View Source
const (
	WMSSetEventReport                        uint16 = 0x0001 // QMIWMS_SET_EVENT_REPORT_REQ
	WMSEventReportInd                        uint16 = 0x0001 // QMIWMS_EVENT_REPORT_IND
	WMSRawSend                               uint16 = 0x0020 // QMIWMS_RAW_SEND_REQ
	WMSRawWrite                              uint16 = 0x0021 // QMIWMS_RAW_WRITE_REQ
	WMSRawRead                               uint16 = 0x0022 // QMIWMS_RAW_READ_REQ
	WMSDelete                                uint16 = 0x0024 // QMIWMS_DELETE_REQ
	WMSListMessages                          uint16 = 0x0031 // QMIWMS_LIST_MESSAGES_REQ
	WMSSMSCAddressInd                        uint16 = 0x0046 // QMIWMS_SMSC_ADDRESS_IND
	WMSTransportNetworkRegistrationStatusInd uint16 = 0x004B // QMIWMS_TRANSPORT_NW_REG_STATUS_IND
)
View Source
const (
	NASReset                     uint16 = 0x0000 // QMINAS_RESET_REQ
	NASAbort                     uint16 = 0x0001 // QMINAS_ABORT_REQ
	NASSetEventReport            uint16 = 0x0002 // QMINAS_SET_EVENT_REPORT_REQ
	NASEventReportInd            uint16 = 0x0002 // QMINAS_EVENT_REPORT_IND
	NASRegisterIndications       uint16 = 0x0003 // QMINAS_REGISTER_INDICATIONS_REQ
	NASGetSignalStrength         uint16 = 0x0020 // QMINAS_GET_SIGNAL_STRENGTH_REQ
	NASPerformNetworkScan        uint16 = 0x0021 // QMINAS_NETWORK_SCAN_REQ
	NASInitiateNetworkRegister   uint16 = 0x0022 // QMINAS_INITIATE_NETWORK_REGISTER_REQ
	NASAttachDetach              uint16 = 0x0023 // QMINAS_ATTACH_DETACH_REQ
	NASGetServingSystem          uint16 = 0x0024 // QMINAS_GET_SERVING_SYSTEM_REQ
	NASServingSystemInd          uint16 = 0x0024 // QMINAS_SERVING_SYSTEM_IND
	NASGetOperatorName           uint16 = 0x0039 // QMINAS_GET_OPERATOR_NAME_REQ
	NASOperatorNameInd           uint16 = 0x003A // QMINAS_OPERATOR_NAME_IND
	NASGetPLMNName               uint16 = 0x0044 // QMINAS_GET_PLMN_NAME_REQ
	NASGetSysInfo                uint16 = 0x004D // QMINAS_GET_SYS_INFO_REQ
	NASNetworkTimeInd            uint16 = 0x004C // QMINAS_NETWORK_TIME_IND
	NASSysInfoInd                uint16 = 0x004E // QMINAS_SYS_INFO_IND
	NASGetSignalInfo             uint16 = 0x004F // QMINAS_GET_SIGNAL_INFO_REQ
	NASConfigSignalInfo          uint16 = 0x0050 // QMINAS_CONFIG_SIGNAL_INFO_REQ
	NASSignalInfoInd             uint16 = 0x0051 // QMINAS_SIGNAL_INFO_IND
	NASConfigSignalInfoV2        uint16 = 0x006C // QMINAS_CONFIG_SIGNAL_INFO_V2_REQ
	NASNetworkRejectInd          uint16 = 0x0068 // QMINAS_NETWORK_REJECT_IND
	NASGetNetworkTime            uint16 = 0x007D // QMINAS_GET_NETWORK_TIME_REQ
	NASIncrementalNetworkScan    uint16 = 0x0085 // QMINAS_INCREMENTAL_NETWORK_SCAN_REQ
	NASIncrementalNetworkScanInd uint16 = 0x0085 // QMINAS_INCREMENTAL_NETWORK_SCAN_IND
)
View Source
const (
	DMSGetDeviceSerialNumbers uint16 = 0x0025 // QMIDMS_GET_DEVICE_SERIAL_NUMBERS_REQ
	DMSGetDeviceRevID         uint16 = 0x0023 // QMIDMS_GET_DEVICE_REV_ID_REQ
	DMSUIMGetState            uint16 = 0x0044 // QMIDMS_UIM_GET_STATE_REQ
	DMSUIMGetPINStatus        uint16 = 0x002B // QMIDMS_UIM_GET_PIN_STATUS_REQ
	DMSUIMVerifyPIN           uint16 = 0x0028 // QMIDMS_UIM_VERIFY_PIN_REQ
	DMSSetOperatingMode       uint16 = 0x002E // QMIDMS_SET_OPERATING_MODE_REQ
	DMSGetOperatingMode       uint16 = 0x002D // QMIDMS_GET_OPERATING_MODE_REQ
)
View Source
const (
	UIMVerifyPIN           uint16 = 0x0026 // QMIUIM_VERIFY_PIN_REQ
	UIMGetCardStatus       uint16 = 0x002F // QMIUIM_GET_CARD_STATUS_REQ
	UIMOpenLogicalChannel  uint16 = 0x0042 // QMIUIM_OPEN_LOGICAL_CHANNEL_REQ
	UIMCloseLogicalChannel uint16 = 0x003F // QMIUIM_CLOSE_LOGICAL_CHANNEL_REQ
	UIMSendAPDU            uint16 = 0x003B // QMIUIM_SEND_APDU_REQ
)
View Source
const (
	CTLGetVersionInfo    uint16 = 0x0021 // QMICTL_GET_VERSION_REQ
	CTLGetClientID       uint16 = 0x0022 // QMICTL_GET_CLIENT_ID_REQ
	CTLReleaseClientID   uint16 = 0x0023 // QMICTL_RELEASE_CLIENT_ID_REQ
	CTLRevokeClientIDInd uint16 = 0x0024 // QMICTL_REVOKE_CLIENT_ID_IND
	CTLSetDataFormat     uint16 = 0x0026 // QMICTL_SET_DATA_FORMAT_REQ
	CTLSync              uint16 = 0x0027 // QMICTL_SYNC_REQ
	CTLInternalProxyOpen uint16 = 0xFF00 // libqmi qmi-proxy internal open request
	TLVProxyDevicePath   uint8  = 0x01   // CTLInternalProxyOpen device path TLV
)
View Source
const (
	PktDataUnknown        uint8 = 0x00
	PktDataDisconnected   uint8 = 0x01
	PktDataConnected      uint8 = 0x02
	PktDataSuspended      uint8 = 0x03
	PktDataAuthenticating uint8 = 0x04
)
View Source
const (
	IpFamilyV4 uint8 = 0x04
	IpFamilyV6 uint8 = 0x06
)

IP Family Constants / IP族常量

View Source
const (
	IMSSetServicesEnabledSetting uint16 = 0x008F
	IMSGetServicesEnabledSetting uint16 = 0x0090
	IMSSettingsChangedInd        uint16 = 0x0091
	IMSBindRequest               uint16 = 0x0098
)
View Source
const (
	IMSAGetIMSRegistrationStatus  uint16 = 0x0020
	IMSAGetIMSServicesStatus      uint16 = 0x0021
	IMSARegisterIndications       uint16 = 0x0022
	IMSARegistrationStatusChanged uint16 = 0x0023
	IMSAServicesStatusChanged     uint16 = 0x0024
	IMSABindRequest               uint16 = 0x0033
)
View Source
const (
	NASSetTechnologyPreference      uint16 = 0x002A
	NASGetTechnologyPreference      uint16 = 0x002B
	NASGetRFBandInfo                uint16 = 0x0031
	NASSetSystemSelectionPreference uint16 = 0x0033
	NASGetSystemSelectionPreference uint16 = 0x0034
	NASGetCellLocationInfo          uint16 = 0x0043
	NASForceNetworkSearch           uint16 = 0x0067
)
View Source
const (
	NASTechPreferenceAuto        uint16 = 0
	NASTechPreference3GPP2       uint16 = 1 << 0
	NASTechPreference3GPP        uint16 = 1 << 1
	NASTechPreferenceAMPSOrGSM   uint16 = 1 << 2
	NASTechPreferenceCDMAOrWCDMA uint16 = 1 << 3
	NASTechPreferenceHDR         uint16 = 1 << 4
	NASTechPreferenceLTE         uint16 = 1 << 5
)
View Source
const (
	NASPreferenceDurationPermanent     uint8 = 0x00
	NASPreferenceDurationPowerCycle    uint8 = 0x01
	NASPreferenceDurationOneCall       uint8 = 0x02
	NASPreferenceDurationOneCallOrTime uint8 = 0x03
	NASPreferenceDurationInternalCall1 uint8 = 0x04
	NASPreferenceDurationInternalCall2 uint8 = 0x05
	NASPreferenceDurationInternalCall3 uint8 = 0x06
)
View Source
const (
	NASRatModePreferenceCDMA1X     uint16 = 1 << 0
	NASRatModePreferenceCDMA1XEVDO uint16 = 1 << 1
	NASRatModePreferenceGSM        uint16 = 1 << 2
	NASRatModePreferenceUMTS       uint16 = 1 << 3
	NASRatModePreferenceLTE        uint16 = 1 << 4
	NASRatModePreferenceTDSCDMA    uint16 = 1 << 5
	NASRatModePreferenceNR5G       uint16 = 1 << 6
)
View Source
const (
	NASRoamingPreferenceOff         uint16 = 0x01
	NASRoamingPreferenceNotOff      uint16 = 0x02
	NASRoamingPreferenceNotFlashing uint16 = 0x03
	NASRoamingPreferenceAny         uint16 = 0xFF
)
View Source
const (
	NASNetworkSelectionAutomatic uint8 = 0x00
	NASNetworkSelectionManual    uint8 = 0x01
)
View Source
const (
	NASChangeDurationPowerCycle uint8 = 0x00
	NASChangeDurationPermanent  uint8 = 0x01
)
View Source
const (
	NASServiceDomainPreferenceCSOnly   uint32 = 0x00
	NASServiceDomainPreferencePSOnly   uint32 = 0x01
	NASServiceDomainPreferenceCSPS     uint32 = 0x02
	NASServiceDomainPreferencePSAttach uint32 = 0x03
	NASServiceDomainPreferencePSDetach uint32 = 0x04
)
View Source
const (
	NASVoiceDomainPreferenceCSOnly      uint32 = 0x00
	NASVoiceDomainPreferencePSOnly      uint32 = 0x01
	NASVoiceDomainPreferenceCSPreferred uint32 = 0x02
	NASVoiceDomainPreferencePSPreferred uint32 = 0x03
)
View Source
const (
	// UIM Message IDs / UIM消息ID
	UIMReset                uint16 = 0x0000
	UIMGetSupportedMessages uint16 = 0x001E
	UIMReadTransparent      uint16 = 0x0020
	UIMReadRecord           uint16 = 0x0021
	UIMGetFileAttrs         uint16 = 0x0024
	/* Defined in frame.go / 在 frame.go 中定义
	UIMVerifyPIN            uint16 = 0x0026
	*/
	UIMSetPINProtection          uint16 = 0x0025
	UIMUnblockPIN                uint16 = 0x0027
	UIMChangePIN                 uint16 = 0x0028
	UIMRefreshRegister           uint16 = 0x002A
	UIMRefreshComplete           uint16 = 0x002C
	UIMRegisterEvents            uint16 = 0x002E
	UIMPowerOffSIM               uint16 = 0x0030
	UIMPowerOnSIM                uint16 = 0x0031
	UIMStatusChangeInd           uint16 = 0x0032
	UIMRefreshInd                uint16 = 0x0033
	UIMChangeProvisioningSession uint16 = 0x0038
	UIMSessionClosedInd          uint16 = 0x0043
	UIMRefreshRegisterAll        uint16 = 0x0044
	/* Defined in frame.go / 在 frame.go 中定义
	UIMGetCardStatus        uint16 = 0x002F
	*/
	UIMSwitchSlot    uint16 = 0x0046
	UIMGetSlotStatus uint16 = 0x0047
	UIMSlotStatusInd uint16 = 0x0048
)
View Source
const (
	UIMEventRegistrationCardStatus         uint32 = 1 << 0
	UIMEventRegistrationSAPConnection      uint32 = 1 << 1
	UIMEventRegistrationExtendedCardStatus uint32 = 1 << 2
	UIMEventRegistrationPhysicalSlotStatus uint32 = 1 << 4
)
View Source
const (
	UIMSessionTypePrimaryGWProvisioning   uint8 = 0
	UIMSessionTypePrimary1XProvisioning   uint8 = 1
	UIMSessionTypeSecondaryGWProvisioning uint8 = 2
	UIMSessionTypeSecondary1XProvisioning uint8 = 3
	UIMSessionTypeNonProvisioningSlot1    uint8 = 4
	UIMSessionTypeNonProvisioningSlot2    uint8 = 5
	UIMSessionTypeCardSlot1               uint8 = 6
	UIMSessionTypeCardSlot2               uint8 = 7
	UIMSessionTypeLogicalChannelSlot1     uint8 = 8
	UIMSessionTypeLogicalChannelSlot2     uint8 = 9
	UIMSessionTypeNonProvisioningSlot3    uint8 = 16
	UIMSessionTypeCardSlot3               uint8 = 19
	UIMSessionTypeLogicalChannelSlot3     uint8 = 22
)
View Source
const (
	UIMFileTypeTransparent uint8 = 0
	UIMFileTypeCyclic      uint8 = 1
	UIMFileTypeLinearFixed uint8 = 2
	UIMFileTypeDedicated   uint8 = 3
	UIMFileTypeMaster      uint8 = 4
)
View Source
const (
	UIMPhysicalCardStateUnknown uint32 = 0
	UIMPhysicalCardStateAbsent  uint32 = 1
	UIMPhysicalCardStatePresent uint32 = 2
)
View Source
const (
	UIMSlotStateInactive uint32 = 0
	UIMSlotStateActive   uint32 = 1
)
View Source
const (
	UIMCardProtocolUnknown uint32 = 0
	UIMCardProtocolICC     uint32 = 1
	UIMCardProtocolUICC    uint32 = 2
)
View Source
const (
	UIMAppTypeUnknown uint8 = 0
	UIMAppTypeSIM     uint8 = 1
	UIMAppTypeUSIM    uint8 = 2
	UIMAppTypeRUIM    uint8 = 3
	UIMAppTypeCSIM    uint8 = 4
	UIMAppTypeISIM    uint8 = 5
)
View Source
const (
	UIMAppStateUnknown  uint8 = 0
	UIMAppStateDetected uint8 = 1
	UIMAppStateReady    uint8 = 7
)

QMI card application state(权威值来自 libqmi qmi-enums-uim.h)

View Source
const (
	VOICEIndicationRegister             uint16 = 0x0003
	VOICEGetSupportedMessages           uint16 = 0x001E
	VOICEDialCall                       uint16 = 0x0020
	VOICEEndCall                        uint16 = 0x0021
	VOICEAnswerCall                     uint16 = 0x0022
	VOICEBurstDTMF                      uint16 = 0x0028
	VOICEStartContinuousDTMF            uint16 = 0x0029
	VOICEStopContinuousDTMF             uint16 = 0x002A
	VOICEAllCallStatusInd               uint16 = 0x002E
	VOICEGetAllCallInfo                 uint16 = 0x002F
	VOICEManageCalls                    uint16 = 0x0031
	VOICESupplementaryServiceInd        uint16 = 0x0032
	VOICESetSupplementaryService        uint16 = 0x0033
	VOICEGetCallWaiting                 uint16 = 0x0034
	VOICEOriginateUSSD                  uint16 = 0x003A
	VOICEAnswerUSSD                     uint16 = 0x003B
	VOICECancelUSSD                     uint16 = 0x003C
	VOICEReleaseUSSDInd                 uint16 = 0x003D
	VOICEUSSDInd                        uint16 = 0x003E
	VOICEGetConfig                      uint16 = 0x0041
	VOICESupplementaryServiceRequestInd uint16 = 0x0042
	VOICEOriginateUSSDNoWait            uint16 = 0x0043
)
View Source
const (

	// WDA message IDs
	WDASetDataFormat     uint16 = 0x0020
	WDAGetDataFormat     uint16 = 0x0021
	WDASetQMAPSettings   uint16 = 0x002B
	WDAGetQMAPSettings   uint16 = 0x002C
	WDASetLoopbackConfig uint16 = 0x002F
)

WDA Message IDs / WDA消息ID

View Source
const (
	DataFormatQOSFlowHeader     uint8 = 1 << 0
	DataFormatLinkProtEth       uint8 = 0
	DataFormatLinkProtIP        uint8 = 1 << 1
	DataFormatUlDataAggEnabled  uint8 = 1 << 2
	DataFormatUlDataAggDisabled uint8 = 0
	DataFormatDlDataAggEnabled  uint8 = 1 << 3
	DataFormatDlDataAggDisabled uint8 = 0
	DataFormatNdpSigEnabled     uint8 = 1 << 4 // New Data Path Signature / 新数据路径签名
)

Data Format Modes / 数据格式模式

View Source
const (
	LinkProtocolEthernet uint32 = 0x01 // Sometime 0x02? Need to verify spec vs modem. / 有时是0x02? 需要针对modem验证规范。
	LinkProtocolIP       uint32 = 0x02
)

DataFormatMode constants for Link Protocol (TLV 0x11) / Link Protocol (TLV 0x11) 的 DataFormatMode 常量

View Source
const (
	WDSCreateProfile                  uint16 = 0x0027
	WDSModifyProfileSettings          uint16 = 0x0028
	WDSDeleteProfile                  uint16 = 0x0029
	WDSGetAutoconnectSettings         uint16 = 0x0034
	WDSGetDataBearerTechnology        uint16 = 0x0037
	WDSGetCurrentDataBearerTechnology uint16 = 0x0044
	WDSSetAutoconnectSettings         uint16 = 0x0051
)
View Source
const (
	TLVWDSPrimaryDNSv4   uint8 = 0x15
	TLVWDSSecondaryDNSv4 uint8 = 0x16
	TLVWDSIPv4Address    uint8 = 0x1E
	TLVWDSIPv4Gateway    uint8 = 0x20
	TLVWDSIPv4Subnet     uint8 = 0x21
	TLVWDSIPv6Address    uint8 = 0x25
	TLVWDSIPv6Gateway    uint8 = 0x26
	TLVWDSPrimaryDNSv6   uint8 = 0x27
	TLVWDSSecondaryDNSv6 uint8 = 0x28
	TLVWDSMtu            uint8 = 0x29
)
View Source
const (
	RuntimeMaskProfileID   uint32 = 1 << 0
	RuntimeMaskProfileName uint32 = 1 << 1
	RuntimeMaskPDPType     uint32 = 1 << 2
	RuntimeMaskAPNName     uint32 = 1 << 3
	RuntimeMaskDNS         uint32 = 1 << 4
	RuntimeMaskQoS         uint32 = 1 << 5
	RuntimeMaskUsername    uint32 = 1 << 6
	RuntimeMaskAuth        uint32 = 1 << 7
	RuntimeMaskIPAddr      uint32 = 1 << 8
	RuntimeMaskGateway     uint32 = 1 << 9
	RuntimeMaskPCSCFPCO    uint32 = 1 << 10
	RuntimeMaskPCSCFAddr   uint32 = 1 << 11
	RuntimeMaskPCSCFDomain uint32 = 1 << 12
	RuntimeMaskMTU         uint32 = 1 << 13
	RuntimeMaskDomainName  uint32 = 1 << 14
	RuntimeMaskIPFamily    uint32 = 1 << 15
)

Runtime settings mask bits / 运行时设置掩码位

View Source
const (
	WDSProfileType3GPP  uint8 = 0
	WDSProfileType3GPP2 uint8 = 1
	WDSProfileTypeEPC   uint8 = 2
	WDSProfileTypeAll   uint8 = 0xFF
)
View Source
const (
	WDSPDPTypeIPv4       uint8 = 0
	WDSPDPTypePPP        uint8 = 1
	WDSPDPTypeIPv6       uint8 = 2
	WDSPDPTypeIPv4OrIPv6 uint8 = 3
)
View Source
const (
	WDSAuthNone uint8 = 0
	WDSAuthPAP  uint8 = 1 << 0
	WDSAuthCHAP uint8 = 1 << 1
)
View Source
const (
	WDSPacketStatsTxPacketsOK      uint32 = 1 << 0
	WDSPacketStatsRxPacketsOK      uint32 = 1 << 1
	WDSPacketStatsTxPacketsError   uint32 = 1 << 2
	WDSPacketStatsRxPacketsError   uint32 = 1 << 3
	WDSPacketStatsTxOverflows      uint32 = 1 << 4
	WDSPacketStatsRxOverflows      uint32 = 1 << 5
	WDSPacketStatsTxBytesOK        uint32 = 1 << 6
	WDSPacketStatsRxBytesOK        uint32 = 1 << 7
	WDSPacketStatsTxPacketsDropped uint32 = 1 << 8
	WDSPacketStatsRxPacketsDropped uint32 = 1 << 9
	WDSPacketStatisticsMaskAll            = WDSPacketStatsTxPacketsOK |
		WDSPacketStatsRxPacketsOK |
		WDSPacketStatsTxPacketsError |
		WDSPacketStatsRxPacketsError |
		WDSPacketStatsTxOverflows |
		WDSPacketStatsRxOverflows |
		WDSPacketStatsTxBytesOK |
		WDSPacketStatsRxBytesOK |
		WDSPacketStatsTxPacketsDropped |
		WDSPacketStatsRxPacketsDropped
)
View Source
const (
	WDSAutoconnectDisabled uint8 = 0
	WDSAutoconnectEnabled  uint8 = 1
	WDSAutoconnectPaused   uint8 = 2
)
View Source
const (
	WDSAutoconnectRoamingAllowed  uint8 = 0
	WDSAutoconnectRoamingHomeOnly uint8 = 1
)
View Source
const (
	WDSNetworkTypeUnknown uint8 = 0
	WDSNetworkType3GPP2   uint8 = 1
	WDSNetworkType3GPP    uint8 = 2
)
View Source
const (
	/* Defined in frame.go / 在 frame.go 中定义
	WMSDelete         uint16 = 0x0024
	*/
	WMSGetSupportedMessages                  uint16 = 0x001E
	WMSModifyTag                             uint16 = 0x0023
	WMSGetMessageProtocol                    uint16 = 0x0030
	WMSSetRoutes                             uint16 = 0x0032
	WMSGetRoutes                             uint16 = 0x0033
	WMSGetSMSCAddress                        uint16 = 0x0034
	WMSSendAck                               uint16 = 0x0037
	WMSSendFromStorage                       uint16 = 0x0042
	WMSIndicationRegister                    uint16 = 0x0047
	WMSGetTransportNetworkRegistrationStatus uint16 = 0x004A
)
View Source
const AnyPacketDataHandle uint32 = ^uint32(0)
View Source
const CTLHeaderSize = 6
View Source
const IMSPGetEnablerState uint16 = 0x0024
View Source
const QmuxHeaderSize = 6
View Source
const ServiceHeaderSize = 7
View Source
const TLVHeaderSize = 3 // 1 byte type + 2 bytes length / 1字节类型 + 2字节长度

Variables

View Source
var ErrServiceNotSupported = errors.New("qmi service not supported by hardware")

ErrServiceNotSupported is returned when a requested service is not supported by the hardware ErrServiceNotSupported 表示硬件不支持所请求的 QMI 服务

Functions

func GetLTEDuplexModeFromBandInfo

func GetLTEDuplexModeFromBandInfo(info *RFBandInfo) string

func GetLTEDuplexModeFromCellLocation

func GetLTEDuplexModeFromCellLocation(info *CellLocationInfo) string

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError 0x0030s if err is a connection error / IsConnectionError 检查是否为连接错误

func IsDeviceError

func IsDeviceError(err error) bool

IsDeviceError 0x0030s if err is a device error / IsDeviceError 检查是否为设备错误

func IsQMIError

func IsQMIError(err error) bool

IsQMIError 0x0030s if err is a QMI protocol error / IsQMIError 检查是否为 QMI 协议错误

func IsTimeoutError

func IsTimeoutError(err error) bool

IsTimeoutError 0x0030s if err is a timeout error / IsTimeoutError 检查是否为超时错误

func ServiceVersionMap

func ServiceVersionMap(versions []ServiceVersion) map[uint8]ServiceVersion

ServiceVersionMap 将服务版本切片转换为按 ServiceType 索引的 map,方便快速查询

Types

type ActivationState

type ActivationState uint16
const (
	ActivationStateNotActivated       ActivationState = 0x00
	ActivationStateActivated          ActivationState = 0x01
	ActivationStateConnecting         ActivationState = 0x02
	ActivationStateConnected          ActivationState = 0x03
	ActivationStateOTASPAuthenticated ActivationState = 0x04
	ActivationStateOTASPNAM           ActivationState = 0x05
	ActivationStateOTASPMDN           ActivationState = 0x06
	ActivationStateOTASPIMSI          ActivationState = 0x07
	ActivationStateOTASPPRL           ActivationState = 0x08
	ActivationStateOTASPSPC           ActivationState = 0x09
	ActivationStateOTASPCommitted     ActivationState = 0x0A
)

func (ActivationState) String

func (s ActivationState) String() string

type AutoconnectSettings

type AutoconnectSettings struct {
	Status     uint8
	HasStatus  bool
	Roaming    uint8
	HasRoaming bool
}

AutoconnectSettings represents configurable WDS autoconnect fields.

type BandCapabilities

type BandCapabilities struct {
	BandCapability            uint64
	HasBandCapability         bool
	LTEBandCapability         uint64
	HasLTEBandCapability      bool
	ExtendedLTEBandCapability []uint16
	NR5GBandCapability        []uint16
}

BandCapabilities contains the modem-reported band masks and extended band lists.

type BearerTechnology

type BearerTechnology struct {
	NetworkType uint8
	RATMask     uint32
	SOMask      uint32
}

BearerTechnology describes the network type and RAT/SO masks.

type CTLHeader

type CTLHeader struct {
	ControlFlags  uint8
	TransactionID uint8
	MessageID     uint16
	Length        uint16
}

CTLHeader is used for Control Service (Service 0) / CTLHeader用于控制服务 (服务0) Offset 0: ControlFlags (0x00 for request, 0x01 for response, 0x02 for indication) / 偏移0: 控制标志 (0x00请求, 0x01响应, 0x02指示) Offset 1: TransactionID (1 byte for CTL!) / 偏移1: 事务ID (CTL服务仅1字节!) Offset 2-3: MessageID (little-endian) / 偏移2-3: 消息ID (小端序) Offset 4-5: Length (little-endian) / 偏移4-5: 长度 (小端序)

func UnmarshalCTLHeader

func UnmarshalCTLHeader(data []byte) (*CTLHeader, error)

func (*CTLHeader) Marshal

func (h *CTLHeader) Marshal() []byte

type CallEndReason

type CallEndReason struct {
	Type uint16
	Code uint16
}

type CardStatusDetails

type CardStatusDetails struct {
	CardState           uint8
	ErrorCode           uint8
	NumSlot             uint8
	NumApp              uint8
	AppType             uint8
	AppState            uint8
	PersoState          uint8
	PersoFeature        uint8
	PersoRetries        uint8
	PersoUnblockRetries uint8
	AID                 []byte
	PIN1State           PINStatus
	PIN1Retries         uint8
	PUK1Retries         uint8
	PIN2State           PINStatus
	PIN2Retries         uint8
	PUK2Retries         uint8
	UsesUPIN            bool
	UPINState           PINStatus
	UPINRetries         uint8
	UPUKRetries         uint8
}

type CellLocationInfo

type CellLocationInfo struct {
	GERAN *GERANCellLocationInfo
	UMTS  *UMTSCellLocationInfo
	LTE   *LTECellLocationInfo
	NR5G  *NR5GCellLocationInfo
}

CellLocationInfo combines serving-cell details from different RAT families.

type ChannelRates

type ChannelRates struct {
	TxRateBPS    uint32
	RxRateBPS    uint32
	MaxTxRateBPS uint32
	MaxRxRateBPS uint32
}

ChannelRates reports current and maximum link rates.

type Client

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

func NewClientWithOptions

func NewClientWithOptions(ctx context.Context, path string, opts ClientOptions) (*Client, error)

NewClientWithOptions creates a new QMI client connected to the given device path.

func (*Client) AllocateClientID

func (c *Client) AllocateClientID(service uint8) (uint8, error)

AllocateClientID requests a client ID for the given service / AllocateClientID为给定服务请求客户端ID

func (*Client) AllocateClientIDWithContext

func (c *Client) AllocateClientIDWithContext(ctx context.Context, service uint8) (uint8, error)

func (*Client) Close

func (c *Client) Close() error

Close shuts down the client / Close关闭客户端

func (*Client) Events

func (c *Client) Events() <-chan Event

Events returns a channel for receiving asynchronous indications / Events返回用于接收异步指示的通道

func (*Client) GetCachedServiceVersions

func (c *Client) GetCachedServiceVersions() map[uint8]ServiceVersion

GetCachedServiceVersions 返回缓存的服务版本信息。 如果尚未查询过,返回 nil。

func (*Client) GetClientID

func (c *Client) GetClientID(service uint8) uint8

GetClientID returns the cached client ID for a service, or 0 if not allocated / GetClientID返回服务的缓存客户端ID,如果未分配则返回0

func (*Client) GetServiceVersions

func (c *Client) GetServiceVersions(ctx context.Context) ([]ServiceVersion, error)

GetServiceVersions 向 modem 发送 CTL_GET_VERSION_INFO 请求, 获取 modem 支持的全部 QMI 服务及其版本号。

响应 TLV 0x01 格式:

byte 0:     count (服务数量)
byte 1..N:  每个条目 5 字节:
  uint8  service_type
  uint16 major_version (LE)
  uint16 minor_version (LE)

func (*Client) HasService

func (c *Client) HasService(service uint8) bool

HasService 查询 modem 是否支持指定的 QMI 服务。 如果尚未执行版本查询,返回 true(乐观假设)。

func (*Client) ReleaseClientID

func (c *Client) ReleaseClientID(service uint8, clientID uint8) error

ReleaseClientID releases a client ID for the given service / ReleaseClientID释放给定服务的客户端ID

func (*Client) ReleaseClientIDWithContext

func (c *Client) ReleaseClientIDWithContext(ctx context.Context, service uint8, clientID uint8) error

func (*Client) SendRequest

func (c *Client) SendRequest(ctx context.Context, service uint8, clientID uint8, msgID uint16, tlvs []TLV) (resp *Packet, err error)

SendRequest sends a QMI request and waits for response / SendRequest发送QMI请求并等待响应

func (*Client) Stats

func (c *Client) Stats() ClientStats

Stats returns a point-in-time snapshot of client runtime metrics.

func (*Client) Sync

func (c *Client) Sync(ctx context.Context) error

Sync sends a QMI CTL sync request / Sync发送QMI CTL同步请求

type ClientLogFunc

type ClientLogFunc func(level ClientLogLevel, format string, args ...any)

type ClientLogLevel

type ClientLogLevel string
const (
	ClientLogLevelDebug ClientLogLevel = "debug"
	ClientLogLevelWarn  ClientLogLevel = "warn"
	ClientLogLevelError ClientLogLevel = "error"
)

type ClientOptions

type ClientOptions struct {
	SyncOnOpen            bool
	QueryVersionOnOpen    bool // 启动时自动查询服务版本信息
	ReadDeadline          time.Duration
	DefaultRequestTimeout time.Duration
	TxQueueSize           int
	IndicationQueueSize   int
	UseProxy              bool
	ProxyPath             string
	ProxyExecutable       string
	ProxyOpenTimeout      time.Duration
	ProxyFallbackToRaw    bool
	Logf                  ClientLogFunc
}

ClientOptions controls runtime behavior for the low-level QMI client.

func DefaultClientOptions

func DefaultClientOptions() ClientOptions

DefaultClientOptions returns the production defaults used by NewClientWithOptions.

type ClientStats

type ClientStats struct {
	UnmatchedResponses     uint64
	ParseErrors            uint64
	CoalescedIndications   uint64
	DroppedEdgeIndications uint64
}

ClientStats summarizes key runtime behaviors without exposing payloads.

type ConnectionError

type ConnectionError struct {
	Phase   ConnectionPhase // Phase where error occurred / 错误发生阶段
	Cause   error           // Underlying cause / 底层原因
	Message string          // Human readable message / 可读消息
}

ConnectionError represents a connection-level error / ConnectionError 表示连接级别错误

func NewConnectionError

func NewConnectionError(phase ConnectionPhase, message string, cause error) *ConnectionError

NewConnectionError creates a new ConnectionError / NewConnectionError 创建新的连接错误

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

type ConnectionPhase

type ConnectionPhase int

ConnectionPhase indicates where in the connection process an error occurred ConnectionPhase 表示连接过程中错误发生的阶段

const (
	PhaseDeviceOpen   ConnectionPhase = iota // Opening QMI device / 打开 QMI 设备
	PhaseClientAlloc                         // Allocating QMI client / 分配 QMI 客户端
	PhaseSIMCheck                            // Checking SIM status / 检查 SIM 状态
	PhaseRegistration                        // Network registration / 网络注册
	PhaseDialing                             // Establishing data call / 建立数据呼叫
	PhaseIPConfig                            // Configuring IP / 配置 IP
	PhaseConnected                           // While connected / 已连接状态
)

func (ConnectionPhase) String

func (p ConnectionPhase) String() string

type ConnectionStatus

type ConnectionStatus uint8

ConnectionStatus represents the current connection state / ConnectionStatus代表当前连接状态

const (
	StatusUnknown        ConnectionStatus = 0
	StatusDisconnected   ConnectionStatus = 1
	StatusConnected      ConnectionStatus = 2
	StatusSuspended      ConnectionStatus = 3
	StatusAuthenticating ConnectionStatus = 4
)

func ParsePacketServiceStatusIndication

func ParsePacketServiceStatusIndication(packet *Packet) (ConnectionStatus, error)

func (ConnectionStatus) String

func (s ConnectionStatus) String() string

type CurrentBearerTechnologyInfo

type CurrentBearerTechnologyInfo struct {
	Current    BearerTechnology
	HasCurrent bool
	Last       BearerTechnology
	HasLast    bool
}

CurrentBearerTechnologyInfo reports current or last extended bearer info.

type DMSService

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

func NewDMSService

func NewDMSService(client *Client) (*DMSService, error)

NewDMSService creates a DMS service wrapper / NewDMSService创建一个DMS服务包装器

func NewDMSServiceWithContext

func NewDMSServiceWithContext(ctx context.Context, client *Client) (*DMSService, error)

func (*DMSService) ChangePIN

func (s *DMSService) ChangePIN(ctx context.Context, pinID uint8, oldPIN, newPIN string) error

ChangePIN changes the PIN code / ChangePIN 修改 PIN 码

func (*DMSService) ClientID

func (d *DMSService) ClientID() uint8

func (*DMSService) Close

func (d *DMSService) Close() error

Close releases the DMS client ID / Close释放DMS客户端ID

func (*DMSService) GetActivationState

func (d *DMSService) GetActivationState(ctx context.Context) (ActivationState, error)

GetActivationState retrieves the current service activation state.

func (*DMSService) GetBandCapabilities

func (d *DMSService) GetBandCapabilities(ctx context.Context) (*BandCapabilities, error)

GetBandCapabilities retrieves the modem-supported band masks and extended band lists.

func (*DMSService) GetCapabilities

func (d *DMSService) GetCapabilities(ctx context.Context) (*DeviceCapabilities, error)

GetCapabilities retrieves device-wide data/SIM/radio capability information.

func (*DMSService) GetDeviceRevision

func (d *DMSService) GetDeviceRevision(ctx context.Context) (string, string, error)

GetDeviceRevision retrieves firmware revision / GetDeviceRevision检索固件版本

func (*DMSService) GetDeviceSerialNumbers

func (d *DMSService) GetDeviceSerialNumbers(ctx context.Context) (*DeviceInfo, error)

GetDeviceSerialNumbers retrieves IMEI and other serial numbers / GetDeviceSerialNumbers检索IMEI和其他序列号

func (*DMSService) GetFactorySKU

func (d *DMSService) GetFactorySKU(ctx context.Context) (string, error)

GetFactorySKU retrieves the factory SKU string.

func (*DMSService) GetHardwareRevision

func (d *DMSService) GetHardwareRevision(ctx context.Context) (string, error)

GetHardwareRevision retrieves the hardware revision string.

func (*DMSService) GetICCID

func (d *DMSService) GetICCID(ctx context.Context) (string, error)

GetICCID retrieves ICCID via DMS UIM helper support when available.

func (*DMSService) GetIMSI

func (d *DMSService) GetIMSI(ctx context.Context) (string, error)

GetIMSI retrieves the generic IMSI from DMS service directly / GetIMSI 直接从 DMS 服务检索通用 IMSI

func (*DMSService) GetMACAddress

func (d *DMSService) GetMACAddress(ctx context.Context, macType uint32) (*MACAddressInfo, error)

GetMACAddress retrieves a device MAC address for the requested MAC type.

func (*DMSService) GetMSISDN

func (d *DMSService) GetMSISDN(ctx context.Context) (string, error)

GetMSISDN retrieves the MSISDN string when available from the network/SIM configuration.

func (*DMSService) GetManufacturer

func (d *DMSService) GetManufacturer(ctx context.Context) (string, error)

GetManufacturer retrieves the modem manufacturer string.

func (*DMSService) GetModel

func (d *DMSService) GetModel(ctx context.Context) (string, error)

GetModel retrieves the modem model string.

func (*DMSService) GetOperatingMode

func (d *DMSService) GetOperatingMode(ctx context.Context) (OperatingMode, error)

GetOperatingMode queries the current operating mode / GetOperatingMode查询当前操作模式

func (*DMSService) GetPINStatus

func (d *DMSService) GetPINStatus(ctx context.Context) (*PINInfo, error)

func (*DMSService) GetPRLVersion

func (d *DMSService) GetPRLVersion(ctx context.Context) (*PRLVersionInfo, error)

GetPRLVersion retrieves the PRL version and optional PRL-only preference flag.

func (*DMSService) GetPowerState

func (d *DMSService) GetPowerState(ctx context.Context) (*PowerStateInfo, error)

GetPowerState retrieves the current power-source and battery state flags.

func (*DMSService) GetSIMStatus

func (d *DMSService) GetSIMStatus(ctx context.Context) (SIMStatus, error)

GetSIMStatus queries the SIM card status / GetSIMStatus查询SIM卡状态

func (*DMSService) GetSoftwareVersion

func (d *DMSService) GetSoftwareVersion(ctx context.Context) (string, error)

GetSoftwareVersion retrieves the software version string.

func (*DMSService) GetTime

func (d *DMSService) GetTime(ctx context.Context) (*TimeInfo, error)

GetTime retrieves the raw device/system/user time counters reported by the modem.

func (*DMSService) GetUserLockState

func (d *DMSService) GetUserLockState(ctx context.Context) (bool, error)

GetUserLockState retrieves whether the user lock is enabled.

func (*DMSService) RadioPower

func (d *DMSService) RadioPower(ctx context.Context, on bool) error

RadioPower turns the radio on or off / RadioPower打开或关闭射频

func (*DMSService) ReadUserData

func (d *DMSService) ReadUserData(ctx context.Context) ([]byte, error)

ReadUserData reads the modem's user-data blob.

func (*DMSService) SetOperatingMode

func (d *DMSService) SetOperatingMode(ctx context.Context, mode OperatingMode) error

SetOperatingMode changes the modem operating mode / SetOperatingMode更改modem操作模式 Use ModeOnline to turn radio on, ModeLowPower to turn off, ModeReset to reboot modem / 使用ModeOnline打开射频,ModeLowPower关闭,ModeReset重启modem

func (*DMSService) SetPINProtection

func (s *DMSService) SetPINProtection(ctx context.Context, pinID uint8, enabled bool, pin string) error

SetPINProtection enables or disables PIN protection / SetPINProtection 启用或禁用 PIN 保护

func (*DMSService) SetUserLockCode

func (d *DMSService) SetUserLockCode(ctx context.Context, oldCode, newCode string) error

SetUserLockCode changes the current 4-digit user lock code.

func (*DMSService) SetUserLockState

func (d *DMSService) SetUserLockState(ctx context.Context, enabled bool, lockCode string) error

SetUserLockState enables or disables the device user lock using the current 4-digit lock code.

func (*DMSService) UnblockPIN

func (s *DMSService) UnblockPIN(ctx context.Context, pinID uint8, puk, newPIN string) error

UnblockPIN unblocks the PIN using PUK / UnblockPIN 使用 PUK 解锁 PIN

func (*DMSService) VerifyPIN

func (d *DMSService) VerifyPIN(ctx context.Context, pin string) error

VerifyPIN verifies the SIM PIN / VerifyPIN验证SIM PIN

func (*DMSService) WriteUserData

func (d *DMSService) WriteUserData(ctx context.Context, data []byte) error

WriteUserData writes the modem's user-data blob.

type DataBearerTechnology

type DataBearerTechnology int8

DataBearerTechnology matches the legacy bearer technology enum.

type DataBearerTechnologyInfo

type DataBearerTechnologyInfo struct {
	Current    DataBearerTechnology
	HasCurrent bool
	Last       DataBearerTechnology
	HasLast    bool
}

DataBearerTechnologyInfo reports current or last legacy bearer technology.

type DataFormat

type DataFormat struct {
	LinkProtocol      uint32
	UlDataAggregation uint32
	DlDataAggregation uint32
}

DataFormat configures the data format for the connection / DataFormat 配置连接的数据格式

type DataFormatDetails

type DataFormatDetails struct {
	QOSSetting uint8

	LinkProtocol      uint32
	UlDataAggregation uint32
	DlDataAggregation uint32

	DlMaxDatagrams uint32
	DlMaxSize      uint32

	EndpointType uint32
	EndpointID   uint32
}

type DeviceCapabilities

type DeviceCapabilities struct {
	MaxTxChannelRate      uint32
	MaxRxChannelRate      uint32
	DataServiceCapability uint8
	SIMCapability         uint8
	RadioInterfaces       []uint8
}

DeviceCapabilities contains modem-wide capabilities reported by DMS.

type DeviceError

type DeviceError struct {
	DevicePath string // Device path / 设备路径
	Operation  string // Operation that failed / 失败的操作
	Cause      error  // Underlying cause / 底层原因
}

DeviceError represents a device-level error / DeviceError 表示设备级别错误

func (*DeviceError) Error

func (e *DeviceError) Error() string

func (*DeviceError) Unwrap

func (e *DeviceError) Unwrap() error

type DeviceInfo

type DeviceInfo struct {
	Manufacturer     string
	Model            string
	Revision         string
	HardwareRevision string
	SoftwareVersion  string
	MSISDN           string
	FactorySKU       string
	IMEI             string
	ESN              string
	MEID             string
}

DeviceInfo contains modem identification information / DeviceInfo包含modem识别信息

type Event

type Event struct {
	Type      EventType
	ServiceID uint8
	MessageID uint16
	Packet    *Packet
}

Event represents an asynchronous indication from the modem / Event代表来自modem的异步指示

type EventType

type EventType int
const (
	EventUnknown                               EventType = iota
	EventPacketServiceStatusChanged                      // WDS connection status changed / WDS连接状态改变
	EventServingSystemChanged                            // NAS registration state changed / NAS注册状态改变
	EventNASOperatorNameChanged                          // NAS operator name changed / NAS 运营商名称变化
	EventNASNetworkTimeChanged                           // NAS network time changed / NAS 网络时间变化
	EventNASSignalInfoChanged                            // NAS signal info changed / NAS 信号信息变化
	EventNASNetworkReject                                // NAS network reject / NAS 驻网拒绝
	EventNASIncrementalNetworkScan                       // NAS incremental network scan / NAS 增量搜网
	EventModemReset                                      // CTL revoke client ID (modem reset) / CTL撤销客户端ID (modem重置)
	EventNewMessage                                      // WMS new message / WMS新消息
	EventWMSSMSCAddress                                  // WMS SMSC address indication / WMS 短信中心地址指示
	EventWMSTransportNetworkRegistrationStatus           // WMS transport network registration status indication / WMS 传输网络注册状态指示
	EventIMSRegistrationStatus                           // IMSA registration status changed / IMSA 注册状态变化
	EventIMSServicesStatus                               // IMSA services status changed / IMSA 业务状态变化
	EventIMSSettingsChanged                              // IMS settings changed / IMS 配置状态变化
	EventVoiceCallStatus                                 // Voice all call status indication / VOICE 通话状态指示
	EventVoiceSupplementaryService                       // Voice supplementary service indication / VOICE 补充业务指示
	EventUSSD                                            // Voice USSD indication / Voice USSD指示
	EventVoiceUSSDReleased                               // Voice USSD released indication / VOICE USSD 释放指示
	EventVoiceUSSDNoWaitResult                           // Voice originate USSD no wait indication / VOICE 异步 USSD 指示
	EventSimStatusChanged                                // UIM SIM status changed / UIM SIM状态改变
	EventUIMSessionClosed                                // UIM session closed indication / UIM 会话关闭指示
	EventUIMRefresh                                      // UIM refresh indication / UIM 刷新指示
	EventUIMSlotStatus                                   // UIM slot status indication / UIM 卡槽状态指示
	EventNASEventReport                                  // NAS event report / NAS 事件报告
	EventVoiceSupplementaryServiceRequest                // Voice supplementary service request indication / VOICE 补充业务请求指示
)

type GERANCellLocationInfo

type GERANCellLocationInfo struct {
	CellID           uint32
	MCC              string
	MNC              string
	LAC              uint16
	ARFCN            uint16
	BaseStationID    uint8
	TimingAdvance    uint32
	HasTimingAdvance bool
	RXLevel          uint16
}

GERANCellLocationInfo contains serving GERAN cell fields.

type IMSAIndicationRegistration

type IMSAIndicationRegistration struct {
	RegistrationStatusChanged bool
	ServicesStatusChanged     bool
}

type IMSARegistrationState

type IMSARegistrationState uint32
const (
	IMSARegistrationStateNotRegistered     IMSARegistrationState = 0x00
	IMSARegistrationStateRegistering       IMSARegistrationState = 0x01
	IMSARegistrationStateRegistered        IMSARegistrationState = 0x02
	IMSARegistrationStateLimitedRegistered IMSARegistrationState = 0x03
)

type IMSARegistrationStatus

type IMSARegistrationStatus struct {
	Status          IMSARegistrationState
	HasStatus       bool
	ErrorCode       uint16
	HasErrorCode    bool
	ErrorMessage    string
	HasErrorMessage bool
	Technology      IMSARegistrationTechnology
	HasTechnology   bool
}

func ParseIMSARegistrationStatusChanged

func ParseIMSARegistrationStatusChanged(packet *Packet) (*IMSARegistrationStatus, error)

type IMSARegistrationTechnology

type IMSARegistrationTechnology uint32
const (
	IMSARegistrationTechnologyWLAN             IMSARegistrationTechnology = 0x00
	IMSARegistrationTechnologyWWAN             IMSARegistrationTechnology = 0x01
	IMSARegistrationTechnologyInterworkingWLAN IMSARegistrationTechnology = 0x02
)

type IMSAService

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

func NewIMSAService

func NewIMSAService(client *Client) (*IMSAService, error)

func (*IMSAService) Bind

func (i *IMSAService) Bind(ctx context.Context, binding uint32) error

func (*IMSAService) Close

func (i *IMSAService) Close() error

func (*IMSAService) GetIMSRegistrationStatus

func (i *IMSAService) GetIMSRegistrationStatus(ctx context.Context) (*IMSARegistrationStatus, error)

func (*IMSAService) GetIMSServicesStatus

func (i *IMSAService) GetIMSServicesStatus(ctx context.Context) (*IMSAServicesStatus, error)

func (*IMSAService) RegisterIndications

func (i *IMSAService) RegisterIndications(ctx context.Context, cfg IMSAIndicationRegistration) error

type IMSAServiceAvailability

type IMSAServiceAvailability uint32
const (
	IMSAServiceAvailabilityUnavailable IMSAServiceAvailability = 0x00
	IMSAServiceAvailabilityLimited     IMSAServiceAvailability = 0x01
	IMSAServiceAvailabilityAvailable   IMSAServiceAvailability = 0x02
)

type IMSAServicesStatus

type IMSAServicesStatus struct {
	SMSServiceStatus               IMSAServiceAvailability
	HasSMSServiceStatus            bool
	VoiceServiceStatus             IMSAServiceAvailability
	HasVoiceServiceStatus          bool
	VideoTelephonyServiceStatus    IMSAServiceAvailability
	HasVideoTelephonyServiceStatus bool
	SMSTechnology                  IMSARegistrationTechnology
	HasSMSTechnology               bool
	VoiceTechnology                IMSARegistrationTechnology
	HasVoiceTechnology             bool
	VideoTelephonyTechnology       IMSARegistrationTechnology
	HasVideoTelephonyTechnology    bool
	UETASServiceStatus             IMSAServiceAvailability
	HasUETASServiceStatus          bool
	UETASTechnology                IMSARegistrationTechnology
	HasUETASTechnology             bool
	VideoShareServiceStatus        IMSAServiceAvailability
	HasVideoShareServiceStatus     bool
	VideoShareTechnology           IMSARegistrationTechnology
	HasVideoShareTechnology        bool
}

func ParseIMSAServicesStatusChanged

func ParseIMSAServicesStatusChanged(packet *Packet) (*IMSAServicesStatus, error)

type IMSCallModePreference

type IMSCallModePreference uint8
const (
	IMSCallModePreferenceNone         IMSCallModePreference = 0x00
	IMSCallModePreferenceCellular     IMSCallModePreference = 0x01
	IMSCallModePreferenceWiFi         IMSCallModePreference = 0x02
	IMSCallModePreferenceWiFiOnly     IMSCallModePreference = 0x03
	IMSCallModePreferenceCellularOnly IMSCallModePreference = 0x04
	IMSCallModePreferenceIMS          IMSCallModePreference = 0x05
)

type IMSPEnablerState

type IMSPEnablerState uint32
const (
	IMSPEnablerStateUninitialized IMSPEnablerState = 0x01
	IMSPEnablerStateInitialized   IMSPEnablerState = 0x02
	IMSPEnablerStateAirplane      IMSPEnablerState = 0x03
	IMSPEnablerStateRegistered    IMSPEnablerState = 0x04
)

type IMSPService

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

func NewIMSPService

func NewIMSPService(client *Client) (*IMSPService, error)

func (*IMSPService) Close

func (i *IMSPService) Close() error

func (*IMSPService) GetEnablerState

func (i *IMSPService) GetEnablerState(ctx context.Context) (IMSPEnablerState, error)

type IMSService

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

func NewIMSService

func NewIMSService(client *Client) (*IMSService, error)

func (*IMSService) Bind

func (i *IMSService) Bind(ctx context.Context, binding uint32) error

func (*IMSService) Close

func (i *IMSService) Close() error

func (*IMSService) GetServicesEnabledSetting

func (i *IMSService) GetServicesEnabledSetting(ctx context.Context) (*IMSServicesEnabledSettings, error)

func (*IMSService) SetServicesEnabledSetting

func (i *IMSService) SetServicesEnabledSetting(ctx context.Context, update IMSServicesEnabledSettingsUpdate) error

type IMSServicesEnabledSettings

type IMSServicesEnabledSettings struct {
	VoiceOverLTEEnabled      bool
	HasVoiceOverLTEEnabled   bool
	VideoTelephonyEnabled    bool
	HasVideoTelephonyEnabled bool
	VoiceWiFiEnabled         bool
	HasVoiceWiFiEnabled      bool
	CallModePreference       IMSCallModePreference
	HasCallModePreference    bool
	IMSServiceEnabled        bool
	HasIMSServiceEnabled     bool
	UTServiceEnabled         bool
	HasUTServiceEnabled      bool
	SMSServiceEnabled        bool
	HasSMSServiceEnabled     bool
	USSDServiceEnabled       bool
	HasUSSDServiceEnabled    bool
	PresenceEnabled          bool
	HasPresenceEnabled       bool
	AutoconfigEnabled        bool
	HasAutoconfigEnabled     bool
	XDMClientEnabled         bool
	HasXDMClientEnabled      bool
	RCSEnabled               bool
	HasRCSEnabled            bool
	CarrierConfigEnabled     bool
	HasCarrierConfigEnabled  bool
}

func ParseIMSServicesEnabledSetting

func ParseIMSServicesEnabledSetting(packet *Packet) (*IMSServicesEnabledSettings, error)

type IMSServicesEnabledSettingsUpdate

type IMSServicesEnabledSettingsUpdate struct {
	VoiceOverLTEEnabled   *bool
	VideoTelephonyEnabled *bool
	VoiceWiFiEnabled      *bool
	CallModePreference    *IMSCallModePreference
	IMSServiceEnabled     *bool
	UTServiceEnabled      *bool
	SMSServiceEnabled     *bool
	USSDServiceEnabled    *bool
	PresenceEnabled       *bool
	AutoconfigEnabled     *bool
	XDMClientEnabled      *bool
	RCSEnabled            *bool
	CarrierConfigEnabled  *bool
}

type LTECellLocationInfo

type LTECellLocationInfo struct {
	UEInIdle                 bool
	MCC                      string
	MNC                      string
	TAC                      uint16
	GlobalCellID             uint32
	EARFCN                   uint16
	ServingCellID            uint16
	CellReselectionPriority  uint8
	SNonIntraSearchThreshold uint8
	ServingCellLowThreshold  uint8
	SIntraSearchThreshold    uint8
	HasIdleThresholds        bool
	TimingAdvance            uint32
	HasTimingAdvance         bool
}

LTECellLocationInfo contains serving LTE cell fields.

type LoopbackConfig

type LoopbackConfig struct {
	State             uint8  // 0x00: Disabled, 0x01: Enabled
	ReplicationFactor uint32 // Number of times to replicate the packet
}

LoopbackConfig configures loopback state / LoopbackConfig 配置回环状态

type MACAddressInfo

type MACAddressInfo struct {
	Type          uint32
	Address       []byte
	AddressString string
}

MACAddressInfo contains a raw MAC address plus a normalized printable string.

type ManualNetworkSelection

type ManualNetworkSelection struct {
	MCC              uint16
	MNC              uint16
	IncludesPCSDigit bool
}

ManualNetworkSelection holds manual PLMN selection fields.

type MessageMode

type MessageMode uint8
const (
	MessageModeCDMA MessageMode = 0x00
	MessageModeGW   MessageMode = 0x01
)

type MessageTagType

type MessageTagType uint8

MessageTagType for listing messages / 用于列出短信的消息标签类型

const (
	TagTypeMTRead    MessageTagType = 0x00 // MT: Mobile Terminated (Received) - Read / MT: 移动终端终结(接收)- 已读
	TagTypeMTNotRead MessageTagType = 0x01 // MT: Mobile Terminated (Received) - Not Read / MT: 移动终端终结(接收)- 未读
	TagTypeMOSent    MessageTagType = 0x02 // MO: Mobile Originated (Sent) - Sent / MO: 移动终端发起(发送)- 已发送
	TagTypeMONotSent MessageTagType = 0x03 // MO: Mobile Originated (Sent) - Not Sent / MO: 移动终端发起(发送)- 未发送
)

type MuxBinding

type MuxBinding struct {
	EpType     uint32 // Endpoint Type (e.g., 0x02 for HSUSB)
	EpIfID     uint32 // Interface ID (e.g., 4 for iface 4)
	MuxID      uint8  // QMAP Mux ID
	ClientType uint32 // Client Type (e.g., 1 for Tethered)
}

MuxBinding info for QMAP / QMAP 的 Mux 绑定信息

type NASIncrementalNetworkScanInfo

type NASIncrementalNetworkScanInfo struct {
	ScanComplete bool
	Results      []NetworkScanResult
}

func ParseIncrementalNetworkScanIndication

func ParseIncrementalNetworkScanIndication(packet *Packet) (*NASIncrementalNetworkScanInfo, error)

type NASIndicationRegistration

type NASIndicationRegistration struct {
	ServingSystemChanged        bool
	SystemInfo                  bool
	NetworkTime                 bool
	SignalInfo                  bool
	OperatorName                bool
	NetworkReject               bool
	IncrementalNetworkScan      bool
	EventReportSignalThresholds []int8
}

type NASInitiateNetworkRegisterRequest

type NASInitiateNetworkRegisterRequest struct {
	Mode              NASNetworkRegisterMode
	MCC               uint16
	MNC               uint16
	RadioAccessTech   uint8
	IncludesPCSDigit  bool
	ChangeDuration    uint8
	HasChangeDuration bool
}

type NASNetworkRegisterMode

type NASNetworkRegisterMode uint8
const (
	NASNetworkRegisterAutomatic NASNetworkRegisterMode = 0x01
	NASNetworkRegisterManual    NASNetworkRegisterMode = 0x02
)

type NASNetworkRejectInfo

type NASNetworkRejectInfo struct {
	RadioInterface uint8
	RejectCause    uint32
	PLMN           string
}

func ParseNetworkRejectIndication

func ParseNetworkRejectIndication(packet *Packet) (*NASNetworkRejectInfo, error)

type NASOperatorNameInfo

type NASOperatorNameInfo struct {
	ServiceProviderName string
	OperatorStringName  string
}

func ParseOperatorNameIndication

func ParseOperatorNameIndication(packet *Packet) (*NASOperatorNameInfo, error)

type NASPLMNNameInfo

type NASPLMNNameInfo struct {
	LongName  string
	ShortName string
}

type NASPLMNNameRequest

type NASPLMNNameRequest struct {
	MCC              uint16
	MNC              uint16
	IncludesPCSDigit bool
}

type NASService

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

func NewNASService

func NewNASService(client *Client) (*NASService, error)

NewNASService creates a NAS service wrapper / NewNASService创建一个NAS服务包装器

func NewNASServiceWithContext

func NewNASServiceWithContext(ctx context.Context, client *Client) (*NASService, error)

func (*NASService) AttachDetach

func (n *NASService) AttachDetach(ctx context.Context, attached bool) error

AttachDetach controls PS attach state.

func (*NASService) ClientID

func (n *NASService) ClientID() uint8

func (*NASService) Close

func (n *NASService) Close() error

Close releases the NAS client ID / Close释放NAS客户端ID

func (*NASService) ConfigSignalInfoV2

func (n *NASService) ConfigSignalInfoV2(ctx context.Context, cfg NASSignalInfoConfigV2) error

ConfigSignalInfoV2 sets signal-info indication reporting behavior.

func (*NASService) ForceNetworkSearch

func (n *NASService) ForceNetworkSearch(ctx context.Context) error

ForceNetworkSearch asks the modem to restart network search.

func (*NASService) GetCellLocationInfo

func (n *NASService) GetCellLocationInfo(ctx context.Context) (*CellLocationInfo, error)

GetCellLocationInfo returns serving-cell details for the current RAT.

func (*NASService) GetNetworkTime

func (n *NASService) GetNetworkTime(ctx context.Context) (*NetworkTimeInfo, error)

GetNetworkTime returns network-provided time values from 3GPP/3GPP2.

func (*NASService) GetOperatorName

func (n *NASService) GetOperatorName(ctx context.Context) (*NASOperatorNameInfo, error)

GetOperatorName returns current operator display names.

func (*NASService) GetPLMNName

func (n *NASService) GetPLMNName(ctx context.Context, req NASPLMNNameRequest) (*NASPLMNNameInfo, error)

GetPLMNName resolves PLMN long/short names for the given PLMN.

func (*NASService) GetRFBandInfo

func (n *NASService) GetRFBandInfo(ctx context.Context) (*RFBandInfo, error)

GetRFBandInfo returns current active band/channel details.

func (*NASService) GetServingSystem

func (n *NASService) GetServingSystem(ctx context.Context) (*ServingSystem, error)

GetServingSystem queries the current serving system / GetServingSystem查询当前服务系统

func (*NASService) GetSignalInfo

func (s *NASService) GetSignalInfo(ctx context.Context) (*SignalInfo, error)

GetSignalInfo gets detailed signal information (LTE/5G) / GetSignalInfo 获取详细信号信息 (LTE/5G)

func (*NASService) GetSignalStrength

func (n *NASService) GetSignalStrength(ctx context.Context) (*SignalStrength, error)

GetSignalStrength queries current signal strength / GetSignalStrength查询当前信号强度

func (*NASService) GetSysInfo

func (s *NASService) GetSysInfo(ctx context.Context) (*SysInfo, error)

GetSysInfo gets system information including Cell ID / GetSysInfo 获取系统信息,包括 Cell ID

func (*NASService) GetSystemSelectionPreference

func (n *NASService) GetSystemSelectionPreference(ctx context.Context) (*SystemSelectionPreference, error)

GetSystemSelectionPreference returns the modem system-selection policy.

func (*NASService) GetTechnologyPreference

func (n *NASService) GetTechnologyPreference(ctx context.Context) (*TechnologyPreference, error)

GetTechnologyPreference returns the active and persistent technology preference.

func (*NASService) InitiateNetworkRegister

func (n *NASService) InitiateNetworkRegister(ctx context.Context, req NASInitiateNetworkRegisterRequest) error

InitiateNetworkRegister starts network registration selection.

func (*NASService) IsRegistered

func (n *NASService) IsRegistered(ctx context.Context) (bool, error)

IsRegistered checks if we're registered on the network / IsRegistered检查我们是否已在网络上注册

func (*NASService) PerformNetworkScan

func (s *NASService) PerformNetworkScan(ctx context.Context) ([]NetworkScanResult, error)

PerformNetworkScan scans for available networks / PerformNetworkScan 扫描可用网络

func (*NASService) RegisterIndications

func (n *NASService) RegisterIndications() error

RegisterIndications enables NAS unsolicited indications / RegisterIndications启用NAS主动指示

func (*NASService) RegisterIndicationsWithConfig

func (n *NASService) RegisterIndicationsWithConfig(ctx context.Context, cfg NASIndicationRegistration) error

RegisterIndicationsWithConfig enables NAS indications via Register Indications (0x0003) and optionally configures Event Report thresholds (0x0002).

func (*NASService) SetSystemSelectionPreference

func (n *NASService) SetSystemSelectionPreference(ctx context.Context, pref SystemSelectionPreference) error

SetSystemSelectionPreference updates one or more system-selection policy fields.

func (*NASService) SetTechnologyPreference

func (n *NASService) SetTechnologyPreference(ctx context.Context, pref TechnologyPreference) error

SetTechnologyPreference updates the active technology preference.

type NASSignalInfoConfigV2

type NASSignalInfoConfigV2 struct {
	LTEEnabled    bool
	LTERSRPDelta  uint8
	LTERSRQDelta  uint8
	LTESNRDelta   uint8
	NR5GEnabled   bool
	NR5GRSRPDelta uint8
	NR5GRSRQDelta uint8
	NR5GSINRDelta uint8
}

type NR5GCellLocationInfo

type NR5GCellLocationInfo struct {
	MCC            string
	MNC            string
	TAC            uint32
	GlobalCellID   uint64
	PhysicalCellID uint16
	RSRQ           int16
	RSRP           int16
	SNR            int16
	ARFCN          uint32
	HasARFCN       bool
}

NR5GCellLocationInfo contains serving NR5G cell fields.

type NetworkScanResult

type NetworkScanResult struct {
	MCC         string
	MNC         string
	Status      uint8 // 0: Unknown, 1: Current, 2: Available, 3: Forbidden
	Description string
	RATs        []uint8
}

NetworkScanResult represents a network found during scan / NetworkScanResult 代表扫描期间发现的网络

type NetworkTime

type NetworkTime struct {
	Year                      uint16
	Month                     uint8
	Day                       uint8
	Hour                      uint8
	Minute                    uint8
	Second                    uint8
	DayOfWeek                 uint8
	TimezoneOffsetQuarters    int8
	DaylightSavingsAdjustment uint8
	RadioInterface            uint8
}

NetworkTime is one network time source returned by NAS.

type NetworkTimeInfo

type NetworkTimeInfo struct {
	ThreeGPP     NetworkTime
	HasThreeGPP  bool
	ThreeGPP2    NetworkTime
	HasThreeGPP2 bool
}

NetworkTimeInfo groups 3GPP and 3GPP2 time values.

func ParseNetworkTimeIndication

func ParseNetworkTimeIndication(packet *Packet) (*NetworkTimeInfo, error)

type NotSupportedError

type NotSupportedError struct {
	Operation string
}

func (*NotSupportedError) Error

func (e *NotSupportedError) Error() string

type OPLRecord

type OPLRecord struct {
	Record    int    `json:"record"`
	PLMN      string `json:"plmn,omitempty"`
	LACStart  uint16 `json:"lac_start,omitempty"`
	LACEnd    uint16 `json:"lac_end,omitempty"`
	PNNRecord int    `json:"pnn_record,omitempty"`
	RawHex    string `json:"raw_hex,omitempty"`
}

type OperatingMode

type OperatingMode uint8
const (
	ModeOnline       OperatingMode = 0x00
	ModeLowPower     OperatingMode = 0x01
	ModeFactoryTest  OperatingMode = 0x02
	ModeOffline      OperatingMode = 0x03
	ModeReset        OperatingMode = 0x04
	ModeShutdown     OperatingMode = 0x05
	ModePersistLow   OperatingMode = 0x06
	ModeOnlyLowPower OperatingMode = 0x07
)

type OutOfCallError

type OutOfCallError struct {
	Operation string
}

func (*OutOfCallError) Error

func (e *OutOfCallError) Error() string

type PINInfo

type PINInfo struct {
	Status             PINStatus
	VerifyRetriesLeft  uint8
	UnblockRetriesLeft uint8
}

type PINStatus

type PINStatus uint8
const (
	PINStatusNotInit     PINStatus = 0
	PINStatusNotVerified PINStatus = 1
	PINStatusVerified    PINStatus = 2
	PINStatusDisabled    PINStatus = 3
	PINStatusBlocked     PINStatus = 4
	PINStatusPermBlocked PINStatus = 5
	PINStatusUnblocked   PINStatus = 6
	PINStatusChanged     PINStatus = 7
)

type PNNRecord

type PNNRecord struct {
	Record    int    `json:"record"`
	FullName  string `json:"full_name,omitempty"`
	ShortName string `json:"short_name,omitempty"`
	RawHex    string `json:"raw_hex,omitempty"`
}

type PRLVersionInfo

type PRLVersionInfo struct {
	Version              uint16
	PRLOnlyPreference    bool
	HasPRLOnlyPreference bool
}

PRLVersionInfo contains PRL version metadata.

type Packet

type Packet struct {
	ServiceType   uint8
	ClientID      uint8
	TransactionID uint16 // For CTL, only lower 8 bits used / 对于CTL,仅使用低8位
	MessageID     uint16
	IsIndication  bool // True if this is an unsolicited indication / 如果是不请自来的指示消息则为真
	TLVs          []TLV
}

Packet represents a complete QMI message / Packet代表一个完整的QMI消息

func UnmarshalPacket

func UnmarshalPacket(data []byte) (*Packet, error)

UnmarshalPacket parses a complete QMI packet from bytes / 从字节解析完整的QMI数据包

func (*Packet) CheckResult

func (p *Packet) CheckResult() error

CheckResult checks for QMI error and returns it as a Go error / 检查QMI错误并将其作为Go错误返回

func (*Packet) GetResultCode

func (p *Packet) GetResultCode() (result uint16, err uint16, ok bool)

GetResultCode extracts the result code from TLV 0x02 / 从TLV 0x02提取结果代码

func (*Packet) IsSuccess

func (p *Packet) IsSuccess() bool

IsSuccess checks if the response indicates success / 检查响应是否表示成功

func (*Packet) Marshal

func (p *Packet) Marshal() []byte

Marshal serializes the packet to bytes / 将数据包序列化为字节

type PacketStatistics

type PacketStatistics struct {
	PresentMask          uint32
	TxPacketsOK          uint32
	RxPacketsOK          uint32
	TxPacketsError       uint32
	RxPacketsError       uint32
	TxOverflows          uint32
	RxOverflows          uint32
	TxBytesOK            uint64
	RxBytesOK            uint64
	LastCallTxBytesOK    uint64
	HasLastCallTxBytesOK bool
	LastCallRxBytesOK    uint64
	HasLastCallRxBytesOK bool
	TxPacketsDropped     uint32
	RxPacketsDropped     uint32
}

PacketStatistics contains counters returned by WDS Get Packet Statistics.

type PowerStateInfo

type PowerStateInfo struct {
	Flags              uint8
	BatteryLevel       uint8
	ExternalSource     bool
	BatteryConnected   bool
	BatteryCharging    bool
	PowerFaultDetected bool
}

PowerStateInfo contains the modem power source and battery state flags.

type ProfileInfo

type ProfileInfo struct {
	Type  uint8 // 0: 3GPP, 1: 3GPP2
	Index uint8
	Name  string
}

ProfileInfo represents minimal profile information / ProfileInfo 代表最小化的 Profile 信息

type QMAPSettings

type QMAPSettings struct {
	InBandFlowControl uint8 // 0x00: Disabled, 0x01: Enabled
}

QMAPSettings configures QMAP (Qualcomm Mobile Access Point) parameters / QMAPSettings 配置 QMAP 参数

type QMIError

type QMIError struct {
	Service   uint8  // QMI service type / QMI 服务类型
	MessageID uint16 // Message ID that caused the error / 导致错误的消息 ID
	Result    uint16 // QMI result code / QMI 结果码
	ErrorCode uint16 // QMI error code / QMI 错误码
}

QMIError represents a QMI protocol error / QMIError 表示 QMI 协议错误

func GetQMIError

func GetQMIError(err error) *QMIError

GetQMIError extracts QMIError from err / GetQMIError 从 err 中提取 QMIError

func (*QMIError) Error

func (e *QMIError) Error() string

type QMIUIM_PIN_STATE

type QMIUIM_PIN_STATE struct {
	UnivPIN     uint8
	PIN1State   uint8
	PIN1Retries uint8
	PUK1Retries uint8
	PIN2State   uint8
	PIN2Retries uint8
	PUK2Retries uint8
}

type QmuxHeader

type QmuxHeader struct {
	IFType       uint8
	Length       uint16
	ControlFlags uint8
	ServiceType  uint8
	ClientID     uint8
}

QmuxHeader represents the 6-byte QMUX header / QmuxHeader代表6字节QMUX头 Offset 0: IFType (always 0x01) / 偏移0: 接口类型 (QMUX始终为0x01) Offset 1-2: Length (little-endian, total length after IFType) / 偏移1-2: 长度 (小端序,IFType之后的总长度) Offset 3: ControlFlags (0x00 for normal, 0x80 for service) / 偏移3: 控制标志 (0x00为普通,0x80为服务) Offset 4: ServiceType / 偏移4: 服务类型 Offset 5: ClientID / 偏移5: 客户端ID

func UnmarshalQmuxHeader

func UnmarshalQmuxHeader(data []byte) (*QmuxHeader, error)

func (*QmuxHeader) Marshal

func (h *QmuxHeader) Marshal() []byte

type RFBandInfo

type RFBandInfo struct {
	Bands      []RFBandInfoEntry
	Bandwidths []RFBandwidthInfo
}

RFBandInfo groups active band/channel and bandwidth information.

type RFBandInfoEntry

type RFBandInfoEntry struct {
	RadioInterface  uint8
	ActiveBandClass uint16
	ActiveChannel   uint32
}

RFBandInfoEntry describes one active RF band/channel tuple.

type RFBandwidthInfo

type RFBandwidthInfo struct {
	RadioInterface uint8
	Bandwidth      uint32
}

RFBandwidthInfo describes the configured downlink bandwidth for one radio interface.

type RegistrationState

type RegistrationState uint8
const (
	RegStateNotRegistered RegistrationState = 0
	RegStateRegistered    RegistrationState = 1
	RegStateSearching     RegistrationState = 2
	RegStateDenied        RegistrationState = 3
	RegStateUnknown       RegistrationState = 4
	RegStateRoaming       RegistrationState = 5
)

func (RegistrationState) String

func (r RegistrationState) String() string

type RuntimeSettings

type RuntimeSettings struct {
	IPv4Address net.IP
	IPv4Subnet  net.IPMask
	IPv4Gateway net.IP
	IPv4DNS1    net.IP
	IPv4DNS2    net.IP
	IPv6Address net.IP
	IPv6Prefix  int
	IPv6Gateway net.IP
	IPv6DNS1    net.IP
	IPv6DNS2    net.IP
	MTU         int
}

RuntimeSettings contains IP configuration from the network / RuntimeSettings包含来自网络的IP配置

type SIMMetadata

type SIMMetadata struct {
	NativeMCC    string
	NativeMNC    string
	GID1         string
	GID2         string
	PNN          []PNNRecord
	OPL          []OPLRecord
	ServiceTable *SIMServiceTable
}

type SIMServiceTable

type SIMServiceTable struct {
	Kind            string `json:"kind,omitempty"`
	RawHex          string `json:"raw_hex,omitempty"`
	EnabledServices []int  `json:"enabled_services,omitempty"`
}

type SIMStatus

type SIMStatus uint8
const (
	SIMAbsent        SIMStatus = 0
	SIMNotReady      SIMStatus = 1
	SIMReady         SIMStatus = 2
	SIMPINRequired   SIMStatus = 3
	SIMPUKRequired   SIMStatus = 4
	SIMBlocked       SIMStatus = 5
	SIMNetworkLocked SIMStatus = 6
)

func (SIMStatus) String

func (s SIMStatus) String() string

type ServiceHeader

type ServiceHeader struct {
	ControlFlags  uint8
	TransactionID uint16
	MessageID     uint16
	Length        uint16
}

ServiceHeader is used for all services except Control (Service 0) / ServiceHeader用于除控制服务(Service 0)外的所有服务 Offset 0: ControlFlags / 偏移0: 控制标志 Offset 1-2: TransactionID (2 bytes, little-endian) / 偏移1-2: 事务ID (2字节,小端序) Offset 3-4: MessageID (little-endian) / 偏移3-4: 消息ID (小端序) Offset 5-6: Length (little-endian) / 偏移5-6: 长度 (小端序)

func UnmarshalServiceHeader

func UnmarshalServiceHeader(data []byte) (*ServiceHeader, error)

func (*ServiceHeader) Marshal

func (h *ServiceHeader) Marshal() []byte

type ServiceVersion

type ServiceVersion struct {
	ServiceType uint8  // QMI 服务类型 (如 ServiceWDS, ServiceNAS 等)
	Major       uint16 // 主版本号
	Minor       uint16 // 次版本号
}

ServiceVersion 表示 modem 上某个 QMI 服务的版本信息

type ServingSystem

type ServingSystem struct {
	RegistrationState RegistrationState
	PSAttached        bool
	RadioInterface    uint8 // common QMI values: 0=none, 4=GSM, 5=UMTS, 8=LTE, 10=NR5G / 常见 QMI 值:0=无, 4=GSM, 5=UMTS, 8=LTE, 10=NR5G
	MCC               uint16
	MNC               uint16
}

ServingSystem contains network registration info / ServingSystem包含网络注册信息

func ParseServingSystemIndication

func ParseServingSystemIndication(packet *Packet) (*ServingSystem, error)

type SignalInfo

type SignalInfo struct {
	// LTE specific
	LTERSRP  int16 // Reference Signal Received Power
	LTERSRQ  int16 // Reference Signal Received Quality
	LTERSSNR int16 // Signal-to-Noise Ratio

	// 5G specific
	NR5GRSRP int16
	NR5GRSRQ int16
	NR5GSINR int16
}

SignalInfo contains detailed signal strength information / SignalInfo 包含详细的信号强度信息

func ParseSignalInfoIndication

func ParseSignalInfoIndication(packet *Packet) (*SignalInfo, error)

type SignalStrength

type SignalStrength struct {
	RSSI int8  // dBm
	ECIO int16 // dB * 10 (for UMTS) / dB * 10 (用于UMTS)
	RSRP int16 // dBm (for LTE) / dBm (用于LTE)
	RSRQ int8  // dB (for LTE) / dB (用于LTE)
	SNR  int16 // dB * 10 (for LTE) / dB * 10 (用于LTE)
}

SignalStrength contains signal quality info / SignalStrength包含信号质量信息

type StartNetworkError

type StartNetworkError struct {
	Err    error
	Reason *CallEndReason
}

func (*StartNetworkError) Error

func (e *StartNetworkError) Error() string

func (*StartNetworkError) Unwrap

func (e *StartNetworkError) Unwrap() error

type StopNetworkInterfaceOptions

type StopNetworkInterfaceOptions struct {
	Handle             uint32
	DisableAutoconnect bool
}

type SysInfo

type SysInfo struct {
	CellID uint64
	TAC    uint16 // Tracking Area Code
	LAC    uint16 // Location Area Code
}

SysInfo contains system information / SysInfo 包含系统信息

func ParseSysInfoIndication

func ParseSysInfoIndication(packet *Packet) (*SysInfo, error)

type SystemSelectionPreference

type SystemSelectionPreference struct {
	EmergencyMode                              bool
	HasEmergencyMode                           bool
	ModePreference                             uint16
	HasModePreference                          bool
	BandPreference                             uint64
	HasBandPreference                          bool
	CDMAPRLPreference                          uint16
	HasCDMAPRLPreference                       bool
	RoamingPreference                          uint16
	HasRoamingPreference                       bool
	LTEBandPreference                          uint64
	HasLTEBandPreference                       bool
	TDSCDMABandPreference                      uint64
	HasTDSCDMABandPreference                   bool
	NetworkSelectionPreference                 uint8
	HasNetworkSelectionPreference              bool
	ManualNetworkSelection                     ManualNetworkSelection
	HasManualNetworkSelection                  bool
	ChangeDuration                             uint8
	HasChangeDuration                          bool
	ServiceDomainPreference                    uint32
	HasServiceDomainPreference                 bool
	GSMWCDMAAcquisitionOrderPreference         uint32
	HasGSMWCDMAAcquisitionOrderPreference      bool
	AcquisitionOrderPreference                 []uint8
	DisabledModes                              uint16
	HasDisabledModes                           bool
	NetworkSelectionRegistrationRestriction    uint32
	HasNetworkSelectionRegistrationRestriction bool
	UsagePreference                            uint32
	HasUsagePreference                         bool
	VoiceDomainPreference                      uint32
	HasVoiceDomainPreference                   bool
	ExtendedLTEBandPreference                  [4]uint64
	HasExtendedLTEBandPreference               bool
	NR5GSABandPreference                       [8]uint64
	HasNR5GSABandPreference                    bool
	NR5GNSABandPreference                      [8]uint64
	HasNR5GNSABandPreference                   bool
}

SystemSelectionPreference models the commonly used NAS system-selection knobs.

type TLV

type TLV struct {
	Type  uint8
	Value []byte
}

TLV represents a single Type-Length-Value entry / TLV 代表单个 Type-Length-Value 条目

func FindTLV

func FindTLV(tlvs []TLV, tlvType uint8) *TLV

FindTLV finds a TLV by type in a slice / 在切片中查找指定类型的TLV

func NewTLVString

func NewTLVString(t uint8, s string) TLV

func NewTLVUint8

func NewTLVUint8(t uint8, v uint8) TLV

func NewTLVUint16

func NewTLVUint16(t uint8, v uint16) TLV

func NewTLVUint32

func NewTLVUint32(t uint8, v uint32) TLV

func ParseTLVs

func ParseTLVs(data []byte) ([]TLV, error)

ParseTLVs parses multiple TLVs from a byte slice / 从字节切片解析多个TLV

func UnmarshalTLV

func UnmarshalTLV(data []byte) (*TLV, int, error)

func (*TLV) Marshal

func (t *TLV) Marshal() []byte

type TLVMeta

type TLVMeta struct {
	Type   uint8
	Length int
}

TLVMeta contains a TLV type/length pair without exposing the raw payload.

type TechnologyPreference

type TechnologyPreference struct {
	ActivePreference        uint16
	ActiveDuration          uint8
	PersistentPreference    uint16
	HasPersistentPreference bool
}

TechnologyPreference contains active and persistent RAT preference information.

type TimeInfo

type TimeInfo struct {
	DeviceTimeCount uint64
	TimeSource      uint16
	SystemTime      uint64
	HasSystemTime   bool
	UserTime        uint64
	HasUserTime     bool
}

TimeInfo contains the raw DMS device/system/user time counters.

type TimeoutError

type TimeoutError struct {
	Operation string // Operation that timed out / 超时的操作
}

TimeoutError represents a timeout / TimeoutError 表示超时

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type UIMCardResult

type UIMCardResult struct {
	SW1 uint8
	SW2 uint8
}

type UIMChangeProvisioningSessionRequest

type UIMChangeProvisioningSessionRequest struct {
	SessionType           uint8
	Activate              bool
	Slot                  *uint8
	ApplicationIdentifier []byte
}

type UIMFileAttributes

type UIMFileAttributes struct {
	CardResult                   UIMCardResult
	HasCardResult                bool
	FileSize                     uint16
	FileID                       uint16
	FileType                     uint8
	RecordSize                   uint16
	RecordCount                  uint16
	ReadSecurity                 UIMSecurityAttributes
	WriteSecurity                UIMSecurityAttributes
	IncreaseSecurity             UIMSecurityAttributes
	DeactivateSecurity           UIMSecurityAttributes
	ActivateSecurity             UIMSecurityAttributes
	RawData                      []byte
	ResponseInIndicationToken    uint32
	HasResponseInIndicationToken bool
}

type UIMRecordData

type UIMRecordData struct {
	CardResult                   UIMCardResult
	HasCardResult                bool
	Data                         []byte
	AdditionalData               []byte
	ResponseInIndicationToken    uint32
	HasResponseInIndicationToken bool
}

type UIMRefreshCompleteRequest

type UIMRefreshCompleteRequest struct {
	SessionType           uint8
	ApplicationIdentifier []byte
	RefreshSuccess        bool
}

type UIMRefreshFile

type UIMRefreshFile struct {
	FileID uint16
	Path   []uint8
}

type UIMRefreshIndication

type UIMRefreshIndication struct {
	Stage                 uint8
	Mode                  uint8
	SessionType           uint8
	ApplicationIdentifier []byte
	Files                 []UIMRefreshFile
}

func ParseUIMRefreshIndication

func ParseUIMRefreshIndication(packet *Packet) (*UIMRefreshIndication, error)

ParseUIMRefreshIndication parses UIM refresh indication (0x0033).

type UIMRefreshRegisterAllRequest

type UIMRefreshRegisterAllRequest struct {
	SessionType           uint8
	ApplicationIdentifier []byte
	RegisterFlag          bool
}

type UIMRefreshRegisterRequest

type UIMRefreshRegisterRequest struct {
	SessionType           uint8
	ApplicationIdentifier []byte
	RegisterFlag          bool
	VoteForInit           bool
	Files                 []UIMRefreshFile
}

type UIMSecurityAttributes

type UIMSecurityAttributes struct {
	Logic      uint8
	Attributes uint16
}

type UIMService

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

func NewUIMService

func NewUIMService(client *Client) (*UIMService, error)

NewUIMService creates a UIM service wrapper / NewUIMService创建一个UIM服务包装器

func NewUIMServiceWithContext

func NewUIMServiceWithContext(ctx context.Context, client *Client) (*UIMService, error)

func (*UIMService) ChangePIN

func (u *UIMService) ChangePIN(ctx context.Context, pinID uint8, oldPIN, newPIN string) error

ChangePIN changes the PIN code / ChangePIN 修改 PIN 码

func (*UIMService) ChangeProvisioningSession

func (u *UIMService) ChangeProvisioningSession(ctx context.Context, req UIMChangeProvisioningSessionRequest) error

ChangeProvisioningSession changes UIM provisioning session state.

func (*UIMService) Close

func (u *UIMService) Close() error

Close releases the UIM client ID / Close释放UIM客户端ID

func (*UIMService) CloseLogicalChannel

func (u *UIMService) CloseLogicalChannel(ctx context.Context, slot uint8, channel uint8) error

CloseLogicalChannel closes the given logical channel on the target slot.

func (*UIMService) GetCardStatus

func (u *UIMService) GetCardStatus(ctx context.Context) (SIMStatus, error)

GetCardStatus queries the UIM card status / GetCardStatus查询UIM卡状态

func (*UIMService) GetCardStatusDetails

func (u *UIMService) GetCardStatusDetails(ctx context.Context) (*CardStatusDetails, SIMStatus, error)

func (*UIMService) GetFileAttributes

func (u *UIMService) GetFileAttributes(ctx context.Context, fileID uint16, path []uint8) (*UIMFileAttributes, error)

GetFileAttributes retrieves metadata for a SIM/USIM file using the default primary GW session.

func (*UIMService) GetFileAttributesWithSession

func (u *UIMService) GetFileAttributesWithSession(ctx context.Context, sessionType uint8, fileID uint16, path []uint8) (*UIMFileAttributes, error)

GetFileAttributesWithSession retrieves metadata for a SIM/USIM file using an explicit UIM session.

func (*UIMService) GetGID1

func (u *UIMService) GetGID1(ctx context.Context) (string, error)

func (*UIMService) GetGID2

func (u *UIMService) GetGID2(ctx context.Context) (string, error)

func (*UIMService) GetICCID

func (u *UIMService) GetICCID(ctx context.Context) (string, error)

func (*UIMService) GetIMSI

func (u *UIMService) GetIMSI(ctx context.Context) (string, error)

func (*UIMService) GetISIMAID

func (u *UIMService) GetISIMAID(ctx context.Context) ([]byte, error)

func (*UIMService) GetNativeMCCMNC

func (u *UIMService) GetNativeMCCMNC(ctx context.Context) (mcc string, mnc string, err error)

func (*UIMService) GetNativeSPN

func (u *UIMService) GetNativeSPN(ctx context.Context) (string, error)

func (*UIMService) GetOPLRecords

func (u *UIMService) GetOPLRecords(ctx context.Context) ([]OPLRecord, error)

func (*UIMService) GetPNNRecords

func (u *UIMService) GetPNNRecords(ctx context.Context) ([]PNNRecord, error)

func (*UIMService) GetSIMMetadata

func (u *UIMService) GetSIMMetadata(ctx context.Context) (*SIMMetadata, error)

func (*UIMService) GetSIMServiceTable

func (u *UIMService) GetSIMServiceTable(ctx context.Context) (*SIMServiceTable, error)

func (*UIMService) GetSlotStatus

func (u *UIMService) GetSlotStatus(ctx context.Context) (*UIMSlotStatus, error)

GetSlotStatus returns physical/logical slot mapping and optional eUICC details.

func (*UIMService) GetSupportedMessages

func (u *UIMService) GetSupportedMessages(ctx context.Context) ([]uint8, error)

GetSupportedMessages returns UIM message IDs supported by the modem.

func (*UIMService) GetUSIMAID

func (u *UIMService) GetUSIMAID(ctx context.Context) ([]byte, error)

func (*UIMService) OpenLogicalChannel

func (u *UIMService) OpenLogicalChannel(ctx context.Context, slot uint8, aid []byte) (byte, error)

OpenLogicalChannel opens a logical channel on the target slot and selects the given AID.

func (*UIMService) PowerOffSIM

func (u *UIMService) PowerOffSIM(ctx context.Context, slot uint8) error

PowerOffSIM powers off the SIM card in the specified slot.

func (*UIMService) PowerOnSIM

func (u *UIMService) PowerOnSIM(ctx context.Context, slot uint8) error

PowerOnSIM powers on the SIM card in the specified slot.

func (*UIMService) ReadRecord

func (u *UIMService) ReadRecord(ctx context.Context, fileID uint16, path []uint8, recordNumber uint16, recordLength uint16) (*UIMRecordData, error)

ReadRecord reads one record from a record-oriented EF using the default primary GW session.

func (*UIMService) ReadRecordWithSession

func (u *UIMService) ReadRecordWithSession(ctx context.Context, sessionType uint8, fileID uint16, path []uint8, recordNumber uint16, recordLength uint16) (*UIMRecordData, error)

ReadRecordWithSession reads one record from a record-oriented EF using an explicit UIM session.

func (*UIMService) ReadTransparent

func (u *UIMService) ReadTransparent(ctx context.Context, fileID uint16, path []uint8) ([]byte, error)

ReadTransparent reads a transparent file from the SIM card / ReadTransparent 从 SIM 卡读取透明文件 fileID: e.g. 0x2FE2 for ICCID, 0x6F07 for IMSI

func (*UIMService) ReadTransparentWithSession

func (u *UIMService) ReadTransparentWithSession(ctx context.Context, sessionType uint8, fileID uint16, path []uint8) ([]byte, error)

func (*UIMService) RefreshComplete

func (u *UIMService) RefreshComplete(ctx context.Context, req UIMRefreshCompleteRequest) error

RefreshComplete notifies the modem that refresh handling is finished.

func (*UIMService) RefreshRegister

func (u *UIMService) RefreshRegister(ctx context.Context, req UIMRefreshRegisterRequest) error

RefreshRegister registers refresh files and voting preference.

func (*UIMService) RefreshRegisterAll

func (u *UIMService) RefreshRegisterAll(ctx context.Context, req UIMRefreshRegisterAllRequest) error

RefreshRegisterAll registers all files for refresh handling.

func (*UIMService) RegisterEvents

func (u *UIMService) RegisterEvents(ctx context.Context, mask uint32) (uint32, error)

RegisterEvents enables UIM indications and returns the modem-accepted mask when present.

func (*UIMService) Reset

func (u *UIMService) Reset(ctx context.Context) error

Reset resets UIM service state.

func (*UIMService) SendAPDU

func (u *UIMService) SendAPDU(ctx context.Context, slot uint8, channel uint8, command []byte) ([]byte, error)

SendAPDU transmits a raw APDU on the given logical channel and slot.

func (*UIMService) SetPINProtection

func (u *UIMService) SetPINProtection(ctx context.Context, pinID uint8, enabled bool, pin string) error

SetPINProtection enables or disables PIN protection / SetPINProtection 启用或禁用 PIN 保护

func (*UIMService) SwitchSlot

func (u *UIMService) SwitchSlot(ctx context.Context, logicalSlot uint8, physicalSlot uint32) error

SwitchSlot remaps a logical slot to a target physical slot.

func (*UIMService) UnblockPIN

func (u *UIMService) UnblockPIN(ctx context.Context, pinID uint8, puk, newPIN string) error

UnblockPIN unblocks the PIN using PUK / UnblockPIN 使用 PUK 解锁 PIN

func (*UIMService) VerifyPIN

func (u *UIMService) VerifyPIN(ctx context.Context, pinID uint8, pin string) error

VerifyPIN verifies the PIN code / VerifyPIN 验证 PIN 码

type UIMSlotStatus

type UIMSlotStatus struct {
	Slots []UIMSlotStatusSlot
}

func ParseUIMSlotStatusIndication

func ParseUIMSlotStatusIndication(packet *Packet) (*UIMSlotStatus, error)

ParseUIMSlotStatusIndication parses UIM slot status indication (0x0048).

type UIMSlotStatusSlot

type UIMSlotStatusSlot struct {
	PhysicalCardStatus uint32
	PhysicalSlotStatus uint32
	LogicalSlot        uint8
	ICCIDRaw           []byte
	ICCID              string
	CardProtocol       uint32
	ValidApplications  uint8
	ATR                []byte
	HasExtendedInfo    bool
	IsEUICC            bool
	EID                []byte
	HasEID             bool
}

type UMTSCellLocationInfo

type UMTSCellLocationInfo struct {
	CellID                uint32
	MCC                   string
	MNC                   string
	LAC                   uint16
	UARFCN                uint16
	PrimaryScramblingCode uint16
	RSCP                  int16
	ECIO                  int16
}

UMTSCellLocationInfo contains serving UMTS cell fields.

type VOICEService

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

func NewVOICEService

func NewVOICEService(client *Client) (*VOICEService, error)

func NewVOICEServiceWithContext

func NewVOICEServiceWithContext(ctx context.Context, client *Client) (*VOICEService, error)

func (*VOICEService) AnswerCall

func (v *VOICEService) AnswerCall(ctx context.Context, callID uint8) (uint8, error)

func (*VOICEService) AnswerUSSD

func (v *VOICEService) AnswerUSSD(ctx context.Context, req VoiceUSSDRequest) error

func (*VOICEService) BurstDTMF

func (v *VOICEService) BurstDTMF(ctx context.Context, callID uint8, digits string) (uint8, error)

func (*VOICEService) CancelUSSD

func (v *VOICEService) CancelUSSD(ctx context.Context) error

func (*VOICEService) Close

func (v *VOICEService) Close() error

func (*VOICEService) DialCall

func (v *VOICEService) DialCall(ctx context.Context, number string) (uint8, error)

func (*VOICEService) EndCall

func (v *VOICEService) EndCall(ctx context.Context, callID uint8) (uint8, error)

func (*VOICEService) GetAllCallInfo

func (v *VOICEService) GetAllCallInfo(ctx context.Context) (*VoiceAllCallInfo, error)

func (*VOICEService) GetCallWaiting

func (v *VOICEService) GetCallWaiting(ctx context.Context, serviceClass uint8) (uint8, error)

func (*VOICEService) GetConfig

func (v *VOICEService) GetConfig(ctx context.Context, query VoiceConfigQuery) (*VoiceConfig, error)

func (*VOICEService) GetSupportedMessages

func (v *VOICEService) GetSupportedMessages(ctx context.Context) ([]uint8, error)

func (*VOICEService) IndicationRegister

func (v *VOICEService) IndicationRegister(ctx context.Context, cfg VoiceIndicationRegistration) error

func (*VOICEService) ManageCalls

func (v *VOICEService) ManageCalls(ctx context.Context, req VoiceManageCallsRequest) error

func (*VOICEService) OriginateUSSD

func (v *VOICEService) OriginateUSSD(ctx context.Context, req VoiceUSSDRequest) (*VoiceUSSDResponse, error)

func (*VOICEService) OriginateUSSDNoWait

func (v *VOICEService) OriginateUSSDNoWait(ctx context.Context, req VoiceUSSDRequest) error

func (*VOICEService) StartContinuousDTMF

func (v *VOICEService) StartContinuousDTMF(ctx context.Context, callID uint8, digit uint8) (uint8, error)

func (*VOICEService) StopContinuousDTMF

func (v *VOICEService) StopContinuousDTMF(ctx context.Context, callID uint8) (uint8, error)

type VoiceAMRStatus

type VoiceAMRStatus struct {
	GSM   bool
	WCDMA uint8
}

type VoiceAllCallInfo

type VoiceAllCallInfo struct {
	Calls              []VoiceCallInfo
	RemotePartyNumbers []VoiceRemotePartyNumber
}

func ParseVoiceAllCallStatus

func ParseVoiceAllCallStatus(packet *Packet) (*VoiceAllCallInfo, error)

type VoiceCallDirection

type VoiceCallDirection uint8

type VoiceCallInfo

type VoiceCallInfo struct {
	ID        uint8
	State     VoiceCallState
	Type      uint8
	Direction VoiceCallDirection
	Mode      VoiceCallMode
	Multipart bool
	ALS       uint8
}

type VoiceCallMode

type VoiceCallMode uint8

type VoiceCallState

type VoiceCallState uint8

type VoiceConfig

type VoiceConfig struct {
	AutoAnswerStatus                 bool
	HasAutoAnswerStatus              bool
	AirTimer                         VoiceTimerCount
	HasAirTimer                      bool
	RoamTimer                        VoiceTimerCount
	HasRoamTimer                     bool
	CurrentTTYMode                   uint8
	HasCurrentTTYMode                bool
	PreferredVoiceSO                 VoicePreferredVoiceSO
	HasPreferredVoiceSO              bool
	CurrentAMRStatus                 VoiceAMRStatus
	HasCurrentAMRStatus              bool
	CurrentVoicePrivacyPreference    uint8
	HasCurrentVoicePrivacyPreference bool
	CurrentVoiceDomainPreference     uint8
	HasCurrentVoiceDomainPreference  bool
}

type VoiceConfigQuery

type VoiceConfigQuery struct {
	AutoAnswer            bool
	AirTimer              bool
	RoamTimer             bool
	TTYMode               bool
	PreferredVoiceSO      bool
	AMRStatus             bool
	PreferredVoicePrivacy bool
	NAMIndex              bool
	VoiceDomainPreference bool
}

type VoiceIndicationRegistration

type VoiceIndicationRegistration struct {
	DTMFEvents                                      bool
	VoicePrivacyEvents                              bool
	SupplementaryServiceNotificationEvents          bool
	CallNotificationEvents                          bool
	HandoverEvents                                  bool
	SpeechCodecEvents                               bool
	USSDNotificationEvents                          bool
	ModificationEvents                              bool
	UUSEvents                                       bool
	AOCEvents                                       bool
	ConferenceEvents                                bool
	ExtendedBurstTypeInternationalInformationEvents bool
	MTPageMissInformationEvents                     bool
}

type VoiceManageCallsRequest

type VoiceManageCallsRequest struct {
	ServiceType uint8
	CallID      uint8
}

type VoicePreferredVoiceSO

type VoicePreferredVoiceSO struct {
	NAMID                             uint8
	EVRCCapability                    bool
	HomePageVoiceServiceOption        uint16
	HomeOriginationVoiceServiceOption uint16
	RoamOriginationVoiceServiceOption uint16
}

type VoiceRemotePartyNumber

type VoiceRemotePartyNumber struct {
	CallID                uint8
	PresentationIndicator uint8
	Number                string
	RawNumber             []byte
}

type VoiceSupplementaryServiceIndication

type VoiceSupplementaryServiceIndication struct {
	CallID           uint8
	NotificationType uint8
}

func ParseVoiceSupplementaryServiceIndication

func ParseVoiceSupplementaryServiceIndication(packet *Packet) (*VoiceSupplementaryServiceIndication, error)

type VoiceSupplementaryServiceRequest

type VoiceSupplementaryServiceRequest struct {
	Action uint8
	Reason uint8
}

type VoiceSupplementaryServiceRequestIndication

type VoiceSupplementaryServiceRequestIndication struct {
	Request                 uint8
	ModifiedByCallControl   bool
	HasInfo                 bool
	ServiceClass            uint8
	HasServiceClass         bool
	Reason                  uint8
	HasReason               bool
	USSData                 *VoiceUSSDPayload
	CallID                  uint8
	HasCallID               bool
	Alpha                   *VoiceUSSDPayload
	DataSource              uint8
	HasDataSource           bool
	FailureCause            uint16
	HasFailureCause         bool
	EncodedDataUTF16        []uint16
	ExtendedServiceClass    uint8
	HasExtendedServiceClass bool
}

func ParseVoiceSupplementaryServiceRequestIndication

func ParseVoiceSupplementaryServiceRequestIndication(packet *Packet) (*VoiceSupplementaryServiceRequestIndication, error)

type VoiceSupplementaryServiceStatus

type VoiceSupplementaryServiceStatus struct {
	Active      bool
	Provisioned bool
}

type VoiceTimerCount

type VoiceTimerCount struct {
	NAMID   uint8
	Minutes uint32
}

type VoiceUSSDIndication

type VoiceUSSDIndication struct {
	UserAction    VoiceUserAction
	HasUserAction bool
	USSData       *VoiceUSSDPayload
	USSDataUTF16  []uint16
}

func ParseVoiceUSSDIndication

func ParseVoiceUSSDIndication(packet *Packet) (*VoiceUSSDIndication, error)

type VoiceUSSDNoWaitIndication

type VoiceUSSDNoWaitIndication struct {
	ErrorCode       uint16
	HasErrorCode    bool
	FailureCause    uint16
	HasFailureCause bool
	USSData         *VoiceUSSDPayload
	Alpha           *VoiceUSSDPayload
	USSDataUTF16    []uint16
}

func ParseVoiceUSSDNoWaitIndication

func ParseVoiceUSSDNoWaitIndication(packet *Packet) (*VoiceUSSDNoWaitIndication, error)

type VoiceUSSDPayload

type VoiceUSSDPayload struct {
	DCS  uint8
	Data []byte
	Text string
}

type VoiceUSSDRequest

type VoiceUSSDRequest struct {
	DCS  uint8
	Data []byte
}

type VoiceUSSDResponse

type VoiceUSSDResponse struct {
	FailureCause                             uint16
	HasFailureCause                          bool
	Alpha                                    *VoiceUSSDPayload
	USSData                                  *VoiceUSSDPayload
	CallControlResultType                    uint8
	HasCallControlResultType                 bool
	CallID                                   uint8
	HasCallID                                bool
	CallControlSupplementaryServiceType      uint8
	HasCallControlSupplementaryServiceType   bool
	CallControlSupplementaryServiceReason    uint8
	HasCallControlSupplementaryServiceReason bool
	USSDataUTF16                             []uint16
}

type VoiceUserAction

type VoiceUserAction uint8

type WDAService

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

WDAService implements the QMI WDA service / WDAService 实现 QMI WDA 服务

func NewWDAService

func NewWDAService(client *Client) (*WDAService, error)

NewWDAService creates a new WDA client / NewWDAService创建一个新的WDA客户端

func NewWDAServiceWithContext

func NewWDAServiceWithContext(ctx context.Context, client *Client) (*WDAService, error)

func (*WDAService) ClientID

func (s *WDAService) ClientID() uint8

func (*WDAService) Close

func (s *WDAService) Close() error

func (*WDAService) GetDataFormat

func (s *WDAService) GetDataFormat(ctx context.Context) (*DataFormat, error)

GetDataFormat gets the current data format configuration / GetDataFormat 获取当前的数据格式配置

func (*WDAService) GetDataFormatDetails

func (s *WDAService) GetDataFormatDetails(ctx context.Context) (*DataFormatDetails, error)

func (*WDAService) GetQMAPSettings

func (s *WDAService) GetQMAPSettings(ctx context.Context) (*QMAPSettings, error)

GetQMAPSettings gets current QMAP settings / GetQMAPSettings 获取当前 QMAP 设置

func (*WDAService) SetDataFormat

func (s *WDAService) SetDataFormat(ctx context.Context, format DataFormat) error

SetDataFormat sets the data format (e.g. Raw IP) / SetDataFormat设置数据格式 (例如 原始IP)

func (*WDAService) SetLoopbackConfig

func (s *WDAService) SetLoopbackConfig(ctx context.Context, config LoopbackConfig) error

SetLoopbackConfig configures loopback mode (diagnostic use) / SetLoopbackConfig 配置回环模式 (诊断用途)

func (*WDAService) SetQMAPSettings

func (s *WDAService) SetQMAPSettings(ctx context.Context, settings QMAPSettings) error

SetQMAPSettings configures QMAP settings / SetQMAPSettings 配置 QMAP 设置

type WDSProfileSettings

type WDSProfileSettings struct {
	Name              string
	APN               string
	Username          string
	Password          string
	PDPType           uint8
	HasPDPType        bool
	Authentication    uint8
	HasAuthentication bool
}

WDSProfileSettings models the common profile TLVs we expose in P0.

type WDSService

type WDSService struct {
	ProfileIndex         uint8
	TechnologyPreference uint16 // Bitmask: 0x8000=3GPP, 0x4000=3GPP2
	// contains filtered or unexported fields
}

func NewWDSService

func NewWDSService(client *Client) (*WDSService, error)

NewWDSService creates a WDS service wrapper / NewWDSService创建一个WDS服务包装器

func NewWDSServiceWithContext

func NewWDSServiceWithContext(ctx context.Context, client *Client) (*WDSService, error)

func (*WDSService) BindMuxDataPort

func (s *WDSService) BindMuxDataPort(ctx context.Context, binding MuxBinding) error

BindMuxDataPort binds the WDS client to a specific Mux ID (for QMAP) / BindMuxDataPort 将 WDS 客户端绑定到特定的 Mux ID (用于 QMAP)

func (*WDSService) ClientID

func (w *WDSService) ClientID() uint8

func (*WDSService) Close

func (w *WDSService) Close() error

Close releases the WDS client ID / Close释放WDS客户端ID

func (*WDSService) CreateProfile

func (s *WDSService) CreateProfile(ctx context.Context, profileType uint8, settings WDSProfileSettings) (*ProfileInfo, error)

CreateProfile creates a new profile with the common P0 fields.

func (*WDSService) DeleteProfile

func (s *WDSService) DeleteProfile(ctx context.Context, profileType, profileIndex uint8) error

DeleteProfile removes a stored profile.

func (*WDSService) GetAutoconnectSettings

func (w *WDSService) GetAutoconnectSettings(ctx context.Context) (*AutoconnectSettings, error)

GetAutoconnectSettings returns the modem's autoconnect configuration.

func (*WDSService) GetChannelRates

func (w *WDSService) GetChannelRates(ctx context.Context) (*ChannelRates, error)

GetChannelRates returns the current and maximum channel rates.

func (*WDSService) GetCurrentDataBearerTechnology

func (w *WDSService) GetCurrentDataBearerTechnology(ctx context.Context) (*CurrentBearerTechnologyInfo, error)

GetCurrentDataBearerTechnology returns the network type and RAT/SO masks.

func (*WDSService) GetDataBearerTechnology

func (w *WDSService) GetDataBearerTechnology(ctx context.Context) (*DataBearerTechnologyInfo, error)

GetDataBearerTechnology returns the legacy bearer technology view.

func (*WDSService) GetPacketServiceStatus

func (w *WDSService) GetPacketServiceStatus(ctx context.Context) (ConnectionStatus, error)

GetPacketServiceStatus queries the current connection status / GetPacketServiceStatus查询当前连接状态

func (*WDSService) GetPacketStatistics

func (w *WDSService) GetPacketStatistics(ctx context.Context, mask uint32) (*PacketStatistics, error)

GetPacketStatistics returns traffic counters for the requested mask.

func (*WDSService) GetProfileList

func (s *WDSService) GetProfileList(ctx context.Context, profileType uint8) ([]ProfileInfo, error)

GetProfileList retrieves the list of profiles / GetProfileList 获取 Profile 列表

func (*WDSService) GetProfileSettings

func (s *WDSService) GetProfileSettings(ctx context.Context, profileType, profileIndex uint8) (string, error)

GetProfileSettings retrieves settings for a specific profile / GetProfileSettings 获取特定 Profile 的设置 Note: This returns raw TLVs or a map as profile structure is very complex simplified here to just return "success" if it exists for now, or implement basic APN reading

func (*WDSService) GetRuntimeSettings

func (w *WDSService) GetRuntimeSettings(ctx context.Context, ipFamily uint8) (*RuntimeSettings, error)

GetRuntimeSettings retrieves IP configuration / GetRuntimeSettings检索IP配置

func (*WDSService) ModifyProfileSettings

func (s *WDSService) ModifyProfileSettings(ctx context.Context, profileType, profileIndex uint8, settings WDSProfileSettings) error

ModifyProfileSettings updates the requested profile fields.

func (*WDSService) RegisterEventReport

func (w *WDSService) RegisterEventReport(ctx context.Context) error

RegisterEventReport registers for WDS indications / RegisterEventReport注册WDS指示

func (*WDSService) SetAutoconnectSettings

func (w *WDSService) SetAutoconnectSettings(ctx context.Context, settings AutoconnectSettings) error

SetAutoconnectSettings updates one or both autoconnect fields.

func (*WDSService) SetIPFamilyPreference

func (w *WDSService) SetIPFamilyPreference(ctx context.Context, ipFamily uint8) error

SetIPFamilyPreference sets the IP family preference (IPv4 or IPv6) / SetIPFamilyPreference设置IP族偏好 (IPv4或IPv6)

func (*WDSService) StartNetworkInterface

func (w *WDSService) StartNetworkInterface(ctx context.Context, apn string, username string, password string, authType uint8, ipFamily uint8) (uint32, error)

StartNetworkInterface initiates a data call / StartNetworkInterface发起数据呼叫 Returns the handle needed to stop the call later / 返回稍后停止呼叫所需的句柄

func (*WDSService) StopAnyNetworkInterface

func (w *WDSService) StopAnyNetworkInterface(ctx context.Context, disableAutoconnect bool) error

func (*WDSService) StopNetworkInterface

func (w *WDSService) StopNetworkInterface(ctx context.Context, handle uint32) error

StopNetworkInterface terminates a data call / StopNetworkInterface终止数据呼叫

func (*WDSService) StopNetworkInterfaceWithOptions

func (w *WDSService) StopNetworkInterfaceWithOptions(ctx context.Context, opts StopNetworkInterfaceOptions) error

type WMSAck3GPP2Failure

type WMSAck3GPP2Failure struct {
	ErrorClass uint8
	CauseCode  uint8
}

type WMSAck3GPPFailure

type WMSAck3GPPFailure struct {
	RPCause uint8
	TPCause uint8
}

type WMSAckRequest

type WMSAckRequest struct {
	TransactionID uint32
	Protocol      WMSMessageProtocol
	Success       bool
	Failure3GPP2  *WMSAck3GPP2Failure
	Failure3GPP   *WMSAck3GPPFailure
	SMSOnIMS      *bool
}

type WMSAckResult

type WMSAckResult struct {
	FailureCause    uint8
	HasFailureCause bool
}

type WMSMessageProtocol

type WMSMessageProtocol uint8
const (
	WMSMessageProtocolCDMA  WMSMessageProtocol = 0x00
	WMSMessageProtocolWCDMA WMSMessageProtocol = 0x01
)

type WMSRoute

type WMSRoute struct {
	MessageType   uint8
	MessageClass  uint8
	StorageType   uint8
	ReceiptAction uint8
}

type WMSRouteConfig

type WMSRouteConfig struct {
	Routes                       []WMSRoute
	TransferStatusReportToClient bool
	HasTransferStatusReport      bool
}

type WMSSMSCAddress

type WMSSMSCAddress struct {
	Type   string
	Digits string
}

func ParseWMSSMSCAddressIndication

func ParseWMSSMSCAddressIndication(packet *Packet) (*WMSSMSCAddress, error)

type WMSSendFromStorageResult

type WMSSendFromStorageResult struct {
	MessageID              uint16
	HasMessageID           bool
	CDMACauseCode          uint16
	HasCDMACauseCode       bool
	CDMAErrorClass         uint8
	HasCDMAErrorClass      bool
	GSMWCDMARPCause        uint16
	HasGSMWCDMARPCause     bool
	GSMWCDMATPCause        uint8
	HasGSMWCDMATPCause     bool
	DeliveryFailureType    uint8
	HasDeliveryFailureType bool
}

type WMSService

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

func NewWMSService

func NewWMSService(client *Client) (*WMSService, error)

NewWMSService creates a WMS service wrapper / NewWMSService 创建 WMS 服务封装

func NewWMSServiceWithContext

func NewWMSServiceWithContext(ctx context.Context, client *Client) (*WMSService, error)

func (*WMSService) Close

func (w *WMSService) Close() error

Close releases the WMS client ID / Close 释放 WMS 客户端 ID

func (*WMSService) DeleteMessage

func (w *WMSService) DeleteMessage(ctx context.Context, storageType uint8, index uint32) error

func (*WMSService) DeleteMessageByIndex

func (w *WMSService) DeleteMessageByIndex(ctx context.Context, storageType uint8, index uint32, mode MessageMode) error

func (*WMSService) DeleteMessagesByTag

func (w *WMSService) DeleteMessagesByTag(ctx context.Context, storageType uint8, tag MessageTagType, mode MessageMode) error

func (*WMSService) GetMessageProtocol

func (w *WMSService) GetMessageProtocol(ctx context.Context) (WMSMessageProtocol, error)

GetMessageProtocol returns the current WMS message protocol.

func (*WMSService) GetRoutes

func (w *WMSService) GetRoutes(ctx context.Context) (*WMSRouteConfig, error)

GetRoutes returns the current modem-side SMS routing table.

func (*WMSService) GetSMSCAddress

func (w *WMSService) GetSMSCAddress(ctx context.Context) (string, error)

GetSMSCAddress gets the SMS center address / GetSMSCAddress 获取短信中心地址

func (*WMSService) GetSupportedMessages

func (w *WMSService) GetSupportedMessages(ctx context.Context) ([]uint8, error)

func (*WMSService) GetTransportNetworkRegistrationStatus

func (w *WMSService) GetTransportNetworkRegistrationStatus(ctx context.Context) (WMSTransportNetworkRegistration, error)

GetTransportNetworkRegistrationStatus returns the WMS transport network registration state.

func (*WMSService) IndicationRegister

func (w *WMSService) IndicationRegister(ctx context.Context, reportTransportNetworkRegistration bool) error

IndicationRegister toggles transport network registration indications.

func (*WMSService) ListMessages

func (w *WMSService) ListMessages(ctx context.Context, storageType uint8, tagType MessageTagType) ([]struct {
	Index uint32
	Tag   MessageTagType
}, error)

ListMessages lists messages from memory storage / ListMessages 从内存存储中列出消息 Returns a list of (index, tag) tuples / 返回(索引,标签)元组列表

func (*WMSService) ListMessagesAuto

func (w *WMSService) ListMessagesAuto(ctx context.Context, storageType uint8) ([]struct {
	Index uint32
	Tag   MessageTagType
}, error)

func (*WMSService) ModifyMessageTag

func (w *WMSService) ModifyMessageTag(ctx context.Context, storageType uint8, index uint32, newTag MessageTagType) error

ModifyMessageTag modifies the tag of a message (e.g. mark as read) / ModifyMessageTag 修改消息标签 (例如标记为已读)

func (*WMSService) RawReadMessage

func (w *WMSService) RawReadMessage(ctx context.Context, storageType uint8, index uint32) ([]byte, error)

RawReadMessage reads a raw SMS PDU / RawReadMessage 读取原始短信 PDU

func (*WMSService) RawReadMessageMeta

func (w *WMSService) RawReadMessageMeta(ctx context.Context, storageType uint8, index uint32) (MessageTagType, bool, []byte, error)

func (*WMSService) RawWriteMessage

func (w *WMSService) RawWriteMessage(ctx context.Context, storageType uint8, format uint8, pdu []byte) (uint32, error)

RawWriteMessage writes a raw SMS PDU into modem storage and returns the memory index.

func (*WMSService) RegisterEventReport

func (w *WMSService) RegisterEventReport(ctx context.Context) error

RegisterEventReport enables indications for new messages / RegisterEventReport 开启新消息指示

func (*WMSService) SendAck

func (w *WMSService) SendAck(ctx context.Context, req WMSAckRequest) (*WMSAckResult, error)

SendAck sends a delivery/report acknowledgment for a previously received SMS.

func (*WMSService) SendFromStorage

func (w *WMSService) SendFromStorage(ctx context.Context, storageType uint8, index uint32, mode MessageMode, smsOnIMS bool) (*WMSSendFromStorageResult, error)

SendFromStorage sends a message that already exists in modem storage.

func (*WMSService) SendRawMessage

func (w *WMSService) SendRawMessage(ctx context.Context, format uint8, pdu []byte) error

SendRawMessage sends a raw PDU / SendRawMessage 发送原始 PDU format: 0x06 (GSM/WCDMA), 0x00 (CDMA) / 格式:0x06 (GSM/WCDMA), 0x00 (CDMA)

func (*WMSService) SetRoutes

func (w *WMSService) SetRoutes(ctx context.Context, routes []WMSRoute, transferStatusReportToClient bool) error

SetRoutes updates the modem-side SMS routing table.

type WMSTransportNetworkRegistration

type WMSTransportNetworkRegistration uint8
const (
	WMSTransportNetworkRegistrationNoService      WMSTransportNetworkRegistration = 0x00
	WMSTransportNetworkRegistrationInProcess      WMSTransportNetworkRegistration = 0x01
	WMSTransportNetworkRegistrationFailure        WMSTransportNetworkRegistration = 0x02
	WMSTransportNetworkRegistrationLimitedService WMSTransportNetworkRegistration = 0x03
	WMSTransportNetworkRegistrationFullService    WMSTransportNetworkRegistration = 0x04
)

func ParseWMSTransportNetworkRegistrationStatusIndication

func ParseWMSTransportNetworkRegistrationStatusIndication(packet *Packet) (WMSTransportNetworkRegistration, error)

func (WMSTransportNetworkRegistration) String

Jump to

Keyboard shortcuts

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