예제 #1
0
 def on_message_callback(self, client, userdata, message):
     print(Functions.decode_message(message))
     self.message_processed = True
예제 #2
0
def get_cards(terminal: Terminal):
    command = Functions.make_command(Constants.GET_CARDS_COMMAND,
                                     terminal.terminal_id)
    terminal.communicate_with_server(command)
예제 #3
0
def get_terminals(terminal: Terminal):
    command = Functions.make_command(Constants.GET_TERMINALS_COMMAND,
                                     terminal.terminal_id)
    terminal.communicate_with_server(command)
예제 #4
0
def delete_worker(terminal: Terminal, worker_id):
    command = Functions.make_command(Constants.DELETE_WORKER_COMMAND,
                                     terminal.terminal_id, [worker_id])
    terminal.communicate_with_server(command)
예제 #5
0
def get_workers(terminal: Terminal):
    command = Functions.make_command(Constants.GET_WORKERS_COMMAND,
                                     terminal.terminal_id)
    terminal.communicate_with_server(command)
예제 #6
0
def delete_terminal(terminal: Terminal, terminal_id):
    command = Functions.make_command(Constants.DELETE_TERMINAL_COMMAND,
                                     terminal.terminal_id, [terminal_id])
    terminal.communicate_with_server(command)
예제 #7
0
def delete_card(terminal: Terminal, card_rfid):
    command = Functions.make_command(Constants.DELETE_CARD_COMMAND,
                                     terminal.terminal_id, [card_rfid])
    terminal.communicate_with_server(command)
예제 #8
0
def unassign(terminal: Terminal, card_rfid):
    command = Functions.make_command(Constants.UNASSIGN_COMMAND,
                                     terminal.terminal_id, [card_rfid])
    terminal.communicate_with_server(command)
예제 #9
0
def add_worker(terminal: Terminal, worker_id, surname, name):
    command = Functions.make_command(Constants.ADD_WORKER_COMMAND,
                                     terminal.terminal_id,
                                     [worker_id, surname, name])
    terminal.communicate_with_server(command)
예제 #10
0
def shutdown(terminal: Terminal):
    command = Functions.make_command(Constants.SHUTDOWN_COMMAND,
                                     terminal.terminal_id)
    terminal.communicate_with_server(command)