sap

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionISapApduReq                     = binder.FirstCallTransaction + 0
	TransactionISapConnectReq                  = binder.FirstCallTransaction + 1
	TransactionISapDisconnectReq               = binder.FirstCallTransaction + 2
	TransactionISapPowerReq                    = binder.FirstCallTransaction + 3
	TransactionISapResetSimReq                 = binder.FirstCallTransaction + 4
	TransactionISapSetCallback                 = binder.FirstCallTransaction + 5
	TransactionISapSetTransferProtocolReq      = binder.FirstCallTransaction + 6
	TransactionISapTransferAtrReq              = binder.FirstCallTransaction + 7
	TransactionISapTransferCardReaderStatusReq = binder.FirstCallTransaction + 8
)
View Source
const (
	MethodISapApduReq                     = "apduReq"
	MethodISapConnectReq                  = "connectReq"
	MethodISapDisconnectReq               = "disconnectReq"
	MethodISapPowerReq                    = "powerReq"
	MethodISapResetSimReq                 = "resetSimReq"
	MethodISapSetCallback                 = "setCallback"
	MethodISapSetTransferProtocolReq      = "setTransferProtocolReq"
	MethodISapTransferAtrReq              = "transferAtrReq"
	MethodISapTransferCardReaderStatusReq = "transferCardReaderStatusReq"
)
View Source
const (
	TransactionISapCallbackApduResponse                     = binder.FirstCallTransaction + 0
	TransactionISapCallbackConnectResponse                  = binder.FirstCallTransaction + 1
	TransactionISapCallbackDisconnectIndication             = binder.FirstCallTransaction + 2
	TransactionISapCallbackDisconnectResponse               = binder.FirstCallTransaction + 3
	TransactionISapCallbackErrorResponse                    = binder.FirstCallTransaction + 4
	TransactionISapCallbackPowerResponse                    = binder.FirstCallTransaction + 5
	TransactionISapCallbackResetSimResponse                 = binder.FirstCallTransaction + 6
	TransactionISapCallbackStatusIndication                 = binder.FirstCallTransaction + 7
	TransactionISapCallbackTransferAtrResponse              = binder.FirstCallTransaction + 8
	TransactionISapCallbackTransferCardReaderStatusResponse = binder.FirstCallTransaction + 9
	TransactionISapCallbackTransferProtocolResponse         = binder.FirstCallTransaction + 10
)
View Source
const (
	MethodISapCallbackApduResponse                     = "apduResponse"
	MethodISapCallbackConnectResponse                  = "connectResponse"
	MethodISapCallbackDisconnectIndication             = "disconnectIndication"
	MethodISapCallbackDisconnectResponse               = "disconnectResponse"
	MethodISapCallbackErrorResponse                    = "errorResponse"
	MethodISapCallbackPowerResponse                    = "powerResponse"
	MethodISapCallbackResetSimResponse                 = "resetSimResponse"
	MethodISapCallbackStatusIndication                 = "statusIndication"
	MethodISapCallbackTransferAtrResponse              = "transferAtrResponse"
	MethodISapCallbackTransferCardReaderStatusResponse = "transferCardReaderStatusResponse"
	MethodISapCallbackTransferProtocolResponse         = "transferProtocolResponse"
)
View Source
const DescriptorISap = "android.hardware.radio.sap.ISap"
View Source
const DescriptorISapCallback = "android.hardware.radio.sap.ISapCallback"

Variables

This section is empty.

Functions

This section is empty.

Types

type ISap

type ISap interface {
	AsBinder() binder.IBinder
	ApduReq(ctx context.Context, serial int32, type_ SapApduType, command []byte) error
	ConnectReq(ctx context.Context, serial int32, maxMsgSizeBytes int32) error
	DisconnectReq(ctx context.Context, serial int32) error
	PowerReq(ctx context.Context, serial int32, powerOn bool) error
	ResetSimReq(ctx context.Context, serial int32) error
	SetCallback(ctx context.Context, sapCallback ISapCallback) error
	SetTransferProtocolReq(ctx context.Context, serial int32, transferProtocol SapTransferProtocol) error
	TransferAtrReq(ctx context.Context, serial int32) error
	TransferCardReaderStatusReq(ctx context.Context, serial int32) error
}

func NewSapStub

func NewSapStub(
	impl ISapServer,
) ISap

NewSapStub creates a server-side ISap wrapping the given server implementation. The returned value satisfies ISap and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ISapCallback

