Ejemplo n.º 1
0
def main():
    """Main function for the project.
    """

    # Call CreateConfig class
    cc = CreateConfig()
    # Read config.ini file
    config = cc.read()
    cd_port = config["Card_Reader"]["Port"]
    cd_id = config["Card_Reader"]["ID"]
    io_port = config["Controller"]["Port"]
    io_id = config["Controller"]["ID"]

    # Create card reader one
    card_reader = ACT230(cd_port, cd_id)

    # Call class Tokens and get_tokens method
    tokens = Tokens()

    # Create controller
    controller = IOController(io_port, io_id)

    # Call AccessControl class
    ac = AccessControl(card_reader, tokens, controller)

    #call update method in a while cycle to check for token input non-stop
    while (1):
        ac.update()
Ejemplo n.º 2
0
def main():
    """Main function for the project.
    """

    # Create card reader one
    card_reader = ACT230("COM3")

    # Call class Tokens and get_database method
    tokens = Tokens()
    tbase = tokens.get_database()

    # Create controller
    controller = IOController()

    # Call AccessControl class
    ac = AccessControl(card_reader, tbase, controller)

    #call update method in a while cycle to check for token input non-stop
    while (1):
        ac.update()