cobisja / tad-php

PHP Library for ZK Time & Attendance Devices
MIT License
213 stars 159 forks source link

Comm Key does not work on some functions #50

Closed termers closed 6 years ago

termers commented 6 years ago

I have set on the device Comm. -> PC Connection -> Comm Key to 8, Device ID is 1

`<?php require 'tad/lib/TADFactory.php'; require 'tad/lib/TAD.php'; require 'tad/lib/TADResponse.php'; require 'tad/lib/Providers/TADSoap.php'; require 'tad/lib/Providers/TADZKLib.php'; require 'tad/lib/Exceptions/ConnectionError.php'; require 'tad/lib/Exceptions/FilterArgumentError.php'; require 'tad/lib/Exceptions/UnrecognizedArgument.php'; require 'tad/lib/Exceptions/UnrecognizedCommand.php';

use TADPHP\TADFactory; use TADPHP\TAD;

$options = [ 'ip' => '192.168.1.201', 'internal_id' => 1, 'com_key' => 8, 'udp_port' => 4370, 'encoding' => 'utf-8' ];

$tad_factory = new TADFactory($options); $tad = $tad_factory->get_instance();

echo $tad->get_device_name(); ?>`

This results to "0Fail!" even though the com_key is correct... When I set Comm. -> PC Connection -> Comm Key back to 0... the com_key value at $options does not matter and it will return back the device name...

I connected the device to my laptop atm using a patch cable...

termers commented 6 years ago

Update

I tested some functions and it did work! (my bad)... but for some functions like get_device_name() and get_mac_address()... it does not work if comm_key is not 0 on device...

termers commented 6 years ago

I think this is just how the api protocol of the biometric works