Help us shape the future of Go! Take the 2026 Go Developer Survey

nfc

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TransactionINfcOpen                    = binder.FirstCallTransaction + 0
	TransactionINfcClose                   = binder.FirstCallTransaction + 1
	TransactionINfcCoreInitialized         = binder.FirstCallTransaction + 2
	TransactionINfcFactoryReset            = binder.FirstCallTransaction + 3
	TransactionINfcGetConfig               = binder.FirstCallTransaction + 4
	TransactionINfcPowerCycle              = binder.FirstCallTransaction + 5
	TransactionINfcPreDiscover             = binder.FirstCallTransaction + 6
	TransactionINfcWrite                   = binder.FirstCallTransaction + 7
	TransactionINfcSetEnableVerboseLogging = binder.FirstCallTransaction + 8
	TransactionINfcIsVerboseLoggingEnabled = binder.FirstCallTransaction + 9
)
View Source
const (
	MethodINfcOpen                    = "open"
	MethodINfcClose                   = "close"
	MethodINfcCoreInitialized         = "coreInitialized"
	MethodINfcFactoryReset            = "factoryReset"
	MethodINfcGetConfig               = "getConfig"
	MethodINfcPowerCycle              = "powerCycle"
	MethodINfcPreDiscover             = "preDiscover"
	MethodINfcWrite                   = "write"
	MethodINfcSetEnableVerboseLogging = "setEnableVerboseLogging"
	MethodINfcIsVerboseLoggingEnabled = "isVerboseLoggingEnabled"
)
View Source
const (
	TransactionINfcClientCallbackSendData  = binder.FirstCallTransaction + 0
	TransactionINfcClientCallbackSendEvent = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodINfcClientCallbackSendData  = "sendData"
	MethodINfcClientCallbackSendEvent = "sendEvent"
)
View Source
const DescriptorINfc = "android.hardware.nfc.INfc"
View Source
const DescriptorINfcClientCallback = "android.hardware.nfc.INfcClientCallback"

Variables

This section is empty.

Functions

This section is empty.

Types

type INfc

type INfc interface {
	AsBinder() binder.IBinder
	Open(ctx context.Context, clientCallback INfcClientCallback) error
	Close(ctx context.Context, type_ NfcCloseType) error
	CoreInitialized(ctx context.Context) error
	FactoryReset(ctx context.Context) error
	GetConfig(ctx context.Context) (NfcConfig, error)
	PowerCycle(ctx context.Context) error
	PreDiscover(ctx context.Context) error
	Write(ctx context.Context, data []byte) (int32, error)
	SetEnableVerboseLogging(ctx context.Context, enable bool) error
	IsVerboseLoggingEnabled(ctx context.Context) (bool, error)
}

func NewNfcStub

func NewNfcStub(
	impl INfcServer,
) INfc

NewNfcStub creates a server-side INfc wrapping the given server implementation. The returned value satisfies INfc 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 INfcClientCallback

type INfcClientCallback interface {
	AsBinder() binder.IBinder
	SendData(ctx context.Context, data []byte) error
	SendEvent(ctx context.Context, event NfcEvent, status NfcStatus) error
}

func NewNfcClientCallbackStub

func NewNfcClientCallbackStub(
	impl INfcClientCallbackServer,
) INfcClientCallback

NewNfcClientCallbackStub creates a server-side INfcClientCallback wrapping the given server implementation. The returned value satisfies INfcClientCallback 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 INfcClientCallbackServer

type INfcClientCallbackServer interface {
	SendData(ctx context.Context, data []byte) error
	SendEvent(ctx context.Context, event NfcEvent, status NfcStatus) error
}

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

type INfcServer

type INfcServer interface {
	Open(ctx context.Context, clientCallback INfcClientCallback) error
	Close(ctx context.Context, type_ NfcCloseType) error
	CoreInitialized(ctx context.Context) error
	FactoryReset(ctx context.Context) error
	GetConfig(ctx context.Context) (NfcConfig, error)
	PowerCycle(ctx context.Context) error
	PreDiscover(ctx context.Context) error
	Write(ctx context.Context, data []byte) (int32, error)
	SetEnableVerboseLogging(ctx context.Context, enable bool) error
	IsVerboseLoggingEnabled(ctx context.Context) (bool, error)
}

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

type NfcClientCallbackProxy

type NfcClientCallbackProxy struct {
	Remote binder.IBinder
}

func NewNfcClientCallbackProxy

func NewNfcClientCallbackProxy(
	remote binder.IBinder,
) *NfcClientCallbackProxy

func (*NfcClientCallbackProxy) AsBinder

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

func (*NfcClientCallbackProxy) SendData

func (p *NfcClientCallbackProxy) SendData(
	ctx context.Context,
	data []byte,
) error

func (*NfcClientCallbackProxy) SendEvent

func (p *NfcClientCallbackProxy) SendEvent(
	ctx context.Context,
	event NfcEvent,
	status NfcStatus,
) error

type NfcClientCallbackStub

type NfcClientCallbackStub struct {
	Impl      INfcClientCallback
	Transport binder.VersionAwareTransport
}

NfcClientCallbackStub dispatches incoming binder transactions to a typed INfcClientCallback implementation.

func (*NfcClientCallbackStub) Descriptor

