-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
luatos_bot
committed
Nov 1, 2024
1 parent
9d7d07e
commit 3015830
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# airlbs - airlbs 定位服务(收费服务,需自行联系销售申请) | ||
|
||
{bdg-secondary}`适配状态未知` | ||
|
||
```{note} | ||
本页文档由[这个文件](https://gitee.com/openLuat/LuatOS/tree/master/luat/../script/libs/airlbs.lua)自动生成。如有错误,请提交issue或帮忙修改后pr,谢谢! | ||
``` | ||
|
||
|
||
**示例** | ||
|
||
```lua | ||
--注意:因使用了sys.wait()所有api需要在协程中使用 | ||
--注意:使用前需同步时间 | ||
-- 用法实例 | ||
local airlbs = require "airlbs" | ||
|
||
sys.taskInit(function() | ||
sys.waitUntil("IP_READY") | ||
|
||
socket.sntp() | ||
sys.waitUntil("NTP_UPDATE", 1000) | ||
|
||
while 1 do | ||
local result , data = airlbs.request({project_id = "xxx",project_key = 'xxx',timeout = 1000}) | ||
if result then | ||
print("airlbs", json.encode(data)) | ||
end | ||
sys.wait(20000) | ||
end | ||
|
||
end) | ||
|
||
``` | ||
|
||
## airlbs.request(param) | ||
|
||
|
||
|
||
获取定位数据 | ||
|
||
**参数** | ||
|
||
|传入值类型|解释| | ||
|-|-| | ||
|param|table 参数(联系销售获取id与key) project_id:项目ID project_key:项目密钥 timeout:超时时间| | ||
|
||
**返回值** | ||
|
||
|返回值类型|解释| | ||
|-|-| | ||
|bool|成功返回true,失败会返回false| | ||
|table|定位成功生效,成功返回定位数据| | ||
|
||
**例子** | ||
|
||
```lua | ||
local result , data = airlbs.request({project_id = airlbs_project_id,project_key = airlbs_project_key}) | ||
if result then | ||
print("airlbs", json.encode(data)) | ||
end | ||
|
||
``` | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ ads1115plus | |
adxl34x | ||
aht10 | ||
air153C_wtd | ||
airlbs | ||
ak8963 | ||
aliyun | ||
am2320 | ||
|