远程解禁

2024-09-09
暂无评分

Service

启用/禁用设备的单个解禁证书

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: unlock_license_switch

Data:

ColumnNameTypeconstraintDescription
license_id解禁证书唯一标识int
enable是否启用bool

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"enable": true,
		"license_id": 240330
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "unlock_license_switch"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: unlock_license_switch

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
license_id解禁证书唯一标识int

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"license_id": 240330,
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "unlock_license_switch"
}

更新设备的解禁证书

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: unlock_license_update

Data:

ColumnNameTypeconstraintDescription
file离线证书文件struct可缺省,如此按照 Flysafe 服务器最新证书进行更新
»url文件 URLtext
»fingerprint文件签名text文件 MD5 签名

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"file": {
			"fingerprint": "xxxx",
			"url": "https://xx.oss-cn-hangzhou.aliyuncs.com/xx.kmz?Expires=xx&OSSAccessKeyId=xxx&Signature=xxx"
		}
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "unlock_license_update"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: unlock_license_update

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123,
	"method": "unlock_license_update"
}

获取设备的解禁证书列表

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: unlock_license_list

Data:

ColumnNameTypeconstraintDescription
device_model_domain指定证书拉取位置enum_int{"0":"飞行器","3":"机场"}从飞行器拉取的是成功导入飞行器的解禁证书;从机场拉取的是 Flysafe 官网申请通过的解禁证书。

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"device_model_domain": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "unlock_license_list"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: unlock_license_list

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
device_model_domain解禁证书位置enum_int{"0":"飞行器","3":"机场"}
consistence证书一致性bool当前飞机已导入的证书和服务器已申请通过的证书是否一致
licenses证书列表array{"size": -, "item_type": struct}
»common_fields通用信息struct
»»license_id解禁证书唯一标识int
»»name解禁证书名称text
»»type解禁证书类型enum_int{"0":"授权区解禁","1":"自定义圆形区域解禁","2":"国家/地区解禁","3":"限高解禁","4":"自定义多边形区域解禁","5":"功率解禁","6":" RID 解禁"}
»»group_id证书所在分组的唯一标识int一个用户账号为一台设备申请的所有证书同属于一组
»»user_id证书归属用户的账号textFlysafe 官网申请解禁证书要求提供大疆账号或机场SN, 机场也被认为是用户的一种, Flysafe 官网为机场分配了唯一ID
»»device_sn证书绑定的设备序列号(SN)text
»»begin_time有效期起始时间戳int秒级 UNIX 时间戳
»»end_time有效期终止时间戳int秒级 UNIX 时间戳
»»user_only是否需要校验用户账号bool
»»enabled是否启用bool
»area_unlock授权区解禁证书信息struct
»»area_ids区域编号集合array{"size": -, "item_type": enum_int}
»circle_unlock自定义圆形区域解禁证书信息struct
»»radius区域半径int{"unit":"米 / m"}
»»latitude圆心纬度double{"max":90,"min":-90}角度值,南纬是负,北纬是正,精度到小数点后6位
»»longitude圆心经度double{"max":180,"min":-180}角度值,东经是正,西经是负,精度到小数点后6位
»»height限高int{"max":65535,"min":0,"unit":"米 / m"}
»country_unlock国家/地区解禁证书信息struct
»»country_number国家/地区数字代码enum_int{}详见ISO_3166-1国际标准(https://en.wikipedia.org/wiki/ISO_3166-1)
»»height限高int{"max":65535,"min":0,"unit":"米 / m"}
»height_unlock限高解禁证书信息struct
»»height限高int{"max":65535,"min":0,"unit":"米 / m"}
»polygon_unlock自定义多边形区域解禁证书信息struct
»»points多边形顶点GPS坐标集合array{"size": -, "item_type": struct}
»»»latitude纬度double{"max":90,"min":-90}角度值,南纬是负,北纬是正,精度到小数点后6位
»»»longitude经度double{"max":180,"min":-180}角度值,东经是正,西经是负,精度到小数点后6位
»power_unlock功率解禁证书信息struct
»rid_unlockRID 解禁证书信息struct
»»levelRID 类型enum_int{"1":"欧盟 RID 解禁","2":"中国 RID 解禁"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"consistence": false,
		"device_model_domain": 0,
		"licenses": [
			{
				"area_unlock": {
					"area_ids": [
						115001769,
						8724
					]
				},
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": true,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240330,
					"name": "XXX区域解禁",
					"type": 0,
					"user_id": "xxxxxxxxx",
					"user_only": false
				}
			},
			{
				"circle_unlock": {
					"height": 500,
					"latitude": 22.60309,
					"longitude": 113.947815,
					"radius": 1581
				},
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240331,
					"name": "XXX圆形解禁",
					"type": 1,
					"user_id": "xxxxxxxxx",
					"user_only": false
				}
			},
			{
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240332,
					"name": "中国国家解禁",
					"type": 2,
					"user_id": "xxxxxxxxx",
					"user_only": false
				},
				"country_unlock": {
					"country_number": 156,
					"height": 500
				}
			},
			{
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240333,
					"name": "XXX高度解禁",
					"type": 3,
					"user_id": "xxxxxxxxx",
					"user_only": false
				},
				"height_unlock": {
					"height": 500
				}
			},
			{
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240334,
					"name": "XXX多边形解禁",
					"type": 4,
					"user_id": "xxxxxxxxx",
					"user_only": false
				},
				"polygon_unlock": {
					"points": [
						{
							"latitude": 22.55403932,
							"longitude": 113.90488828
						},
						{
							"latitude": 22.55520018,
							"longitude": 113.92180215
						},
						{
							"latitude": 22.54656858,
							"longitude": 113.92051272
						}
					]
				}
			},
			{
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240335,
					"name": "XXX功率解禁",
					"type": 5,
					"user_id": "xxxxxxxxx",
					"user_only": false
				},
				"power_unlock": {}
			},
			{
				"common_fields": {
					"begin_time": 1696948115,
					"device_sn": "xxxxxxxxx",
					"enabled": false,
					"end_time": 2145916800,
					"group_id": 2896,
					"license_id": 240336,
					"name": "XXX RID 解禁",
					"type": 6,
					"user_id": "xxxxxxxxx",
					"user_only": false
				},
				"rid_unlock": {
					"level": 1
				}
			}
		],
		"result": 0
	},
	"gateway": "",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "unlock_license_list"
}
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。