type ISapCallback interface {
	AsBinder() binder.IBinder
	ApduResponse(ctx context.Context, serial int32, resultCode SapResultCode, apduRsp []byte) error
	ConnectResponse(ctx context.Context, serial int32, sapConnectRsp SapConnectRsp, maxMsgSizeBytes int32) error
	DisconnectIndication(ctx context.Context, serial int32, disconnectType SapDisconnectType) error
	DisconnectResponse(ctx context.Context, serial int32) error
	ErrorResponse(ctx context.Context, serial int32) error
	PowerResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
	ResetSimResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
	StatusIndication(ctx context.Context, serial int32, status SapStatus) error
	TransferAtrResponse(ctx context.Context, serial int32, resultCode SapResultCode, atr []byte) error
	TransferCardReaderStatusResponse(ctx context.Context, serial int32, resultCode SapResultCode, cardReaderStatus int32) error
	TransferProtocolResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
}

func NewSapCallbackStub

func NewSapCallbackStub(
	impl ISapCallbackServer,
) ISapCallback

NewSapCallbackStub creates a server-side ISapCallback wrapping the given server implementation. The returned value satisfies ISapCallback and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ISapCallbackServer

type ISapCallbackServer interface {
	ApduResponse(ctx context.Context, serial int32, resultCode SapResultCode, apduRsp []byte) error
	ConnectResponse(ctx context.Context, serial int32, sapConnectRsp SapConnectRsp, maxMsgSizeBytes int32) error
	DisconnectIndication(ctx context.Context, serial int32, disconnectType SapDisconnectType) error
	DisconnectResponse(ctx context.Context, serial int32) error
	ErrorResponse(ctx context.Context, serial int32) error
	PowerResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
	ResetSimResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
	StatusIndication(ctx context.Context, serial int32, status SapStatus) error
	TransferAtrResponse(ctx context.Context, serial int32, resultCode SapResultCode, atr []byte) error
	TransferCardReaderStatusResponse(ctx context.Context, serial int32, resultCode SapResultCode, cardReaderStatus int32) error
	TransferProtocolResponse(ctx context.Context, serial int32, resultCode SapResultCode) error
}

ISapCallbackServer is the server-side interface that user implementations provide to NewSapCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type ISapServer

type ISapServer interface {
	ApduReq(ctx context.Context, serial int32, type_ SapApduType, command []byte) error
	ConnectReq(ctx context.Context, serial int32, maxMsgSizeBytes int32) error
	DisconnectReq(ctx context.Context, serial int32) error
	PowerReq(ctx context.Context, serial int32, powerOn bool) error
	ResetSimReq(ctx context.Context, serial int32) error
	SetCallback(ctx context.Context, sapCallback ISapCallback) error
	SetTransferProtocolReq(ctx context.Context, serial int32, transferProtocol SapTransferProtocol) error
	TransferAtrReq(ctx context.Context, serial int32) error
	TransferCardReaderStatusReq(ctx context.Context, serial int32) error
}

ISapServer is the server-side interface that user implementations provide to NewSapStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type SapApduType

type SapApduType int32
const (
	SapApduTypeAPDU     SapApduType = 0
	SapApduTypeAPDU7816 SapApduType = 1
)

type SapCallbackProxy

type SapCallbackProxy struct {
	Remote binder.IBinder
}

func NewSapCallbackProxy

func NewSapCallbackProxy(
	remote binder.IBinder,
) *SapCallbackProxy

func (*SapCallbackProxy) ApduResponse

func (p *SapCallbackProxy) ApduResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
	apduRsp []byte,
) error

func (*SapCallbackProxy) AsBinder

func (p *SapCallbackProxy) AsBinder() binder.IBinder

func (*SapCallbackProxy) ConnectResponse

func (p *SapCallbackProxy) ConnectResponse(
	ctx context.Context,
	serial int32,
	sapConnectRsp SapConnectRsp,
	maxMsgSizeBytes int32,
) error

func (*SapCallbackProxy) DisconnectIndication

func (p *SapCallbackProxy) DisconnectIndication(
	ctx context.Context,
	serial int32,
	disconnectType SapDisconnectType,
) error

func (*SapCallbackProxy) DisconnectResponse

func (p *SapCallbackProxy) DisconnectResponse(
	ctx context.Context,
	serial int32,
) error

func (*SapCallbackProxy) ErrorResponse

func (p *SapCallbackProxy) ErrorResponse(
	ctx context.Context,
	serial int32,
) error

func (*SapCallbackProxy) PowerResponse

func (p *SapCallbackProxy) PowerResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
) error

func (*SapCallbackProxy) ResetSimResponse

func (p *SapCallbackProxy) ResetSimResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
) error

func (*SapCallbackProxy) StatusIndication

func (p *SapCallbackProxy) StatusIndication(
	ctx context.Context,
	serial int32,
	status SapStatus,
) error

func (*SapCallbackProxy) TransferAtrResponse

func (p *SapCallbackProxy) TransferAtrResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
	atr []byte,
) error

