Files
purple-electrumwallet/electrum/gui/kivy/nfc_scanner/__init__.py
T

49 lines
1.3 KiB
Python
Raw Normal View History

2018-09-17 14:44:01 +02:00
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
2018-09-20 01:20:13 +02:00
from kivy.core import core_select_lib
2018-09-17 14:44:01 +02:00
__all__ = ('NFCBase', 'NFCScanner')
class NFCBase(Widget):
''' This is the base Abstract definition class that the actual hardware dependent
implementations would be based on. If you want to define a feature that is
2018-04-15 20:45:30 +03:00
accessible and implemented by every platform implementation then define that
method in this class.
'''
payload = ObjectProperty(None)
'''This is the data gotten from the tag.
'''
def nfc_init(self):
''' Initialize the adapter.
'''
pass
def nfc_disable(self):
''' Disable scanning
'''
pass
def nfc_enable(self):
''' Enable Scanning
'''
pass
def nfc_enable_exchange(self, data):
''' Enable P2P Ndef exchange
'''
pass
def nfc_disable_exchange(self):
''' Disable/Stop P2P Ndef exchange
'''
pass
# load NFCScanner implementation
NFCScanner = core_select_lib('nfc_manager', (
2018-04-15 20:45:30 +03:00
# keep the dummy implementation as the last one to make it the fallback provider.NFCScanner = core_select_lib('nfc_scanner', (
('android', 'scanner_android', 'ScannerAndroid'),
2018-07-11 17:38:47 +02:00
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum.gui.kivy')