getLocation 方法检索设备的当前地理位置,包括纬度、经度、精度和读取时间。
请求
JSON-RPC 2.0TweezerComm 中的所有方法都遵循 JSON-RPC 2.0 结构。有关如何构建和发送请求的更多详情,请参阅开始。
method 字段需要设置为 getLocation,如下例所示:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
获取设备的 GPS 位置以支持基于位置的终端功能。
getLocation 方法检索设备的当前地理位置,包括纬度、经度、精度和读取时间。
method 字段需要设置为 getLocation,如下例所示:
{
"jsonrpc": "2.0",
"method": "getLocation",
"params": [
"device"
],
"id": "101"
}
| Name | Type | Description |
|---|---|---|
params | array | 必须包含值 device |
{
"jsonrpc": "2.0",
"id": "101",
"result": {
"statusCode": 0,
"statusMessage": "",
"latitude": "32.0879",
"longitude": "34.7999",
"accuracy": "12.4",
"timestamp": "1751443200000"
}
}
| Name | Type | Description |
|---|---|---|
statusCode | integer | 操作状态(0 = 成功) |
statusMessage | string | 操作结果消息 |
latitude | string | 设备位置的纬度坐标。 |
longitude | string | 设备位置的经度坐标。 |
accuracy | string | 位置读取精度,单位为米。 |
timestamp | string | 位置被记录时的 Epoch 时间戳(毫秒)。 |
此页面对您有帮助吗?