func (*SapCallbackProxy) TransferCardReaderStatusResponse

func (p *SapCallbackProxy) TransferCardReaderStatusResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
	cardReaderStatus int32,
) error

func (*SapCallbackProxy) TransferProtocolResponse

func (p *SapCallbackProxy) TransferProtocolResponse(
	ctx context.Context,
	serial int32,
	resultCode SapResultCode,
) error

type SapCallbackStub

type SapCallbackStub struct {
	Impl      ISapCallback
	Transport binder.VersionAwareTransport
}

SapCallbackStub dispatches incoming binder transactions to a typed ISapCallback implementation.

func (*SapCallbackStub) Descriptor

func (s *SapCallbackStub) Descriptor() string

func (*SapCallbackStub) OnTransaction

func (s *SapCallbackStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type SapConnectRsp

type SapConnectRsp int32
const (
	SapConnectRspSUCCESS              SapConnectRsp = 0
	SapConnectRspConnectFailure       SapConnectRsp = 1
	SapConnectRspMsgSizeTooLarge      SapConnectRsp = 2
	SapConnectRspMsgSizeTooSmall      SapConnectRsp = 3
	SapConnectRspConnectOkCallOngoing SapConnectRsp = 4
)

type SapDisconnectType

type SapDisconnectType int32
const (
	SapDisconnectTypeGRACEFUL  SapDisconnectType = 0
	SapDisconnectTypeIMMEDIATE SapDisconnectType = 1
)

type SapProxy

type SapProxy struct {
	Remote binder.IBinder
}

func NewSapProxy

func NewSapProxy(
	remote binder.IBinder,
) *SapProxy

func (*SapProxy) ApduReq

func (p *SapProxy) ApduReq(
	ctx context.Context,
	serial int32,
	type_ SapApduType,
	command []byte,
) error

func (*SapProxy) AsBinder

func (p *SapProxy) AsBinder() binder.IBinder

func (*SapProxy) ConnectReq

func (p *SapProxy) ConnectReq(
	ctx context.Context,
	serial int32,
	maxMsgSizeBytes int32,
) error

func (*SapProxy) DisconnectReq

func (p *SapProxy) DisconnectReq(
	ctx context.Context,
	serial int32,
) error

func (*SapProxy) PowerReq

func (p *SapProxy) PowerReq(
	ctx context.Context,
	serial int32,
	powerOn bool,
) error

func (*SapProxy) ResetSimReq

func (p *SapProxy) ResetSimReq(
	ctx context.Context,
	serial int32,
) error

func (*SapProxy) SetCallback

func (p *SapProxy) SetCallback(
	ctx context.Context,
	sapCallback ISapCallback,
) error

func (*SapProxy) SetTransferProtocolReq

func (p *SapProxy) SetTransferProtocolReq(
	ctx context.Context,
	serial int32,
	transferProtocol SapTransferProtocol,
) error

func (*SapProxy) TransferAtrReq

func (p *SapProxy) TransferAtrReq(
	ctx context.Context,
	serial int32,
) error

func (*SapProxy) TransferCardReaderStatusReq

func (p *SapProxy) TransferCardReaderStatusReq(
	ctx context.Context,
	serial int32,
) error

type SapResultCode

type SapResultCode int32
const (
	SapResultCodeSUCCESS               SapResultCode = 0
	SapResultCodeGenericFailure        SapResultCode = 1
	SapResultCodeCardNotAccesssible    SapResultCode = 2
	SapResultCodeCardAlreadyPoweredOff SapResultCode = 3
	SapResultCodeCardRemoved           SapResultCode = 4
	SapResultCodeCardAlreadyPoweredOn  SapResultCode = 5
	SapResultCodeDataNotAvailable      SapResultCode = 6
	SapResultCodeNotSupported          SapResultCode = 7
)

type SapStatus

type SapStatus int32
const (
	SapStatusUnknownError      SapStatus = 0
	SapStatusCardReset         SapStatus = 1
	SapStatusCardNotAccessible SapStatus = 2
	SapStatusCardRemoved       SapStatus = 3
	SapStatusCardInserted      SapStatus = 4
	SapStatusRECOVERED         SapStatus = 5
)

type SapStub

type SapStub struct {
	Impl      ISap
	Transport binder.VersionAwareTransport
}

SapStub dispatches incoming binder transactions to a typed ISap implementation.

func (*SapStub) Descriptor

func (s *SapStub) Descriptor() string

func (*SapStub) OnTransaction

func (s *SapStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type SapTransferProtocol

type SapTransferProtocol int32
const (
	SapTransferProtocolT0 SapTransferProtocol = 0
	SapTransferProtocolT1 SapTransferProtocol = 1
)

Jump to

Keyboard shortcuts

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