bmz / zkteco
ZKTeco Laravel 库
0.1.10
2023-07-03 01:03 UTC
Requires
- ext-sockets: *
README
rats/zkteco
包提供方便使用的函数来管理 ZKTeco 设备活动。
要求: Laravel >= 6.0
许可: MIT 或更新版
安装
您可以通过 composer 安装此包。
composer require rats/zkteco
该包将自动注册自己。
如果尚未启用,您必须启用您的 php socket。
用法
- 创建 ZKTeco 类的对象。
use Rats\Zkteco\Lib\ZKTeco; // 1 s't parameter is string $ip Device IP Address // 2 nd parameter is integer $port Default: 4370 $zk = new ZKTeco('192.168.1.201'); // or you can use with port // $zk = new ZKTeco('192.168.1.201', 8080);
- 调用 ZKTeco 方法
- 连接
// connect // this return bool $zk->connect();
- 断开连接
// disconnect // this return bool $zk->disconnect();
- 启用设备
// enable // this return bool/mixed $zk->enableDevice();
注意:您必须在读取/写入设备任何信息之后调用。
- 禁用设备
// disable // this return bool/mixed $zk->disableDevice();
注意:您必须在读取/写入设备任何信息之前调用。
- 设备版本
// get device version // this return bool/mixed $zk->version();
- 设备操作系统版本
// get device os version // this return bool/mixed $zk->osVersion();
- 关机
// turn off the device // this return bool/mixed $zk->shutdown();
- 重启
// restart the device // this return bool/mixed $zk->restart();
- 休眠
// sleep the device // this return bool/mixed $zk->sleep();
- 恢复
// resume the device from sleep // this return bool/mixed $zk->resume();
- 声音测试
// voice test of the device "Thank you" // this return bool/mixed $zk->testVoice();
- 平台
// get platform // this return bool/mixed $zk->platform();
- 固件版本
// get firmware version // this return bool/mixed $zk->fmVersion();
- 工作代码
// get work code // this return bool/mixed $zk->workCode();
- SSR
// get SSR // this return bool/mixed $zk->ssr();
- 引脚宽度
// get Pin Width // this return bool/mixed $zk->pinWidth();
- 序列号
// get device serial number // this return bool/mixed $zk->serialNumber();
- 设备名称
// get device name // this return bool/mixed $zk->deviceName();
- 获取设备时间
// get device time // return bool/mixed bool|mixed Format: "Y-m-d H:i:s" $zk->getTime();
- 设置设备时间
// set device time // parameter string $t Format: "Y-m-d H:i:s" // return bool/mixed $zk->setTime();
- 获取用户
// get User // this return array[] $zk->getUser();
- 设置用户
// set user // 1 s't parameter int $uid Unique ID (max 65535) // 2 nd parameter int|string $userid ID in DB (same like $uid, max length = 9, only numbers - depends device setting) // 3 rd parameter string $name (max length = 24) // 4 th parameter int|string $password (max length = 8, only numbers - depends device setting) // 5 th parameter int $role Default Util::LEVEL_USER // 6 th parameter int $cardno Default 0 (max length = 10, only numbers // return bool|mixed $zk->setUser();
- 清除所有管理员
// remove all admin // return bool|mixed $zk->clearAdmin();
- 清除所有用户
// remove all users // return bool|mixed $zk->clearAdmin();
- 删除一个用户
// remove a user by $uid // parameter integer $uid // return bool|mixed $zk->removeUser();
- 获取考勤日志
// get attendance log // return array[] // like as 0 => array:5 [▼ // "uid" => 1 /* serial number of the attendance */ // "id" => "1" /* user id of the application */ // "state" => 1 /* the authentication type, 1 for Fingerprint, 4 for RF Card etc */ // "timestamp" => "2020-05-27 21:21:06" /* time of attendance */ // "type" => 255 /* attendance type, like check-in, check-out, overtime-in, overtime-out, break-in & break-out etc. if attendance type is none of them, it gives 255. */ // ] $zk->getAttendance();
- 清除考勤日志
// clear attendance log // return bool/mixed $zk->clearAttendance();