func (s *NfcClientCallbackStub) Descriptor() string

func (*NfcClientCallbackStub) OnTransaction

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

type NfcCloseType

type NfcCloseType int32
const (
	NfcCloseTypeDISABLE         NfcCloseType = 0
	NfcCloseTypeHostSwitchedOff NfcCloseType = 1
)

type NfcConfig

type NfcConfig struct {
	NfaPollBailOutMode          bool
	PresenceCheckAlgorithm      PresenceCheckAlgorithm
	NfaProprietaryCfg           ProtocolDiscoveryConfig
	DefaultOffHostRoute         byte
	DefaultOffHostRouteFelica   byte
	DefaultSystemCodeRoute      byte
	DefaultSystemCodePowerState byte
	DefaultRoute                byte
	OffHostESEPipeId            byte
	OffHostSIMPipeId            byte
	MaxIsoDepTransceiveLength   int32
	HostAllowlist               []byte
	OffHostRouteUicc            []byte
	OffHostRouteEse             []byte
	DefaultIsoDepRoute          byte
}

func (*NfcConfig) MarshalParcel

func (s *NfcConfig) MarshalParcel(
	p *parcel.Parcel,
) error

func (*NfcConfig) UnmarshalParcel

func (s *NfcConfig) UnmarshalParcel(
	p *parcel.Parcel,
) error

type NfcEvent

type NfcEvent int32
const (
	NfcEventOpenCplt        NfcEvent = 0
	NfcEventCloseCplt       NfcEvent = 1
	NfcEventPostInitCplt    NfcEvent = 2
	NfcEventPreDiscoverCplt NfcEvent = 3
	NfcEventHciNetworkReset NfcEvent = 4
	NfcEventERROR           NfcEvent = 5
)

type NfcProxy

type NfcProxy struct {
	Remote binder.IBinder
}

func NewNfcProxy

func NewNfcProxy(
	remote binder.IBinder,
) *NfcProxy

func (*NfcProxy) AsBinder

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

func (*NfcProxy) Close

func (p *NfcProxy) Close(
	ctx context.Context,
	type_ NfcCloseType,
) error

func (*NfcProxy) CoreInitialized

func (p *NfcProxy) CoreInitialized(
	ctx context.Context,
) error

func (*NfcProxy) FactoryReset

func (p *NfcProxy) FactoryReset(
	ctx context.Context,
) error

func (*NfcProxy) GetConfig

func (p *NfcProxy) GetConfig(
	ctx context.Context,
) (NfcConfig, error)

func (*NfcProxy) IsVerboseLoggingEnabled

func (p *NfcProxy) IsVerboseLoggingEnabled(
	ctx context.Context,
) (bool, error)

func (*NfcProxy) Open

func (p *NfcProxy) Open(
	ctx context.Context,
	clientCallback INfcClientCallback,
) error

func (*NfcProxy) PowerCycle

func (p *NfcProxy) PowerCycle(
	ctx context.Context,
) error

func (*NfcProxy) PreDiscover

func (p *NfcProxy) PreDiscover(
	ctx context.Context,
) error

func (*NfcProxy) SetEnableVerboseLogging

func (p *NfcProxy) SetEnableVerboseLogging(
	ctx context.Context,
	enable bool,
) error

func (*NfcProxy) Write

func (p *NfcProxy) Write(
	ctx context.Context,
	data []byte,
) (int32, error)

type NfcStatus

type NfcStatus int32
const (
	NfcStatusOK            NfcStatus = 0
	NfcStatusFAILED        NfcStatus = 1
	NfcStatusErrTransport  NfcStatus = 2
	NfcStatusErrCmdTimeout NfcStatus = 3
	NfcStatusREFUSED       NfcStatus = 4
)

type NfcStub

type NfcStub struct {
	Impl      INfc
	Transport binder.VersionAwareTransport
}

NfcStub dispatches incoming binder transactions to a typed INfc implementation.

func (*NfcStub) Descriptor

func (s *NfcStub) Descriptor() string

func (*NfcStub) OnTransaction

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

type PresenceCheckAlgorithm

type PresenceCheckAlgorithm byte
const (
	PresenceCheckAlgorithmDEFAULT   PresenceCheckAlgorithm = 0
	PresenceCheckAlgorithmIBlock    PresenceCheckAlgorithm = 1
	PresenceCheckAlgorithmIsoDepNak PresenceCheckAlgorithm = 2
)

type ProtocolDiscoveryConfig

type ProtocolDiscoveryConfig struct {
	Protocol18092Active   byte
	ProtocolBPrime        byte
	ProtocolDual          byte
	Protocol15693         byte
	ProtocolKovio         byte
	ProtocolMifare        byte
	DiscoveryPollKovio    byte
	DiscoveryPollBPrime   byte
	DiscoveryListenBPrime byte
}

func (*ProtocolDiscoveryConfig) MarshalParcel

func (s *ProtocolDiscoveryConfig) MarshalParcel(
	p *parcel.Parcel,
) error

func (*ProtocolDiscoveryConfig) UnmarshalParcel

func (s *ProtocolDiscoveryConfig) UnmarshalParcel(
	p *parcel.Parcel,
) error

Jump to

Keyboard shortcuts

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