change get_firmware_version() function to firmware_version property
This commit is contained in:
parent
14749b1902
commit
cea2d9bfc6
1 changed files with 4 additions and 3 deletions
|
@ -196,11 +196,11 @@ class PN532:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._wakeup()
|
self._wakeup()
|
||||||
self.get_firmware_version() # first time often fails, try 2ce
|
self.firmware_version # first time often fails, try 2ce
|
||||||
return
|
return
|
||||||
except (BusyError, RuntimeError):
|
except (BusyError, RuntimeError):
|
||||||
pass
|
pass
|
||||||
self.get_firmware_version()
|
self.firmware_version
|
||||||
|
|
||||||
def _read_data(self, count):
|
def _read_data(self, count):
|
||||||
# Read raw data from device, not including status bytes:
|
# Read raw data from device, not including status bytes:
|
||||||
|
@ -317,7 +317,8 @@ class PN532:
|
||||||
# Return response data.
|
# Return response data.
|
||||||
return response[2:]
|
return response[2:]
|
||||||
|
|
||||||
def get_firmware_version(self):
|
@property
|
||||||
|
def firmware_version(self):
|
||||||
"""Call PN532 GetFirmwareVersion function and return a tuple with the IC,
|
"""Call PN532 GetFirmwareVersion function and return a tuple with the IC,
|
||||||
Ver, Rev, and Support values.
|
Ver, Rev, and Support values.
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue