Files
tthcmservices/zklib/src/Device.php
asansal 5bec63d9cd Add ZK library classes for device interaction and user management
- Implemented Os class for retrieving OS information.
- Added Pin class for getting PIN width.
- Created Platform class for fetching platform details and version.
- Developed SerialNumber class to retrieve device serial number.
- Introduced Ssr class for SSR information retrieval.
- Implemented Time class for setting and getting device time.
- Added User class for user management including setting, getting, clearing, and removing users.
- Created Util class with various utility functions for command handling and data processing.
- Implemented Version class for fetching device version.
- Added WorkCode class for retrieving work code information.
- Set up Composer autoloading for the ZK library.
2025-06-25 17:25:23 +07:00

50 lines
948 B
PHP

<?php
namespace ZK;
use ZKLib;
class Device
{
/**
* @param ZKLib $self
* @return bool|mixed
*/
public function name(ZKLib $self)
{
$self->_section = __METHOD__;
$command = Util::CMD_DEVICE;
$command_string = '~DeviceName';
return $self->_command($command, $command_string);
}
/**
* @param ZKLib $self
* @return bool|mixed
*/
public function enable(ZKLib $self)
{
$self->_section = __METHOD__;
$command = Util::CMD_ENABLE_DEVICE;
$command_string = '';
return $self->_command($command, $command_string);
}
/**
* @param ZKLib $self
* @return bool|mixed
*/
public function disable(ZKLib $self)
{
$self->_section = __METHOD__;
$command = Util::CMD_DISABLE_DEVICE;
$command_string = chr(0) . chr(0);
return $self->_command($command, $command_string);
}
}