Device.php
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace ysopen;
use ysopen\Token;
use fast\Http;
class Device extends Token
{
/* 添加设备
* $deviceSerial 设备序列号,存在英文字母的设备序列号,字母需为大写
* $validateCode 设备验证码,设备机身上的六位大写字母
*/
public function add($deviceSerial,$validateCode){
$url = 'https://open.ys7.com/api/lapp/device/add';
$data['deviceSerial'] = $deviceSerial;
$data['validateCode'] = $validateCode;
$data['accessToken'] = $this->token();
$http = new Http();
$res = json_decode($http->post($url,$data),true);
}
/* 删除设备
* $deviceSerial 设备序列号,存在英文字母的设备序列号,字母需为大写
*/
public function del($deviceSerial){
$url = 'https://open.ys7.com/api/lapp/device/delete';
$data['deviceSerial'] = $deviceSerial;
$data['accessToken'] = $this->token();
$http = new Http();
$res = json_decode($http->post($url,$data),true);
}
/* 关闭设备视频加密
* $deviceSerial 设备序列号,存在英文字母的设备序列号,字母需为大写
* $validateCode 设备验证码,设备机身上的六位大写字母
*/
public function off($deviceSerial,$validateCode){
$url = 'https://open.ys7.com/api/lapp/device/encrypt/off';
$data['deviceSerial'] = $deviceSerial;
$data['validateCode'] = $validateCode;
$data['accessToken'] = $this->token();
$http = new Http();
$res = json_decode($http->post($url,$data),true);
}
}