# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pyupm_sm130
else:
    import _pyupm_sm130

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def getVersion():
    return _pyupm_sm130.getVersion()
SM130_DEFAULT_UART = _pyupm_sm130.SM130_DEFAULT_UART
SM130_DEFAULT_RESET_PIN = _pyupm_sm130.SM130_DEFAULT_RESET_PIN
class SM130(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    CMD_RESET = _pyupm_sm130.SM130_CMD_RESET
    CMD_VERSION = _pyupm_sm130.SM130_CMD_VERSION
    CMD_SEEK_TAG = _pyupm_sm130.SM130_CMD_SEEK_TAG
    CMD_SELECT_TAG = _pyupm_sm130.SM130_CMD_SELECT_TAG
    CMD_AUTHENTICATE = _pyupm_sm130.SM130_CMD_AUTHENTICATE
    CMD_READ16 = _pyupm_sm130.SM130_CMD_READ16
    CMD_READ_VALUE = _pyupm_sm130.SM130_CMD_READ_VALUE
    CMD_WRITE16 = _pyupm_sm130.SM130_CMD_WRITE16
    CMD_WRITE_VALUE = _pyupm_sm130.SM130_CMD_WRITE_VALUE
    CMD_WRITE4 = _pyupm_sm130.SM130_CMD_WRITE4
    CMD_WRITE_KEY = _pyupm_sm130.SM130_CMD_WRITE_KEY
    CMD_INC_VALUE = _pyupm_sm130.SM130_CMD_INC_VALUE
    CMD_DEC_VALUE = _pyupm_sm130.SM130_CMD_DEC_VALUE
    CMD_ANTENNA_POWER = _pyupm_sm130.SM130_CMD_ANTENNA_POWER
    CMD_READ_PORT = _pyupm_sm130.SM130_CMD_READ_PORT
    CMD_WRITE_PORT = _pyupm_sm130.SM130_CMD_WRITE_PORT
    CMD_HALT_TAG = _pyupm_sm130.SM130_CMD_HALT_TAG
    CMD_SET_BAUD = _pyupm_sm130.SM130_CMD_SET_BAUD
    CMD_SLEEP = _pyupm_sm130.SM130_CMD_SLEEP
    TAG_NONE = _pyupm_sm130.SM130_TAG_NONE
    TAG_MIFARE_ULTRALIGHT = _pyupm_sm130.SM130_TAG_MIFARE_ULTRALIGHT
    TAG_MIFARE_1K = _pyupm_sm130.SM130_TAG_MIFARE_1K
    TAG_MIFARE_4K = _pyupm_sm130.SM130_TAG_MIFARE_4K
    TAG_UNKNOWN = _pyupm_sm130.SM130_TAG_UNKNOWN
    KEY_TYPE_EEPROM_A0 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A0
    KEY_TYPE_EEPROM_A1 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A1
    KEY_TYPE_EEPROM_A2 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A2
    KEY_TYPE_EEPROM_A3 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A3
    KEY_TYPE_EEPROM_A4 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A4
    KEY_TYPE_EEPROM_A5 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A5
    KEY_TYPE_EEPROM_A6 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A6
    KEY_TYPE_EEPROM_A7 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A7
    KEY_TYPE_EEPROM_A8 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A8
    KEY_TYPE_EEPROM_A9 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A9
    KEY_TYPE_EEPROM_A10 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A10
    KEY_TYPE_EEPROM_A11 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A11
    KEY_TYPE_EEPROM_A12 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A12
    KEY_TYPE_EEPROM_A13 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A13
    KEY_TYPE_EEPROM_A14 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A14
    KEY_TYPE_EEPROM_A15 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_A15
    KEY_TYPE_EEPROM_B0 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B0
    KEY_TYPE_EEPROM_B1 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B1
    KEY_TYPE_EEPROM_B2 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B2
    KEY_TYPE_EEPROM_B3 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B3
    KEY_TYPE_EEPROM_B4 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B4
    KEY_TYPE_EEPROM_B5 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B5
    KEY_TYPE_EEPROM_B6 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B6
    KEY_TYPE_EEPROM_B7 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B7
    KEY_TYPE_EEPROM_B8 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B8
    KEY_TYPE_EEPROM_B9 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B9
    KEY_TYPE_EEPROM_B10 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B10
    KEY_TYPE_EEPROM_B11 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B11
    KEY_TYPE_EEPROM_B12 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B12
    KEY_TYPE_EEPROM_B13 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B13
    KEY_TYPE_EEPROM_B14 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B14
    KEY_TYPE_EEPROM_B15 = _pyupm_sm130.SM130_KEY_TYPE_EEPROM_B15
    KEY_TYPE_A = _pyupm_sm130.SM130_KEY_TYPE_A
    KEY_TYPE_B = _pyupm_sm130.SM130_KEY_TYPE_B
    KEY_TYPE_A_AND_TRANSPORT_F = _pyupm_sm130.SM130_KEY_TYPE_A_AND_TRANSPORT_F

    def __init__(self, uart=0, reset=13):
        _pyupm_sm130.SM130_swiginit(self, _pyupm_sm130.new_SM130(uart, reset))
    __swig_destroy__ = _pyupm_sm130.delete_SM130

    def setBaudRate(self, baud=19200):
        return _pyupm_sm130.SM130_setBaudRate(self, baud)

    def getFirmwareVersion(self):
        return _pyupm_sm130.SM130_getFirmwareVersion(self)

    def reset(self):
        return _pyupm_sm130.SM130_reset(self)

    def hardwareReset(self):
        return _pyupm_sm130.SM130_hardwareReset(self)

    def select(self):
        return _pyupm_sm130.SM130_select(self)

    def waitForTag(self, timeout):
        return _pyupm_sm130.SM130_waitForTag(self, timeout)

    def authenticate(self, *args):
        return _pyupm_sm130.SM130_authenticate(self, *args)

    def readBlock16(self, block):
        return _pyupm_sm130.SM130_readBlock16(self, block)

    def readValueBlock(self, block):
        return _pyupm_sm130.SM130_readValueBlock(self, block)

    def writeBlock16(self, block, contents):
        return _pyupm_sm130.SM130_writeBlock16(self, block, contents)

    def writeValueBlock(self, block, value):
        return _pyupm_sm130.SM130_writeValueBlock(self, block, value)

    def writeBlock4(self, block, contents):
        return _pyupm_sm130.SM130_writeBlock4(self, block, contents)

    def writeKey(self, eepromSector, keyType, key):
        return _pyupm_sm130.SM130_writeKey(self, eepromSector, keyType, key)

    def adjustValueBlock(self, block, value, incr):
        return _pyupm_sm130.SM130_adjustValueBlock(self, block, value, incr)

    def setAntennaPower(self, on):
        return _pyupm_sm130.SM130_setAntennaPower(self, on)

    def readPorts(self):
        return _pyupm_sm130.SM130_readPorts(self)

    def writePorts(self, val):
        return _pyupm_sm130.SM130_writePorts(self, val)

    def haltTag(self):
        return _pyupm_sm130.SM130_haltTag(self)

    def setSM130BaudRate(self, baud):
        return _pyupm_sm130.SM130_setSM130BaudRate(self, baud)

    def sleep(self):
        return _pyupm_sm130.SM130_sleep(self)

    def getLastErrorCode(self):
        return _pyupm_sm130.SM130_getLastErrorCode(self)

    def getLastErrorString(self):
        return _pyupm_sm130.SM130_getLastErrorString(self)

    def getUIDLen(self):
        return _pyupm_sm130.SM130_getUIDLen(self)

    def getUID(self):
        return _pyupm_sm130.SM130_getUID(self)

    def getTagType(self):
        return _pyupm_sm130.SM130_getTagType(self)

    def tag2String(self, tag):
        return _pyupm_sm130.SM130_tag2String(self, tag)

    def string2HexString(self, input):
        return _pyupm_sm130.SM130_string2HexString(self, input)

# Register SM130 in _pyupm_sm130:
_pyupm_sm130.SM130_swigregister(SM130)



