Remove documentation now in bl602-docs repo (#48)

* Remove documentation now in bl602-docs repo

* Replace upstream docs with bl602-docs submodule
This commit is contained in:
Tom Hebb 2020-10-29 15:57:39 -07:00 committed by GitHub
parent 91cd02fe2c
commit f96b66f346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
442 changed files with 9 additions and 46985 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "docs"]
path = docs
url = https://github.com/pine64/bl602-docs.git

View File

@ -4,7 +4,10 @@ BL602 SDK (Pine64 version)
Join us on `Discord <https://discord.gg/89VWQVH>`_, `Telegram <https://t.me/joinchat/Kmi2S0nOsT240emHk-aO6g>`_, `Matrix <https://matrix.to/#/#pine64-nutcracker:matrix.org>`_
This repository contains the Pine64 fork of Bouffalo Lab's SDK for their BL602
Wi-Fi/BLE Combo RISC-V SoC. The upstream documentation lives in ``docs/html``.
Wi-Fi/BLE Combo RISC-V SoC. Documentation, including upstream documentation,
translations, mirrored technical documentation, and original reverse engineered
documentation is at `bl602-docs <https://github.com/pine64/bl602-docs>`_, which
is cloned as a submodule of this repository at ``docs``.
This repository is the central focus of Pine64's
`Nutcracker Challenge <https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/>`_.
@ -39,18 +42,7 @@ Hardware
BL602 is a 32-bit RISC-V based combo chipset supporting Wi-Fi and BLE (Bluetooth
Low Energy). The chip is made by `Nanjing-based Bouffalo Lab <https://www.bouffalolab.com/bl602>`_
for ultra-low-power applications. In terms of price range and feature set, the
chip is competing against `Espressif ESP8266 <https://www.espressif.com/en/products/socs/esp8266>`_
- `BL602/604 Datasheet <docs/BL602_BL604_DS_Datasheet.pdf>`_
(34 pages): Includes pinout, memory map, and general peripheral descriptions
but no detailed functional specification or register listings. Sipeed, a board
vendor that plans to use the BL602, `claims <https://twitter.com/SipeedIO/status/1321658609990725633>`_
that full register documentation will be available sometime in November 2020.
- `soc602_reg.svd <components/bl602/bl602_std/bl602_std/Device/Bouffalo/BL602/Peripherals/soc602_reg.svd>`_:
Contains a seemingly-complete register listing, with names but no descriptions,
for the BL602.
- `Hardware Notes <docs/hardware_notes.md>`_: Additional information gathered
from this repository and elsewhere on the internet.
chip is competing against `Espressif ESP8266 <https://www.espressif.com/en/products/socs/esp8266>`_.
Comparison with ESP8266
-----------------------

1
docs Submodule

@ -0,0 +1 @@
Subproject commit b9c0f1ee35fc52ea60e027e9e02bcb782aa75e40

Binary file not shown.

View File

@ -1,114 +0,0 @@
Hardware Notes
==============
This file contains a compilation of various pieces of information about the
BL602's hardware (e.g. core, peripherals, debug, memory map), gathered from
this repository and around the internet. This is the best we can do in lieu of
a proper Technical Reference Manual, which has not yet been released as of
this writing.
Contributions welcome!
CPU Core
--------
According to [soc602_reg.svd][2], the BL602 contains a RISC-V RV32IMAFC core.
Interestingly, the [datasheet][1] and online spec sheets from Bouffalo Lab
never mention RISC-V, simply calling the core a "32-bit RISC CPU."
CNX Software [claims][5] that the core is a [SiFive E24][6]. Although this
claim is unsourced, information in the datasheet seems to corroborate it. The
datasheet claims that the CPU achieves a Dhrystone score of 1.46 DMIPS/MHz and
a CoreMark score of 3.1 CoreMark/MHz. These numbers exactly match what SiFive
advertises for the E24. Similarly, the set of RISC-V extensions matches, as
does the pipeline length (3-stage) and number of breakpoints/watchpoints (4).
The BL602 appears to diverge from the reference E24 implementation in its
memory map, however: its peripherals are mapped starting at `0x4000_0000`,
whereas SiFive's [E24 Manual][7] has a memory map placing peripherals at
`0x2000_0000`. Likewise, the BL602 maps its memories at `0x2000_0000` but the
E24 reference design maps them at `0x6000_0000`. Finally, the BL602's TCMs are
differently-mapped, differently-named (TCM vs TIM), and differently-sized
(48KiB vs 32KiB) from the reference E24 ones. SiFive does claim that the memory
map and TIM sizes are customizable, though, so none of these differences are
strong evidence against the core being an E24.
[clic.h][4], which is part of the BL602's register definition headers, appears
to be a SiFive-authored file (see the include guard), and its addresses match
the E24 reference. I think this is one of the clearest pieces of evidence for
the core being SiFive IP.
Memory Map
----------
The [datasheet][1] contains a memory map, as does [soc602_reg.svd][2] and
[bl602.h][3]. As mentioned above, [clic.h][4] also contains part of the map. I
have attempted to synthesize information from all these sources into a single
unified table. I make no guarantees to the accuracy of this table.
| Base address | Top address | Name |
|---------------|---------------|--------------------------------------------|
| `0x0200_0000` | `0x027F_FFFF` | RISC-V CLINT |
| `0x0280_0000` | `0x02FF_FFFF` | Hart 0 CLIC |
| `0x2100_0000` | `0x2101_FFFF` | Mask ROM (holds ROMDRIVER code) |
| `0x2200_8000` | `0x2201_3FFF` | ITCM (Instruction Tightly Coupled Memory) |
| `0x2201_4000` | `0x2201_BFFF` | DTCM (Data Tightly Coupled Memory) |
| `0x2202_0000` | `0x2202_FFFF` | Main RAM |
| `0x2300_0000` | `0x23FF_FFFF` | XIP (eXecute In Place) flash mapping |
| `0x4000_0000` | `0x4000_0FFF` | `glb` (global control registers) |
| `0x4000_1000` | `0x4000_1FFF` | `rf` ("mixed signal"/radio) |
| `0x4000_2000` | `0x4000_2FFF` | `gpip` (ADC+DAC+analog comparator config) |
| `0x4000_3000` | `0x4000_3FFF` | *`sec_dbg`* (secure debug?) |
| `0x4000_4000` | `0x4000_4FFF` | `sec_eng` (security engine, e.g. SHA+AES) |
| `0x4000_5000` | `0x4000_5FFF` | `tzc_sec` ("trust isolation" #1) |
| `0x4000_6000` | `0x4000_6FFF` | `tzc_nsec` ("trust isolation" #2) |
| `0x4000_7000` | `0x4000_707F` | `ef_data_0` (eFuse data #1) |
| `0x4000_7080` | `0x4000_70FF` | `ef_data_1` (eFuse data #2) |
| `0x4000_7800` | `0x4000_7FFF` | `ef_ctrl` (eFuse control) |
| `0x4000_8000` | `0x4000_8FFF` | *`cci`* (???) |
| `0x4000_9000` | `0x4000_9FFF` | `l1c` (cache control) |
| `0x4000_A000` | `0x4000_A0FF` | `uart0` (UART #1) |
| `0x4000_A100` | `0x4000_A1FF` | `uart1` (UART #2) |
| `0x4000_A200` | `0x4000_A2FF` | `spi` (Serial Peripheral Interface) |
| `0x4000_A300` | `0x4000_A3FF` | `i2c` (I2C) |
| `0x4000_A400` | `0x4000_A4FF` | `pwm` (Pulse Width Modulation #1-#6) |
| `0x4000_A500` | `0x4000_A5FF` | `timer` (Timer #1 and #2) |
| `0x4000_A600` | `0x4000_A6FF` | `ir` (infrared remote accelerator) |
| `0x4000_A000` | `0x4000_AFFF` | *`cks`* (???, conflicts with others) |
| `0x4000_B000` | `0x4000_B6FF` | `sf_ctrl` (serial flash control) |
| `0x4000_B700` | `0x4000_BFFF` | `sf_ctrl_buf` (serial flash data buffer) |
| `0x4000_C000` | `0x4000_CFFF` | `dma` (Direct Memory Access engine) |
| `0x4000_D000` | `0x4000_DFFF` | `sdu` (SDIO slave controller) |
| `0x4000_E000` | `0x4000_EFFF` | `pds` (Power Down Sleep/sleep control) |
| `0x4000_F000` | `0x4000_F7FF` | `hbn` (Hibernate/deep sleep control) |
| `0x4000_F800` | `0x4000_FFFF` | `aon` (analog domain control?) |
| `0x4001_0000` | `0x4001_0FFF` | Deep sleep retention RAM |
| `0x4202_0000` | `0x4203_BFFF` | Wireless RAM (datasheet disagrees on base)|
(Peripherals in *`italics`* are present in the SVD but not the datasheet.)
The datasheet claims that the system has 276KiB of RAM, and indeed that is the
number we get by adding up 64KiB of main RAM, 112KiB of wireless RAM, 48KiB of
instruction TCM, 48KiB of data TCM, and 4KiB of deep sleep retention RAM.
As noted in the table, the wireless RAM address is ambiguous. bl602.h says it's
`0x4202_0000`, but the datasheet says it's `0x4203_0000`. I can only assume one
of them is a typo, and my guess is that it's the one that isn't code.
Interestingly, bl602.h defines three extra "remap" mappings, labeled REMAP0,
REMAP1, and REMAP2, in addition to the ranges in the table above for each of
flash XIP, wireless RAM, and the TCMs. I have not found any register that looks
like a remapping control, so I'm not sure what this is about. The remap base
addresses are as follows:
| Memory | "Normal" base | REMAP0 base | REMAP1 base | REMAP2 base |
|--------|---------------|---------------|---------------|---------------|
| XIP | `0x2300_0000` | `0x3300_0000` | `0x4300_0000` | `0x5300_0000` |
| WRAM | `0x4202_0000` | `0x2202_0000` | `0x3202_0000` | `0x5202_0000` |
| TCM | `0x2200_8000` | `0x3200_8000` | `0x4200_8000` | `0x5200_8000` |
[1]: BL602_BL604_DS_Datasheet.pdf
[2]: ../components/bl602/bl602_std/bl602_std/Device/Bouffalo/BL602/Peripherals/soc602_reg.svd
[3]: ../components/bl602/bl602_std/bl602_std/Device/Bouffalo/BL602/Peripherals/bl602.svd
[4]: ../components/bl602/bl602_std/bl602_std/RISCV/Core/Include/clic.h
[5]: https://www.cnx-software.com/2020/10/24/bl602-bl604-risc-v-wifi-bluetooth-5-0-le-soc-will-sell-at-esp8266-price-point/#comment-576285
[6]: https://www.sifive.com/cores/e24
[7]: https://sifive.cdn.prismic.io/sifive/dffb6a15-80b3-42cb-99e1-23ce6fd1d052_sifive_E24_rtl_full_20G1.03.00_manual.pdf

View File

@ -1,4 +0,0 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8ee7ddcc4a84adcfab6b0f0ff24c24b6
tags: 645f666f9bcd5a90fca523b33c5a78b7

Binary file not shown.

Binary file not shown.

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1. cronalarms &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="2. Wi-Fi Manager" href="../wifi/wifi_mgmr.html" />
<link rel="prev" title="17. BLE" href="../../Components/BLE/ble_stack/ble_stack.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">1. </span>cronalarms</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/API/sys/cronalarms.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="cronalarms">
<h1><span class="section-number">1. </span>cronalarms<a class="headerlink" href="#cronalarms" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../wifi/wifi_mgmr.html" class="btn btn-neutral float-right" title="2. Wi-Fi Manager" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../../Components/BLE/ble_stack/ble_stack.html" class="btn btn-neutral float-left" title="17. BLE" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,263 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2. Wi-Fi Manager &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="prev" title="1. cronalarms" href="../sys/cronalarms.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">2. </span>Wi-Fi Manager</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/API/wifi/wifi_mgmr.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="wi-fi-manager">
<h1><span class="section-number">2. </span>Wi-Fi Manager<a class="headerlink" href="#wi-fi-manager" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../sys/cronalarms.html" class="btn btn-neutral float-left" title="1. cronalarms" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,940 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>17. BLE &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="1. cronalarms" href="../../../API/sys/cronalarms.html" />
<link rel="prev" title="16. Mesh" href="../mesh/mesh.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">17. BLE</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">17.1. 概述</a></li>
<li class="toctree-l2"><a class="reference internal" href="#api">17.2. API参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">17.3. 数据结构参考</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">17. </span>BLE</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/BLE/ble_stack/ble_stack.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="ble">
<span id="ble-index"></span><h1><span class="section-number">17. </span>BLE<a class="headerlink" href="#ble" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">17.1. </span>概述<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul>
<li><dl>
<dt>BLE支持的特性</dt><dd><ul>
<li><dl>
<dt>蓝牙HOST特性</dt><dd><ul class="simple">
<li><p>GAP支持的角色Peripheral与CentralObserver与Broadcaster</p></li>
</ul>
<ul class="simple">
<li><p>GATT支持的角色Server与Client</p></li>
<li><p>支持配对包括蓝牙4.2中的安全连接特性</p></li>
<li><p>支持永久存储蓝牙特定的设置和数据</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl>
<dt>蓝牙mesh特性</dt><dd><ul class="simple">
<li><p>支持Relay, Friend Node, Low-Power Node (LPN) and GATT Proxy角色</p></li>
</ul>
<ul class="simple">
<li><p>支持两种Provisioning bearers(PB-ADV &amp; PB-GATT)</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
<li><dl>
<dt>BLE协议栈的架构</dt><dd><blockquote>
<div><div class="figure align-default">
<img alt="../../../_images/image1.png" src="../../../_images/image1.png" />
</div>
</div></blockquote>
<ul>
<li><dl>
<dt>总共有3个主要层共同构成了一个完整的蓝牙低能耗协议栈</dt><dd><ul class="simple">
<li><p>Host这一层位于应用程序之下,由多个(非实时)网络和传输协议组成,使应用程序能够以标准和互操作的方式与对等设备通信。</p></li>
</ul>
<ul class="simple">
<li><p>Controller控制器实现了链路层(LE LL)这是一种低层次的实时协议它与无线电硬件一起提供了空中通信的标准互操作。LL处理包的接收和传输保证数据的传递并处理所有LL控制程序。</p></li>
</ul>
<ul class="simple">
<li><p>Radio Hardware实现所需的模拟和数字基带功能块允许链路层固件在频谱的2.4GHz波段发送和接收。</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
<li><dl>
<dt>主控Host</dt><dd><blockquote>
<div><div class="figure align-default">
<img alt="../../../_images/image2.png" src="../../../_images/image2.png" />
</div>
</div></blockquote>
<ul class="simple">
<li><dl class="simple">
<dt>蓝牙Host层实现了所有高级协议和配置文件最重要的是它为应用程序提供了高级API</dt><dd><ul>
<li><p>HCI:Host与controller接口</p></li>
<li><p>L2CAP:逻辑链路控制和适应协议</p></li>
<li><p>GATT:通用属性配置层Generic Attribute Profile</p></li>
<li><p>GAP:通用访问配置层Generic Access Profile</p></li>
<li><p>SMP:安全管理器配置层Security Manager Specification</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>应用Application</dt><dd><ul class="simple">
<li><dl class="simple">
<dt>应用层是用户开发实际蓝牙应用的地方,包含必要的协议栈参数设置,以及各种功能函数的调用。我们分别从蓝牙从机和蓝牙主机两种设备来分析。</dt><dd><ul>
<li><dl class="simple">
<dt>蓝牙从机</dt><dd><ul>
<li><p>相关硬件和基础服务初始化</p></li>
<li><p>设置广播参数:广播数据,广播间隔,扫描回应等参数或者数据</p></li>
<li><p>设置Profile添加从机服务、特征值还有设置回调函数用于接收主机数据等</p></li>
<li><p>设置配对参数(可选)</p></li>
<li><p>启动广播,开始运行</p></li>
<li><p>等待相关事件,及事件处理,例如收到主机发来的数据,被链接等等</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>蓝牙主机</dt><dd><ul>
<li><p>相关硬件和基础服务初始化</p></li>
<li><p>设置扫描参数</p></li>
<li><p>设置连接参数</p></li>
<li><p>设置配对参数(可选)</p></li>
<li><p>启动协议栈,开始运行</p></li>
<li><p>等待相关事件及事件处理例如扫描事件从机的Notify事件等等。</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="api">
<h2><span class="section-number">17.2. </span>API参考<a class="headerlink" href="#api" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>API介绍</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">ble_controller_init(uint8_t</span> <span class="pre">task_priority)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function controller层初始化
* @param[in] task_priority 任务优先级
* @return 空
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">hci_driver_init(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function HCI接口驱动初始化
* @param[in] 空
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_enable(bt_ready_cb_t</span> <span class="pre">cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function Ble使能
* @param[in] cb如果成功调用回调函数
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_adv_start(const</span> <span class="pre">struct</span> <span class="pre">bt_le_adv_param</span> <span class="pre">*param,const</span> <span class="pre">struct</span> <span class="pre">bt_data</span> <span class="pre">*ad,</span> <span class="pre">size_t</span> <span class="pre">ad_len,</span></code></dt><dd><p><code class="docutils literal notranslate"><span class="pre">const</span> <span class="pre">struct</span> <span class="pre">bt_data</span> <span class="pre">*sd,</span> <span class="pre">size_t</span> <span class="pre">sd_len)</span></code></p>
</dd>
</dl>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启BLE广播
*
* @param[in] param: 指向广播配置参数指针
* @param[in] ad: 指向广播包中数据指针
* @param[in] ad_len: 广播包中数据的长度
* @param[in] sd: 指向扫描响应包数据指针
* @param[in] sd_len: 扫描响应包数据的长度
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_adv_update_data(const</span> <span class="pre">struct</span> <span class="pre">bt_data</span> <span class="pre">*ad,</span> <span class="pre">size_t</span> <span class="pre">ad_len,const</span> <span class="pre">struct</span> <span class="pre">bt_data</span> <span class="pre">*sd,</span> <span class="pre">size_t</span> <span class="pre">sd_len)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 更新BLE广播数据
* @param[in] ad: 指向广播包中数据指针
* @param[in] ad_len: 广播包中数据的长度
* @param[in] sd: 指向扫描响应包数据指针
* @param[in] sd_len: 扫描响应包数据的长度
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_adv_stop(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 停止BLE广播
* @param[in] 空
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_scan_start(const</span> <span class="pre">struct</span> <span class="pre">bt_le_scan_param</span> <span class="pre">*param,</span> <span class="pre">bt_le_scan_cb_t</span> <span class="pre">cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启BLE扫描
* @param[in] param: 指向扫描参数的指针
* @param[in] cb: 扫描回调函数
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_scan_stop(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 停止BLE扫描
* @param[in] 空
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_whitelist_add(const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*addr)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 通过地址添加设备到白名单列表中
* @param[in] addr:指向需要添加设备地址的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_whitelist_rem(const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*addr)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 从白名单列表中移除设备
* @param[in] addr:指向需要移除设备地址的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_whitelist_clear(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 清除白名单列表
* @param[in] 空
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_set_chan_map(u8_t</span> <span class="pre">chan_map[5])</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 设置(LE)通道映射
* @param[in] chan_map通道数组
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_unpair(u8_t</span> <span class="pre">id,</span> <span class="pre">const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*addr)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 清除配对信息
* @param[in] id 本地标识(大多只是默认的BT ID)
* @param[in] addr 远端设备地址NULL或者BT_ADDR_LE_ANY清除所有远端设备
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_get_info(const</span> <span class="pre">struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,</span> <span class="pre">struct</span> <span class="pre">bt_conn_info</span> <span class="pre">*info)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取当前连接设备的信息
* @param[in] conn 指向当前连接的指针
* @param[in] info 指向当前连接设备信息的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_get_remote_dev_info(struct</span> <span class="pre">bt_conn_info</span> <span class="pre">*info)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取已连接设备的信息
* @param[in] info 指向当前连接设备信息的指针
* @return 已连接设备的个数
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_le_param_update(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,const</span> <span class="pre">struct</span> <span class="pre">bt_le_conn_param</span> <span class="pre">*param)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 更新连接参数
* @param[in] conn 指向当前连接的指针
* @param[in] param 指向连接参数的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_disconnect(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,</span> <span class="pre">u8_t</span> <span class="pre">reason)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 断开当前连接
* @param[in] conn 指向当前连接的指针
* @param[in] reason断开当前连接的原因
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">bt_conn</span> <span class="pre">*bt_conn_create_le(const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*peer,const</span> <span class="pre">struct</span> <span class="pre">bt_le_conn_param</span> <span class="pre">*param)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 创建连接
* @param[in] peer 需要连接设备地址的指针
* @param[in] param 指向连接参数指针
* @return 成功:有效的连接对象,否则失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_create_auto_le(const</span> <span class="pre">struct</span> <span class="pre">bt_le_conn_param</span> <span class="pre">*param)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 自动创建连接白名单列表中的设备
* @param[in] param 指向连接参数指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_create_auto_stop(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 停止自动创建连接白名单列表中的设备
* @param[in] 空
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_set_auto_conn(const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*addr,const</span> <span class="pre">struct</span> <span class="pre">bt_le_conn_param</span> <span class="pre">*param)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 自动创建连接远端设备
* @param[in] addr 远端设备地址指针
* @param[in] param 指向连接参数指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">bt_conn</span> <span class="pre">*bt_conn_create_slave_le(const</span> <span class="pre">bt_addr_le_t</span> <span class="pre">*peer,const</span> <span class="pre">struct</span> <span class="pre">bt_le_adv_param</span> <span class="pre">*param)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 发起定向的广播包给远端设备
* @param[in] peer 远端设备地址指针
* @param[in] param 指向广播参数的指针
* @return 成功:有效的连接对象,否则失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_set_security(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,</span> <span class="pre">bt_security_t</span> <span class="pre">sec)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 设置连接安全等级
* @param[in] conn 指向连接对象的指针
* @param[in] sec 安全等级
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">bt_security_t</span> <span class="pre">bt_conn_get_security(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取当前连接的安全等级
* @param[in] conn 指向连接对象的指针
* @return 安全级别
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">u8_t</span> <span class="pre">bt_conn_enc_key_size(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取当前连接的加密key的大小
* @param[in] conn 指向连接对象的指针
* @return 加密key的大小
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">bt_conn_cb_register(struct</span> <span class="pre">bt_conn_cb</span> <span class="pre">*cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 注册连接回调函数
* @param[in] cb 连接回调函数
* @return 空
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">bt_set_bondable(bool</span> <span class="pre">enable)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 设置/清除SMP配对请求/响应数据认证需求中的绑定标志
* @param[in] enable 1使能0不使能
* @return 空
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_auth_cb_register(const</span> <span class="pre">struct</span> <span class="pre">bt_conn_auth_cb</span> <span class="pre">*cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 注册认证回调函数
* @param[in] cb 回调函数指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_auth_passkey_entry(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,</span> <span class="pre">unsigned</span> <span class="pre">int</span> <span class="pre">passkey)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 用密钥回复对方
* @param[in] conn 连接对象指针
* @param[in] passkey 输入的密钥
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_auth_cancel(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 取消认证过程
* @param[in] conn 连接对象指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_auth_passkey_confirm(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 如果密码匹配,回复对方
* @param[in] conn 连接对象的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_conn_auth_pincode_entry(struct</span> <span class="pre">bt_conn</span> <span class="pre">*conn,</span> <span class="pre">const</span> <span class="pre">char</span> <span class="pre">*pin)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 用PIN码进行回复对方
* @param[in] conn 连接对象的指针
* @param[in] pin PIN码的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_le_read_rssi(u16_t</span> <span class="pre">handle,int8_t</span> <span class="pre">*rssi)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 读取对方RSSI值
* @param[in] handle连接的句柄值
* @param[in] rssi rssi的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_get_local_address(bt_addr_le_t</span> <span class="pre">*adv_addr)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 读取本机的地址
* @param[in] adv_addr 指向地址的指针
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">bt_set_tx_pwr(int8_t</span> <span class="pre">power)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 设置本机发射功率
* @param[in] power 功率值
* @return 0:成功,!=0:失败
*/
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h2><span class="section-number">17.3. </span>数据结构参考<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">bt_le_adv_param</span></code>数据结构:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/** LE Advertising Parameters. */</span>
<span class="k">struct</span> <span class="n">bt_le_adv_param</span> <span class="p">{</span>
<span class="cm">/** Local identity */</span>
<span class="n">u8_t</span> <span class="n">id</span><span class="p">;</span>
<span class="cm">/** Bit-field of advertising options */</span>
<span class="n">u8_t</span> <span class="n">options</span><span class="p">;</span>
<span class="cm">/** Minimum Advertising Interval (N * 0.625) */</span>
<span class="n">u16_t</span> <span class="n">interval_min</span><span class="p">;</span>
<span class="cm">/** Maximum Advertising Interval (N * 0.625) */</span>
<span class="n">u16_t</span> <span class="n">interval_max</span><span class="p">;</span>
<span class="cp">#if defined(CONFIG_BT_STACK_PTS)</span>
<span class="n">u8_t</span> <span class="n">addr_type</span><span class="p">;</span>
<span class="cp">#endif</span>
<span class="p">};</span>
</pre></div>
</div>
<p>此数据结构用来配置广播参数包括本地识别id、广播选项位域、广播间隙等其中广播选项位域有如下枚举类型参数可选:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="p">{</span>
<span class="cm">/** Convenience value when no options are specified. */</span>
<span class="n">BT_LE_ADV_OPT_NONE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
<span class="cm">/** Advertise as connectable. Type of advertising is determined by</span>
<span class="cm"> * providing SCAN_RSP data and/or enabling local privacy support.</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_CONNECTABLE</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
<span class="cm">/** Don&#39;t try to resume connectable advertising after a connection.</span>
<span class="cm"> * This option is only meaningful when used together with</span>
<span class="cm"> * BT_LE_ADV_OPT_CONNECTABLE. If set the advertising will be stopped</span>
<span class="cm"> * when bt_le_adv_stop() is called or when an incoming (slave)</span>
<span class="cm"> * connection happens. If this option is not set the stack will</span>
<span class="cm"> * take care of keeping advertising enabled even as connections</span>
<span class="cm"> * occur.</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_ONE_TIME</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span>
<span class="cm">/** Advertise using the identity address as the own address.</span>
<span class="cm"> * @warning This will compromise the privacy of the device, so care</span>
<span class="cm"> * must be taken when using this option.</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_USE_IDENTITY</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span>
<span class="cm">/** Advertise using GAP device name */</span>
<span class="n">BT_LE_ADV_OPT_USE_NAME</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span>
<span class="cm">/** Use low duty directed advertising mode, otherwise high duty mode</span>
<span class="cm"> * will be used. This option is only effective when used with</span>
<span class="cm"> * bt_conn_create_slave_le().</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span>
<span class="cm">/** Enable use of Resolvable Private Address (RPA) as the target address</span>
<span class="cm"> * in directed advertisements when CONFIG_BT_PRIVACY is not enabled.</span>
<span class="cm"> * This is required if the remote device is privacy-enabled and</span>
<span class="cm"> * supports address resolution of the target address in directed</span>
<span class="cm"> * advertisement.</span>
<span class="cm"> * It is the responsibility of the application to check that the remote</span>
<span class="cm"> * device supports address resolution of directed advertisements by</span>
<span class="cm"> * reading its Central Address Resolution characteristic.</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_DIR_ADDR_RPA</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span>
<span class="cm">/** Use whitelist to filter devices that can request scan response</span>
<span class="cm"> * data.</span>
<span class="cm"> */</span>
<span class="n">BT_LE_ADV_OPT_FILTER_SCAN_REQ</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">6</span><span class="p">),</span>
<span class="cm">/** Use whitelist to filter devices that can connect. */</span>
<span class="n">BT_LE_ADV_OPT_FILTER_CONN</span> <span class="o">=</span> <span class="n">BIT</span><span class="p">(</span><span class="mi">7</span><span class="p">),</span>
<span class="p">};</span>
</pre></div>
</div>
<p>如果需要发送一个广播包,配置可以如下:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">param</span><span class="p">.</span><span class="n">id</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">param</span><span class="p">.</span><span class="n">options</span> <span class="o">=</span> <span class="p">(</span><span class="n">BT_LE_ADV_OPT_CONNECTABLE</span> <span class="o">|</span> <span class="n">BT_LE_ADV_OPT_USE_NAME</span> <span class="o">|</span> <span class="n">BT_LE_ADV_OPT_ONE_TIME</span><span class="p">);</span>
<span class="n">param</span><span class="p">.</span><span class="n">interval_min</span> <span class="o">=</span> <span class="mh">0x00a0</span><span class="p">;</span>
<span class="n">param</span><span class="p">.</span><span class="n">interval_max</span> <span class="o">=</span> <span class="mh">0x00f0</span><span class="p">;</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">bt_data</span></code>数据结构:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">bt_data</span> <span class="p">{</span>
<span class="n">u8_t</span> <span class="n">type</span><span class="p">;</span>
<span class="n">u8_t</span> <span class="n">data_len</span><span class="p">;</span>
<span class="k">const</span> <span class="n">u8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
<p>此数据结构用来填充广播包中的数据,具体的数据包类型可以参考如下:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">Service</span> <span class="n">UUID</span>
<span class="n">Local</span> <span class="n">Name</span>
<span class="n">Flags</span>
<span class="n">Manufacturer</span> <span class="n">Specific</span> <span class="n">Data</span>
<span class="n">TX</span> <span class="n">Power</span> <span class="n">Level</span>
<span class="n">Secure</span> <span class="n">Simple</span> <span class="n">Pairing</span> <span class="n">OOB</span>
<span class="n">Security</span> <span class="n">Manager</span> <span class="n">OOB</span>
<span class="n">Security</span> <span class="n">Manager</span> <span class="n">TK</span> <span class="n">Value</span>
<span class="n">Slave</span> <span class="n">Connection</span> <span class="n">Interval</span> <span class="n">Range</span>
<span class="n">Service</span> <span class="n">Solicitation</span>
<span class="n">Service</span> <span class="n">Data</span>
<span class="n">Appearance</span>
<span class="n">Public</span> <span class="n">Target</span> <span class="n">Address</span>
<span class="n">Random</span> <span class="n">Target</span> <span class="n">Address</span>
<span class="n">Advertising</span> <span class="n">Interval</span>
<span class="n">LE</span> <span class="n">Bluetooth</span> <span class="n">Device</span> <span class="n">Address</span>
<span class="n">LE</span> <span class="n">Role</span>
<span class="n">Uniform</span> <span class="n">Resource</span> <span class="n">Identifier</span>
<span class="n">LE</span> <span class="n">Supported</span> <span class="n">Features</span>
<span class="n">Channel</span> <span class="n">Map</span> <span class="n">Update</span> <span class="n">Indication</span>
</pre></div>
</div>
<p>用该数据结构配置一个广播包数据,如下所示:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">bt_data</span> <span class="n">ad_discov</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
<span class="n">BT_DATA_BYTES</span><span class="p">(</span><span class="n">BT_DATA_FLAGS</span><span class="p">,</span> <span class="p">(</span><span class="n">BT_LE_AD_GENERAL</span> <span class="o">|</span> <span class="n">BT_LE_AD_NO_BREDR</span><span class="p">)),</span>
<span class="n">BT_DATA</span><span class="p">(</span><span class="n">BT_DATA_NAME_COMPLETE</span><span class="p">,</span> <span class="s">&quot;BL602-BLE-DEV&quot;</span><span class="p">,</span> <span class="mi">13</span><span class="p">),</span>
<span class="p">};</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">bt_le_scan_param</span></code>数据结构:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/** LE scan parameters */</span>
<span class="k">struct</span> <span class="n">bt_le_scan_param</span> <span class="p">{</span>
<span class="cm">/** Scan type (BT_LE_SCAN_TYPE_ACTIVE or BT_LE_SCAN_TYPE_PASSIVE) */</span>
<span class="n">u8_t</span> <span class="n">type</span><span class="p">;</span>
<span class="cm">/** Bit-field of scanning filter options. */</span>
<span class="n">u8_t</span> <span class="n">filter_dup</span><span class="p">;</span>
<span class="cm">/** Scan interval (N * 0.625 ms) */</span>
<span class="n">u16_t</span> <span class="n">interval</span><span class="p">;</span>
<span class="cm">/** Scan window (N * 0.625 ms) */</span>
<span class="n">u16_t</span> <span class="n">window</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
<p>此数据结构用来填充扫描参数,
type为扫描类型有2种类型BT_LE_SCAN_TYPE_ACTIVE0x01、BT_LE_SCAN_TYPE_PASSIVE(0x00)。
filter_dup0x00,除定向广告外接受所有广播和扫描响应0x01,只接收白名单列表中设备的广播和扫描响应。
interval扫描间隙。
window扫描窗口。</p>
<p>如果开启扫描请求,可以配置如下:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">scan_param</span><span class="p">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">BT_LE_SCAN_TYPE_PASSIVE</span>
<span class="n">scan_param</span><span class="p">.</span><span class="n">filter_dup</span> <span class="o">=</span> <span class="mh">0x00</span>
<span class="n">interval</span><span class="o">=</span><span class="n">BT_GAP_SCAN_SLOW_INTERVAL_1</span>
<span class="n">window</span><span class="o">=</span><span class="n">BT_GAP_SCAN_SLOW_WINDOW_1</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">bt_le_conn_param</span></code>数据结构:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/** Connection parameters for LE connections */</span>
<span class="k">struct</span> <span class="n">bt_le_conn_param</span> <span class="p">{</span>
<span class="n">u16_t</span> <span class="n">interval_min</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">interval_max</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">latency</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">timeout</span><span class="p">;</span>
<span class="cp">#if defined(CONFIG_BT_STACK_PTS)</span>
<span class="n">u8_t</span> <span class="n">own_address_type</span><span class="p">;</span>
<span class="cp">#endif</span>
<span class="p">};</span>
</pre></div>
</div>
<p>此数据结构用来填充连接参数interval_min连接间隙最少值0x0018interval_max连接间隙最大值(0x0028)
latency指定为连接事件数的连接允许的最大从延迟。
timeout连接超时时间。</p>
<p>配置该数据结构,如下:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span>interval_min=BT_GAP_INIT_CONN_INT_MIN0x0018
interval_max=BT_GAP_INIT_CONN_INT_MAX(0x0028)
latency=0
timeout=400
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">bt_conn</span></code>数据结构:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">bt_conn</span> <span class="p">{</span>
<span class="n">u16_t</span> <span class="n">handle</span><span class="p">;</span>
<span class="n">u8_t</span> <span class="n">type</span><span class="p">;</span>
<span class="n">u8_t</span> <span class="n">role</span><span class="p">;</span>
<span class="n">ATOMIC_DEFINE</span><span class="p">(</span><span class="n">flags</span><span class="p">,</span> <span class="n">BT_CONN_NUM_FLAGS</span><span class="p">);</span>
<span class="cm">/* Which local identity address this connection uses */</span>
<span class="n">u8_t</span> <span class="n">id</span><span class="p">;</span>
<span class="cp">#if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_BREDR)</span>
<span class="n">bt_security_t</span> <span class="n">sec_level</span><span class="p">;</span>
<span class="n">bt_security_t</span> <span class="n">required_sec_level</span><span class="p">;</span>
<span class="n">u8_t</span> <span class="n">encrypt</span><span class="p">;</span>
<span class="cp">#endif </span><span class="cm">/* CONFIG_BT_SMP || CONFIG_BT_BREDR */</span><span class="cp"></span>
<span class="cm">/* Connection error or reason for disconnect */</span>
<span class="n">u8_t</span> <span class="n">err</span><span class="p">;</span>
<span class="n">bt_conn_state_t</span> <span class="n">state</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">rx_len</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">net_buf</span> <span class="o">*</span><span class="n">rx</span><span class="p">;</span>
<span class="cm">/* Sent but not acknowledged TX packets with a callback */</span>
<span class="n">sys_slist_t</span> <span class="n">tx_pending</span><span class="p">;</span>
<span class="cm">/* Sent but not acknowledged TX packets without a callback before</span>
<span class="cm"> * the next packet (if any) in tx_pending.</span>
<span class="cm"> */</span>
<span class="n">u32_t</span> <span class="n">pending_no_cb</span><span class="p">;</span>
<span class="cm">/* Completed TX for which we need to call the callback */</span>
<span class="n">sys_slist_t</span> <span class="n">tx_complete</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">k_work</span> <span class="n">tx_complete_work</span><span class="p">;</span>
<span class="cm">/* Queue for outgoing ACL data */</span>
<span class="k">struct</span> <span class="n">k_fifo</span> <span class="n">tx_queue</span><span class="p">;</span>
<span class="cm">/* Active L2CAP channels */</span>
<span class="n">sys_slist_t</span> <span class="n">channels</span><span class="p">;</span>
<span class="n">atomic_t</span> <span class="n">ref</span><span class="p">;</span>
<span class="cm">/* Delayed work for connection update and other deferred tasks */</span>
<span class="k">struct</span> <span class="n">k_delayed_work</span> <span class="n">update_work</span><span class="p">;</span>
<span class="k">union</span> <span class="p">{</span>
<span class="k">struct</span> <span class="n">bt_conn_le</span> <span class="n">le</span><span class="p">;</span>
<span class="cp">#if defined(CONFIG_BT_BREDR)</span>
<span class="k">struct</span> <span class="n">bt_conn_br</span> <span class="n">br</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">bt_conn_sco</span> <span class="n">sco</span><span class="p">;</span>
<span class="cp">#endif</span>
<span class="p">};</span>
<span class="cp">#if defined(CONFIG_BT_REMOTE_VERSION)</span>
<span class="k">struct</span> <span class="n">bt_conn_rv</span> <span class="p">{</span>
<span class="n">u8_t</span> <span class="n">version</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">manufacturer</span><span class="p">;</span>
<span class="n">u16_t</span> <span class="n">subversion</span><span class="p">;</span>
<span class="p">}</span> <span class="n">rv</span><span class="p">;</span>
<span class="cp">#endif</span>
<span class="p">};</span>
</pre></div>
</div>
<p>此数据结构为当前连接数据结构其中包括BLE蓝牙连接相关的参数连接成功后该数据结构可以被用户调用。</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../../../API/sys/cronalarms.html" class="btn btn-neutral float-right" title="1. cronalarms" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../mesh/mesh.html" class="btn btn-neutral float-left" title="16. Mesh" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>16. Mesh &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="17. BLE" href="../ble_stack/ble_stack.html" />
<link rel="prev" title="15. Provision_WiFi" href="../provision_WiFi/provision_WiFi.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">16. </span>Mesh</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/BLE/mesh/mesh.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="mesh">
<h1><span class="section-number">16. </span>Mesh<a class="headerlink" href="#mesh" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../ble_stack/ble_stack.html" class="btn btn-neutral float-right" title="17. BLE" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../provision_WiFi/provision_WiFi.html" class="btn btn-neutral float-left" title="15. Provision_WiFi" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>15. Provision_WiFi &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="16. Mesh" href="../mesh/mesh.html" />
<link rel="prev" title="14. TLS" href="../../Network/tls/tls.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">15. </span>Provision_WiFi</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/BLE/provision_WiFi/provision_WiFi.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="provision-wifi">
<h1><span class="section-number">15. </span>Provision_WiFi<a class="headerlink" href="#provision-wifi" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../mesh/mesh.html" class="btn btn-neutral float-right" title="16. Mesh" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../../Network/tls/tls.html" class="btn btn-neutral float-left" title="14. TLS" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,305 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3. cli &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="4. GPIO" href="../Hal_drv/gpio.html" />
<link rel="prev" title="2. helper" href="helper.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="helper.html">2. helper</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">3. cli</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">3.1. 概述</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">3.2. 示例代码</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">3. </span>cli</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Components/Command_line/aos_cli.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="cli">
<h1><span class="section-number">3. </span>cli<a class="headerlink" href="#cli" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">3.1. </span>概述<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>linux下有强大的shell工具可以让用户和片上系统进行交互而在传统的单片机系统中用户往往需要自行实现一套类似的交互工具。AliOS-Things原生带有一套名为clicommand-line
interface的命令行交互工具在提供基本的系统交互命令的基础上也支持用户自定义命令。我们已经将其移植到我们到系统中
同时对其做出了很多完善, 下面将介绍如何使用cli命令并执行</p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">3.2. </span>示例代码<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>用户在只需在程序中调用<code class="docutils literal notranslate"><span class="pre">test_cli_init()</span></code>接口之后就可以在shell中<code class="docutils literal notranslate"><span class="pre">test</span></code>,就可以打印<code class="docutils literal notranslate"><span class="pre">hello</span> <span class="pre">world.</span></code>如下图所示</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#</span>
<span class="c1">#</span>
<span class="c1"># test</span>
<span class="n">hello</span> <span class="n">world</span><span class="o">.</span>
<span class="c1">#</span>
<span class="c1">#</span>
</pre></div>
</div>
<p>还有很多常用命令,请参考<a href="#id3"><span class="problematic" id="id4">`常用命令&lt;../helper/helper.html&gt;`_</span></a></p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="kt">void</span> <span class="nf">cmd_test_func</span><span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="kt">int</span> <span class="n">len</span><span class="p">,</span> <span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;hello world.</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">const</span> <span class="k">static</span> <span class="k">struct</span> <span class="n">cli_command</span> <span class="n">cmds_user</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
<span class="p">{</span><span class="s">&quot;test&quot;</span><span class="p">,</span> <span class="s">&quot;it&#39;s test func &quot;</span><span class="p">,</span> <span class="n">cmd_test_func</span><span class="p">}</span>
<span class="p">};</span>
<span class="kt">int</span> <span class="nf">test_cli_init</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">return</span> <span class="n">aos_cli_register_commands</span><span class="p">(</span><span class="n">cmds_user</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">cmds_user</span><span class="p">)</span><span class="o">/</span><span class="k">sizeof</span><span class="p">(</span><span class="n">cmds_user</span><span class="p">[</span><span class="mi">0</span><span class="p">]));</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../Hal_drv/gpio.html" class="btn btn-neutral float-right" title="4. GPIO" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="helper.html" class="btn btn-neutral float-left" title="2. helper" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,560 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2. helper &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="3. cli" href="aos_cli.html" />
<link rel="prev" title="1. arch" href="../arch.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../arch.html">1. arch</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. helper</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#cli">2.1. cli 命令表</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id1">2.2. 常用命令</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">2. </span>helper</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Components/Command_line/helper.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="helper">
<h1><span class="section-number">2. </span>helper<a class="headerlink" href="#helper" title="永久链接至标题"></a></h1>
<p>这里主要介绍现阶段支持到部分命令,包括系统命令和用户命令,当然有的命令板子不一定支持,可以通过<code class="docutils literal notranslate"><span class="pre">help</span></code>查看其支持到命令,更多的命令请参考源码或者自行添加</p>
<div class="section" id="cli">
<h2><span class="section-number">2.1. </span>cli 命令表<a class="headerlink" href="#cli" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p><strong>系统命令</strong></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 34%" />
<col style="width: 66%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>name</p></th>
<th class="head"><p>help</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>help</p></td>
<td><p>print this</p></td>
</tr>
<tr class="row-odd"><td><p>p</p></td>
<td><p>print memory</p></td>
</tr>
<tr class="row-even"><td><p>m</p></td>
<td><p>modify memory</p></td>
</tr>
<tr class="row-odd"><td><p>cho</p></td>
<td><p>echo for command</p></td>
</tr>
<tr class="row-even"><td><p>xit</p></td>
<td><p>close CLI</p></td>
</tr>
<tr class="row-odd"><td><p>evname</p></td>
<td><p>print device name</p></td>
</tr>
<tr class="row-even"><td><p>ysver</p></td>
<td><p>system version</p></td>
</tr>
<tr class="row-odd"><td><p>eboot</p></td>
<td><p>reboot system</p></td>
</tr>
<tr class="row-even"><td><p>oweroff</p></td>
<td><p>poweroff system</p></td>
</tr>
<tr class="row-odd"><td><p>ime</p></td>
<td><p>system time</p></td>
</tr>
<tr class="row-even"><td><p>ta</p></td>
<td><p>system ota</p></td>
</tr>
<tr class="row-odd"><td><p>s</p></td>
<td><p>thread dump</p></td>
</tr>
</tbody>
</table>
<ul class="simple">
<li><p><strong>用户命令</strong></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 32%" />
<col style="width: 68%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>name</p></th>
<th class="head"><p>help</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>test_trng</p></td>
<td><p>Test TRNG</p></td>
</tr>
<tr class="row-odd"><td><p>tcpc</p></td>
<td><p>create a tcpc for in a new task</p></td>
</tr>
<tr class="row-even"><td><p>ipc</p></td>
<td><p>iperf TCP client</p></td>
</tr>
<tr class="row-odd"><td><p>ips</p></td>
<td><p>iperf TCP server</p></td>
</tr>
<tr class="row-even"><td><p>ipu</p></td>
<td><p>iperf UDP client</p></td>
</tr>
<tr class="row-odd"><td><p>psm_set</p></td>
<td><p>psm set</p></td>
</tr>
<tr class="row-even"><td><p>psm_unset</p></td>
<td><p>psm unset</p></td>
</tr>
<tr class="row-odd"><td><p>psm_get</p></td>
<td><p>psm get</p></td>
</tr>
<tr class="row-even"><td><p>psm_dump</p></td>
<td><p>psm dump</p></td>
</tr>
<tr class="row-odd"><td><p>psm_erase</p></td>
<td><p>psm dump</p></td>
</tr>
<tr class="row-even"><td><p>amr</p></td>
<td><p>amr encode test</p></td>
</tr>
<tr class="row-odd"><td><p>test_sdh</p></td>
<td><p>test SDH based on fatfs</p></td>
</tr>
<tr class="row-even"><td><p>http</p></td>
<td><p>http client download test</p></td>
</tr>
<tr class="row-odd"><td><p>mjpeg_start</p></td>
<td><p>start mjpeg tasks</p></td>
</tr>
<tr class="row-even"><td><p>msg_set</p></td>
<td><p>message set</p></td>
</tr>
<tr class="row-odd"><td><p>msg_get</p></td>
<td><p>message get</p></td>
</tr>
<tr class="row-even"><td><p>msg_dump</p></td>
<td><p>message dump</p></td>
</tr>
<tr class="row-odd"><td><p>msg_reset</p></td>
<td><p>erase all message regions</p></td>
</tr>
<tr class="row-even"><td><p>msg_set_t1</p></td>
<td><p>message set test 1</p></td>
</tr>
<tr class="row-odd"><td><p>rf_dump</p></td>
<td><p>rf dump</p></td>
</tr>
<tr class="row-even"><td><p>wifi_ap_start</p></td>
<td><p>start AP mode</p></td>
</tr>
<tr class="row-odd"><td><p>wifi_scan</p></td>
<td><p>wifi scan</p></td>
</tr>
<tr class="row-even"><td><p>wifi_mon</p></td>
<td><p>wifi monitor</p></td>
</tr>
<tr class="row-odd"><td><p>wifi_raw_send: wifi</p></td>
<td><p>raw send test</p></td>
</tr>
<tr class="row-even"><td><p>wifi_sta_disconnect</p></td>
<td><p>wifi station disconnect</p></td>
</tr>
<tr class="row-odd"><td><p>wifi_sta_connect</p></td>
<td><p>wifi station connect</p></td>
</tr>
<tr class="row-even"><td><p>airkiss</p></td>
<td><p>airkiss</p></td>
</tr>
<tr class="row-odd"><td><p>rc_fix_en</p></td>
<td><p>wifi rate control fixed rate enable</p></td>
</tr>
<tr class="row-even"><td><p>rc_fix_dis</p></td>
<td><p>wifi rate control fixed rate diable</p></td>
</tr>
<tr class="row-odd"><td><p>wifi_capcode</p></td>
<td><p>capcode utils, wifi_capcode [cap_in] [cap_out]</p></td>
</tr>
<tr class="row-even"><td><p>blfdt</p></td>
<td><p>blfdt</p></td>
</tr>
<tr class="row-odd"><td><p>tc_uart</p></td>
<td><p>bl test uart</p></td>
</tr>
<tr class="row-even"><td><p>audio_play_ram</p></td>
<td><p>play sound fm ram</p></td>
</tr>
<tr class="row-odd"><td><p>audio_config_es8311</p></td>
<td><p>config ES831</p></td>
</tr>
<tr class="row-even"><td><p>audio_mp3</p></td>
<td><p>play sou mp3</p></td>
</tr>
<tr class="row-odd"><td><p>audio_test</p></td>
<td><p>play test</p></td>
</tr>
<tr class="row-even"><td><p>audio_play</p></td>
<td><p>audio play</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="id1">
<h2><span class="section-number">2.2. </span>常用命令<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul>
<li><p><strong>查看支持的所有命令</strong></p>
<p>可以通过按键<code class="docutils literal notranslate"><span class="pre">TAB</span></code>查看,或者命令输入<code class="docutils literal notranslate"><span class="pre">help</span></code>如下:</p>
<p><strong>#</strong> <code class="docutils literal notranslate"><span class="pre">help</span></code></p>
</li>
<li><p><strong>配置wifi的临时ssid和passwd重启恢复使用默认值</strong></p>
<p>例如配置wifi:<code class="docutils literal notranslate"><span class="pre">bl_wifi_005</span></code>和密码:<code class="docutils literal notranslate"><span class="pre">123456789</span></code>
命令行输入如下命令:</p>
<p><strong>#</strong> <code class="docutils literal notranslate"><span class="pre">wifi_sta_connect</span> <span class="pre">bl_wifi_005</span> <span class="pre">123456789</span></code></p>
</li>
<li><p><strong>配置wifi的默认ssid和passwd</strong></p>
<p>例如配置wifi:<code class="docutils literal notranslate"><span class="pre">bl_wifi_005</span></code>和密码:<code class="docutils literal notranslate"><span class="pre">123456789</span></code>
命令行输入如下命令:</p>
<p><strong>#</strong> <code class="docutils literal notranslate"><span class="pre">psm_set</span> <span class="pre">conf_ap_ssid</span> <span class="pre">bl_wifi_005</span></code></p>
<p><strong>#</strong> <code class="docutils literal notranslate"><span class="pre">psm_set</span> <span class="pre">conf_ap_psk</span> <span class="pre">123456789</span></code></p>
</li>
<li><p><strong>启动AP</strong></p>
<p>使用<code class="docutils literal notranslate"><span class="pre">wifi_ap_start</span></code>命令可以启动AP但使用前需要使用<code class="docutils literal notranslate"><span class="pre">psm_erase</span></code>擦除STA相关配置信息并重启。启动的AP
SSID为<code class="docutils literal notranslate"><span class="pre">BL60X_uAP_</span></code>加上MAC地址的后3三个字节的HEX串密码为<code class="docutils literal notranslate"><span class="pre">bouffalolab</span></code></p>
</li>
<li><p><strong>系统重启</strong></p>
<p><strong>#</strong> <code class="docutils literal notranslate"><span class="pre">reboot</span></code></p>
</li>
<li><p><strong>播音与录音</strong></p>
<p>该模块需要硬件有SD卡支持暂时仅支持 pcm 格式文件,其他格式待更新</p>
<ul>
<li><p>配置音频的采样频率</p>
<p><strong>#</strong> audio_config 11p025</p>
<p>如果没有参数默认使用16Khz支持
8k、16k、24k、32k、48k、11p025、22p05、44p1
采样频率(11.025khz用11p025表示其他类似),例如这里配置采样频率为
11.025Khz</p>
</li>
<li><p>录音</p>
<p><strong>#</strong> audio_record test.pcm</p>
<p>如果没有参数默认录音放在sd卡根目录中录音文件名record.pcm这里配置文件名test.pcm即存放在在根目录test.pcm文件中同时默认录音10S左右</p>
</li>
<li><p>放音</p>
<p><strong>#</strong> audio_play test.pcm</p>
<p>如果没有参数默认使用sd卡根目录中录音文件名record.pcm这里配置文件名test.pcm即播放SD卡中的test.pcm音频</p>
</li>
</ul>
</li>
<li><p><strong>图传</strong></p>
<p>使用<code class="docutils literal notranslate"><span class="pre">mjpeg_start</span></code>命令可以启动图传的相关任务</p>
</li>
<li><p><strong>保存图片至SD卡</strong></p>
<p>该模块需要硬件有SD卡支持暂时仅支持 jpeg 格式文件,其他格式待更新</p>
<ul>
<li><p>配置mjpeg图片的quality</p>
<p><strong>#</strong> mjpegsd_config 50</p>
<p>暂时支持6种 quality 5、10、25、50、75、100</p>
</li>
<li><p>启动保存图片</p>
<p><strong>#</strong> mjpegsd_start</p>
<p>启动保存图片默认保存50帧数据</p>
</li>
<li><p><strong>注意</strong></p>
<ul class="simple">
<li><p>如上示例命令会在SD卡根目录保存50张
0.jpeg、1.jpeg...49.jpeg图片</p></li>
</ul>
</li>
</ul>
</li>
<li><p><strong>保存AVI至SD卡</strong></p>
<p>该模块需要硬件有SD卡支持暂时仅支持 AIV 格式文件,其他格式待更新</p>
<ul>
<li><p>配置mjpeg图片的quality</p>
<p><strong>#</strong> avisd_config 50 bl_avi_q50.avi</p>
<p>暂时支持6种 quality 5、10、25、50、75、100</p>
</li>
<li><p>启动保存avi</p>
<p><strong>#</strong> avisd_start</p>
<p>启动保存avi默认保存750帧图片</p>
</li>
<li><p><strong>注意</strong></p>
<ul class="simple">
<li><p>如上示例命令会在SD卡根目录保存一个&quot;bl_avi_q50.avi&quot;文件</p></li>
<li><p>内存卡建议格式化为分配单元64KB文件系统FAT32</p></li>
<li><p>avisd_start之后如果想修改quality需重启一下开发板</p></li>
<li><p>该模块需要有psram、camera支持需要开启使能PSRAM、camera相关开关</p></li>
</ul>
</li>
</ul>
</li>
<li><p><strong>二维码配网</strong></p>
<p>该模块是通过手机分享热点的二维码连接WiFi</p>
<ul>
<li><p>启动命令</p>
<p><code class="docutils literal notranslate"><span class="pre">qrcode_connect_wifi</span></code></p>
<p>输入命令后摄像头会初始化然后开始循环识别二维码</p>
</li>
<li><p><strong>注意</strong></p>
<ul class="simple">
<li><p>成功识别的到二维码后,会先打印二维码信息,如果不是分享热点的二维码会继续扫描</p></li>
<li><p>支持SSID为中文但是要求unicode编码规则为UTF-8</p></li>
<li><p>支持开放热点</p></li>
<li><p>该模块需要psram、camera支持需要开启使能PSRAM、camera相关开关</p></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="aos_cli.html" class="btn btn-neutral float-right" title="3. cli" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../arch.html" class="btn btn-neutral float-left" title="1. arch" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4. GPIO &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="5. BLOOP" href="../Middleware/bloop/bloop.html" />
<link rel="prev" title="3. cli" href="../Command_line/aos_cli.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">4. </span>GPIO</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Components/Hal_drv/gpio.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="gpio">
<h1><span class="section-number">4. </span>GPIO<a class="headerlink" href="#gpio" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../Middleware/bloop/bloop.html" class="btn btn-neutral float-right" title="5. BLOOP" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../Command_line/aos_cli.html" class="btn btn-neutral float-left" title="3. cli" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>5. BLOOP &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="6. BLSYNC" href="../blsync/blsync.html" />
<link rel="prev" title="4. GPIO" href="../../Hal_drv/gpio.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">5. </span>BLOOP</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/bloop/bloop.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="bloop">
<h1><span class="section-number">5. </span>BLOOP<a class="headerlink" href="#bloop" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../blsync/blsync.html" class="btn btn-neutral float-right" title="6. BLSYNC" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../../Hal_drv/gpio.html" class="btn btn-neutral float-left" title="4. GPIO" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>6. BLSYNC &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="7. device tree" href="../dts/devicetree.html" />
<link rel="prev" title="5. BLOOP" href="../bloop/bloop.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">6. </span>BLSYNC</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/blsync/blsync.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="blsync">
<h1><span class="section-number">6. </span>BLSYNC<a class="headerlink" href="#blsync" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../dts/devicetree.html" class="btn btn-neutral float-right" title="7. device tree" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../bloop/bloop.html" class="btn btn-neutral float-left" title="5. BLOOP" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,391 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>7. device tree &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="8. blog" href="../log/blog.html" />
<link rel="prev" title="6. BLSYNC" href="../blsync/blsync.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">7. device tree</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">7.1. 一、 介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dts-dtb">7.2. 二、 dts 和 dtb 相互转换</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">7.3. 三、 device tree 语法格式</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">7.4. 四、 device tree 模块配置</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id4">7.4.1. 串口配置</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">7. </span>device tree</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/dts/devicetree.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="device-tree">
<h1><span class="section-number">7. </span>device tree<a class="headerlink" href="#device-tree" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">7.1. </span>一、 介绍<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul>
<li><p>调试平台</p>
<p><code class="docutils literal notranslate"><span class="pre">ubuntu18.04</span></code></p>
</li>
</ul>
</div>
<div class="section" id="dts-dtb">
<h2><span class="section-number">7.2. </span>二、 dts 和 dtb 相互转换<a class="headerlink" href="#dts-dtb" title="永久链接至标题"></a></h2>
<ul>
<li><p>device tree 调试工具</p>
<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">device-tree-compiler</span></code></p>
</li>
<li><p>dts 转 dtb</p>
<p><code class="docutils literal notranslate"><span class="pre">dtc</span> <span class="pre">-I</span> <span class="pre">dts</span> <span class="pre">-O</span> <span class="pre">dtb</span> <span class="pre">-o</span> <span class="pre">*.dtb</span> <span class="pre">*.dts</span></code></p>
</li>
<li><p>dtb 转 dts</p>
<p><code class="docutils literal notranslate"><span class="pre">dtc</span> <span class="pre">-I</span> <span class="pre">dtb</span> <span class="pre">-O</span> <span class="pre">dts</span> <span class="pre">*.dtb</span> <span class="pre">-o</span> <span class="pre">*.dts</span></code></p>
</li>
<li><p>dtb 转数组到数组 *.c</p>
<p><code class="docutils literal notranslate"><span class="pre">xxd</span> <span class="pre">-i</span> <span class="pre">*.dtb</span> <span class="pre">./*.c</span></code></p>
</li>
</ul>
</div>
<div class="section" id="id2">
<h2><span class="section-number">7.3. </span>三、 device tree 语法格式<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul>
<li><p>*.dts 文件开头必须采用如下所示开头
<code class="docutils literal notranslate"><span class="pre">/dts-v1/;</span>&#160;&#160;&#160;&#160; <span class="pre">//</span> <span class="pre">version:</span> <span class="pre">17</span>&#160;&#160;&#160;&#160; <span class="pre">//</span> <span class="pre">last_comp_version:</span> <span class="pre">16</span>&#160;&#160;&#160;&#160; <span class="pre">//</span> <span class="pre">boot_cpuid_phys:</span> <span class="pre">0x0</span></code></p></li>
<li><p>16进制数组表示方法如下(注:字节间必须有一个空格,且暂时不支持换行)</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mac</span> <span class="p">{</span>
<span class="n">sta_mac_addr</span> <span class="o">=</span> <span class="p">[</span><span class="n">C8</span> <span class="mi">43</span> <span class="mi">57</span> <span class="mi">82</span> <span class="mi">73</span> <span class="mi">40</span><span class="p">];</span>
<span class="n">ap_mac_addr</span> <span class="o">=</span> <span class="p">[</span><span class="n">C8</span> <span class="mi">43</span> <span class="mi">57</span> <span class="mi">82</span> <span class="mi">73</span> <span class="mi">02</span><span class="p">];</span>
<span class="p">};</span>
</pre></div>
</div>
</li>
<li><p>字符串或者字符串数据表示方法如下</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">model</span> <span class="o">=</span> <span class="s2">&quot;bl bl602 AVB board&quot;</span><span class="p">;</span>
<span class="n">compatible</span> <span class="o">=</span> <span class="s2">&quot;bl,bl602-sample&quot;</span><span class="p">,</span> <span class="s2">&quot;bl,bl602-common&quot;</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p>32bit数据表示方法(可以使用16进制ox方式也可使用10进制方式字节间必须有一个空格且暂时不支持换行)</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pwr_table</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mh">0x4</span> <span class="mh">0x64</span><span class="o">&gt;</span>
<span class="n">pwr_table</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">4</span> <span class="mi">100</span><span class="o">&gt;</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="id3">
<h2><span class="section-number">7.4. </span>四、 device tree 模块配置<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<div class="section" id="id4">
<h3><span class="section-number">7.4.1. </span>串口配置<a class="headerlink" href="#id4" title="永久链接至标题"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">串口暂时仅支持配置以下功能</span>
</pre></div>
</div>
<ul>
<li><p>使能串口</p>
<p><code class="docutils literal notranslate"><span class="pre">status</span> <span class="pre">=</span> <span class="pre">&quot;okay&quot;;</span></code></p>
</li>
<li><p>关闭串口</p>
<p>关闭串口时,余下其他引脚、波特率等配置均无效,不会初始化相关硬件</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">status</span> <span class="o">=</span> <span class="s2">&quot;disable&quot;</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p>配置引脚</p>
<p>暂时不支持配置cts和rts相关功能故暂时<code class="docutils literal notranslate"><span class="pre">feature</span></code>中rts和cts均为<code class="docutils literal notranslate"><span class="pre">disable</span></code>。如果使用了串的tx和rx<code class="docutils literal notranslate"><span class="pre">feature</span></code>中到tx和rx需要配置为<code class="docutils literal notranslate"><span class="pre">okay</span></code><code class="docutils literal notranslate"><span class="pre">pin</span></code>中的tx和rx需要选择相关引脚。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pin</span> <span class="p">{</span>
<span class="n">rx</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">7</span><span class="o">&gt;</span><span class="p">;</span>
<span class="n">tx</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">16</span><span class="o">&gt;</span><span class="p">;</span>
<span class="p">};</span>
<span class="n">feature</span> <span class="p">{</span>
<span class="n">rts</span> <span class="o">=</span> <span class="s2">&quot;disable&quot;</span><span class="p">;</span>
<span class="n">cts</span> <span class="o">=</span> <span class="s2">&quot;disable&quot;</span><span class="p">;</span>
<span class="n">rx</span> <span class="o">=</span> <span class="s2">&quot;okay&quot;</span><span class="p">;</span>
<span class="n">tx</span> <span class="o">=</span> <span class="s2">&quot;okay&quot;</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>
</div>
</li>
<li><p>配置波特率</p>
<p>配置波特率参考如下,最大支持 <code class="docutils literal notranslate"><span class="pre">2000000</span> <span class="pre">bps</span></code>这里以<code class="docutils literal notranslate"><span class="pre">9600</span></code>为例</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">baudrate</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">9600</span><span class="o">&gt;</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p>配置id号</p>
<p>配置id参考如下这里以<code class="docutils literal notranslate"><span class="pre">&lt;0&gt;</span></code>为例</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">0</span><span class="o">&gt;</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p>配置设备名</p>
<p>目前串口设备名为/dev/ttyS<em>,至于</em>为当前串口id号目前调试口使用
/dev/ttyS0</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pin</span> <span class="p">{</span>
<span class="n">rx</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">7</span><span class="o">&gt;</span><span class="p">;</span>
<span class="n">tx</span> <span class="o">=</span> <span class="o">&lt;</span><span class="mi">16</span><span class="o">&gt;</span><span class="p">;</span>
<span class="p">};</span>
<span class="n">feature</span> <span class="p">{</span>
<span class="n">rts</span> <span class="o">=</span> <span class="s2">&quot;disable&quot;</span><span class="p">;</span>
<span class="n">cts</span> <span class="o">=</span> <span class="s2">&quot;disable&quot;</span><span class="p">;</span>
<span class="n">rx</span> <span class="o">=</span> <span class="s2">&quot;okay&quot;</span><span class="p">;</span>
<span class="n">tx</span> <span class="o">=</span> <span class="s2">&quot;okay&quot;</span><span class="p">;</span>
<span class="p">};</span>
<span class="n">path</span> <span class="o">=</span> <span class="s2">&quot;/dev/ttyS0&quot;</span><span class="p">;</span>
</pre></div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../log/blog.html" class="btn btn-neutral float-right" title="8. blog" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../blsync/blsync.html" class="btn btn-neutral float-left" title="6. BLSYNC" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,360 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>8. blog &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="9. Security" href="../security/security.html" />
<link rel="prev" title="7. device tree" href="../dts/devicetree.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">8. blog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">8.1. 概述</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">8.2. 功能介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="#log">8.3. log等级说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">8.4. 使用方法</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">8.5. 总结</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">8. </span>blog</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/log/blog.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="blog">
<h1><span class="section-number">8. </span>blog<a class="headerlink" href="#blog" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">8.1. </span>概述<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>blog 是一款超轻量级的日志组件,非常适合对资源敏感的软件项目.</p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">8.2. </span>功能介绍<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>blog
将log简化成3类分别是组件、文件、私有log且分别支持软件动态修改、宏彻底关闭方案不占用rom。下文统称动态修改为软开关宏彻底关闭方案为静态开关。</p>
<ul class="simple">
<li><p>组件log管理 该log优先级最高如下的文件log和私有log均受此开关的束缚</p></li>
<li><p>文件log管理
该log优先级中如下的私有log均受此开关的束缚且文件log受到组件log的管理。</p></li>
<li><p>私有log管理 该log优先级最低受组件log和文件log管理</p></li>
</ul>
</div>
<div class="section" id="log">
<h2><span class="section-number">8.3. </span>log等级说明<a class="headerlink" href="#log" title="永久链接至标题"></a></h2>
<p>按照等级高低分别如下其中all最低即所有log均输出</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>all : 所有log均输出其实等同于all
debug : debug及以上
info : info及以上
warn : warn及以上
error : error及以上
assert : assert及以上
never: 所有log均不输出其实等同于assert
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2><span class="section-number">8.4. </span>使用方法<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>包含必要的头文件
<code class="docutils literal notranslate"><span class="pre">#include</span> <span class="pre">&lt;blog.h&gt;</span></code>然后分别设置组件log、文件log、私有log。</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;blog.h&gt;</span><span class="cp"></span>
<span class="n">BLOG_DECLARE</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">);</span>
<span class="kt">void</span> <span class="nf">func</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">blog_debug</span><span class="p">(</span><span class="s">&quot;blog_testc2 debug</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_info</span><span class="p">(</span><span class="s">&quot;blog_testc2 info</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_warn</span><span class="p">(</span><span class="s">&quot;blog_testc2 warn</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_error</span><span class="p">(</span><span class="s">&quot;blog_testc2 error</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_assert</span><span class="p">(</span><span class="s">&quot;blog_testc2 assert</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_debug_user</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">,</span><span class="s">&quot;blog_testc2 debug user</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_info_user</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">,</span><span class="s">&quot;blog_testc2 info user</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_warn_user</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">,</span><span class="s">&quot;blog_testc2 warn user</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_error_user</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">,</span><span class="s">&quot;blog_testc2 error user</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">blog_assert_user</span><span class="p">(</span><span class="n">blog_testc2</span><span class="p">,</span><span class="s">&quot;blog_testc2 assert user</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p>组件log开关</p>
<ul>
<li><p>静态开关 在相应的 proj_config.mk
文件目录下LOG_ENABLED_COMPONENTS配置上增加对应组件的名字
例如这里需要增加blog_testa blog_testb
blog_testc组件静态开关其他组件默认关闭
<code class="docutils literal notranslate"><span class="pre">LOG_ENABLED_COMPONENTS:=blog_testa</span> <span class="pre">blog_testb</span> <span class="pre">blog_testc</span></code></p></li>
<li><p>软件开关 通过输入如下命令来使能log输出等级 形如logset level
component_name例如 <code class="docutils literal notranslate"><span class="pre">blogset</span> <span class="pre">assert</span> <span class="pre">blog_testc</span></code></p></li>
</ul>
</li>
<li><p>文件log管理</p>
<ul>
<li><p>静态开关
在对应的*.c文件中加入此行代码注意不管是开或者关必须选择一种。
<code class="docutils literal notranslate"><span class="pre">默认就是开</span></code> <code class="docutils literal notranslate"><span class="pre">#define</span> <span class="pre">BLOG_HARD_DECLARE_DISABLE</span> <span class="pre">1</span>&#160;&#160;&#160; <span class="pre">//</span> <span class="pre"></span></code></p></li>
<li><p>软件开关 通过输入如下命令来使能log输出等级 形如logset level
component_name.file_name例如
<code class="docutils literal notranslate"><span class="pre">blogset</span> <span class="pre">info</span> <span class="pre">blog_testc.blog_testc2_full</span></code></p></li>
</ul>
</li>
<li><p>私有log管理</p>
<ul>
<li><p>静态开关 使用就增加BLOG_DECLARE(...),不用直接不增加此行即可。
<code class="docutils literal notranslate"><span class="pre">BLOG_DECLARE(blog_testc2);</span>&#160;&#160;&#160; <span class="pre">//</span> <span class="pre">打开,其中 &quot;blog_testc2&quot;为用户自定义</span></code></p></li>
<li><p>软件开关 通过输入如下命令来使能log输出等级 形如logset level
component_name.file_name.pri_name例如
<code class="docutils literal notranslate"><span class="pre">blogset</span> <span class="pre">debug</span> <span class="pre">blog_testc.blog_testc2_full.blog_testc2</span></code></p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="id4">
<h2><span class="section-number">8.5. </span>总结<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../security/security.html" class="btn btn-neutral float-right" title="9. Security" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../dts/devicetree.html" class="btn btn-neutral float-left" title="7. device tree" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>9. Security &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="10. AOS VFS" href="../vfs/vfs.html" />
<link rel="prev" title="8. blog" href="../log/blog.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">9. </span>Security</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/security/security.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="security">
<h1><span class="section-number">9. </span>Security<a class="headerlink" href="#security" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../vfs/vfs.html" class="btn btn-neutral float-right" title="10. AOS VFS" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../log/blog.html" class="btn btn-neutral float-left" title="8. blog" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,623 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>10. AOS VFS &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="11. yloop" href="../yloop/yloop.html" />
<link rel="prev" title="9. Security" href="../security/security.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">10. AOS VFS</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">10.1. 概要</a></li>
<li class="toctree-l2"><a class="reference internal" href="#vfs">10.2. VFS提供的标准接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">10.3. VFS的数据结构</a></li>
<li class="toctree-l2"><a class="reference internal" href="#aos-open">10.4. 以aos_open为例介绍其文件打开方式</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">10.5. 将驱动文件或者文件系统加载到VFS当中</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">10.6. 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">10.7. 总结</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">10. </span>AOS VFS</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/vfs/vfs.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="aos-vfs">
<h1><span class="section-number">10. </span>AOS VFS<a class="headerlink" href="#aos-vfs" title="永久链接至标题"></a></h1>
<ul class="simple">
<li><p><a class="reference internal" href="#id1">概要</a></p></li>
<li><p><a class="reference internal" href="#vfs">VFS提供的标准接口</a></p></li>
<li><p><a class="reference internal" href="#id2">VFS的数据结构</a></p></li>
<li><p><a class="reference internal" href="#aos-open">以aos_open为例介绍其文件打开方式</a></p></li>
<li><p><a class="reference internal" href="#id3">将驱动文件或者文件系统加载到VFS当中</a></p></li>
<li><p><a class="reference internal" href="#id4">示例代码</a></p></li>
<li><p><a class="reference internal" href="#id5">总结</a></p></li>
</ul>
<div class="section" id="id1">
<h2><span class="section-number">10.1. </span>概要<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>VFS存在的意义屏蔽掉底层文件系统的差异为应用层提供标准的系统调用接口。</p>
</div>
<div class="section" id="vfs">
<h2><span class="section-number">10.2. </span>VFS提供的标准接口<a class="headerlink" href="#vfs" title="永久链接至标题"></a></h2>
<p>基本通用的UNIX接口都已经实现了。之所以具有前缀<code class="docutils literal notranslate"><span class="pre">aos_</span></code>。是因为这些都是对外的接口在AliOS
Things的代码命名规则中规定所有的对外接口都需要加上前缀<code class="docutils literal notranslate"><span class="pre">aos_</span></code></p>
<p>aos_open</p>
<p>aos_close</p>
<p>aos_read</p>
<p>aos_write</p>
<p>aos_ioctl</p>
<p>aos_poll</p>
<p>aos_fcnt</p>
<p>aos_lseek</p>
<p>aos_sync</p>
<p>aos_stat</p>
<p>aos_unlink</p>
<p>aos_rename</p>
<p>aos_opendir</p>
<p>aos_closedir</p>
<p>aos_readdir</p>
<p>aos_mkdir</p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">10.3. </span>VFS的数据结构<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">inode_t</span></code>数据结构</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/* this structure represents inode for driver and fs*/</span>
<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
<span class="k">union</span> <span class="n">inode_ops_t</span> <span class="n">ops</span><span class="p">;</span> <span class="cm">/* inode operations */</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">i_arg</span><span class="p">;</span> <span class="cm">/* per inode private data */</span>
<span class="kt">char</span> <span class="o">*</span><span class="n">i_name</span><span class="p">;</span> <span class="cm">/* name of inode */</span>
<span class="kt">int</span> <span class="n">i_flags</span><span class="p">;</span> <span class="cm">/* flags for inode */</span>
<span class="kt">uint8_t</span> <span class="n">type</span><span class="p">;</span> <span class="cm">/* type for inode */</span>
<span class="kt">uint8_t</span> <span class="n">refs</span><span class="p">;</span> <span class="cm">/* refs for inode */</span>
<span class="p">}</span> <span class="n">inode_t</span><span class="p">;</span>
</pre></div>
</div>
<p>因为VFS虚拟文件系统将文件和目录都当做文件来看待上述的数据结构是索引节点类型其具有节点具有的操作方法、节点的数据存放指针、节点的名称即节点路径名/dev/null、节点类型、节点被引用的次数。</p>
<p><code class="docutils literal notranslate"><span class="pre">inode_</span></code>t结构体当中ops是针对索引节点的操作方法具体如下</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">union</span> <span class="n">inode_ops_t</span> <span class="p">{</span>
<span class="k">const</span> <span class="n">file_ops_t</span> <span class="o">*</span><span class="n">i_ops</span><span class="p">;</span> <span class="cm">/* char driver operations */</span>
<span class="k">const</span> <span class="n">fs_ops_t</span> <span class="o">*</span><span class="n">i_fops</span><span class="p">;</span> <span class="cm">/* FS operations */</span>
<span class="p">};</span>
<span class="k">typedef</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">file_ops</span> <span class="n">file_ops_t</span><span class="p">;</span> <span class="cm">/* 针对文件的操作方法 */</span>
<span class="k">typedef</span> <span class="k">const</span> <span class="k">struct</span> <span class="n">fs_ops</span> <span class="n">fs_ops_t</span><span class="p">;</span> <span class="cm">/* 针对目录的操作方法 */</span>
<span class="k">struct</span> <span class="n">file_ops</span> <span class="p">{</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">open</span><span class="p">)</span> <span class="p">(</span><span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span><span class="p">,</span> <span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">close</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">);</span>
<span class="kt">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">read</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">nbytes</span><span class="p">);</span>
<span class="kt">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">write</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">nbytes</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">ioctl</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">int</span> <span class="n">cmd</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">arg</span><span class="p">);</span>
<span class="cp">#ifdef AOS_CONFIG_VFS_POLL_SUPPORT</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">poll</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">flag</span><span class="p">,</span> <span class="n">poll_notify_t</span> <span class="n">notify</span><span class="p">,</span> <span class="k">struct</span> <span class="n">pollfd</span> <span class="o">*</span><span class="n">fd</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="cp">#endif</span>
<span class="p">};</span>
<span class="k">struct</span> <span class="n">fs_ops</span> <span class="p">{</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">open</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="kt">int</span> <span class="n">flags</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">close</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">);</span>
<span class="kt">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">read</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">len</span><span class="p">);</span>
<span class="kt">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">write</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">len</span><span class="p">);</span>
<span class="kt">off_t</span> <span class="p">(</span><span class="o">*</span><span class="n">lseek</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">off_t</span> <span class="n">off</span><span class="p">,</span> <span class="kt">int</span> <span class="n">whence</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">sync</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">stat</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="k">struct</span> <span class="n">stat</span> <span class="o">*</span><span class="n">st</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">unlink</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">rename</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">oldpath</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">newpath</span><span class="p">);</span>
<span class="n">aos_dir_t</span> <span class="o">*</span><span class="p">(</span><span class="o">*</span><span class="n">opendir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">);</span>
<span class="n">aos_dirent_t</span> <span class="o">*</span><span class="p">(</span><span class="o">*</span><span class="n">readdir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="n">aos_dir_t</span> <span class="o">*</span><span class="n">dir</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">closedir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="n">aos_dir_t</span> <span class="o">*</span><span class="n">dir</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">mkdir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">rmdir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">);</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">rewinddir</span><span class="p">)(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="n">aos_dir_t</span> <span class="o">*</span><span class="n">dir</span><span class="p">);</span>
<span class="kt">long</span> <span class="p">(</span><span class="o">*</span><span class="n">telldir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="n">aos_dir_t</span> <span class="o">*</span><span class="n">dir</span><span class="p">);</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">seekdir</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="n">aos_dir_t</span> <span class="o">*</span><span class="n">dir</span><span class="p">,</span> <span class="kt">long</span> <span class="n">loc</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">ioctl</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="kt">int</span> <span class="n">cmd</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">arg</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">statfs</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="k">struct</span> <span class="n">statfs</span> <span class="o">*</span><span class="n">suf</span><span class="p">);</span>
<span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">access</span><span class="p">)</span> <span class="p">(</span><span class="n">file_t</span> <span class="o">*</span><span class="n">fp</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="kt">int</span> <span class="n">amode</span><span class="p">);</span>
<span class="p">};</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">file_t</span></code>数据结构</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
<span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span><span class="p">;</span> <span class="cm">/* node for file */</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">f_arg</span><span class="p">;</span> <span class="cm">/* f_arg for file */</span>
<span class="kt">size_t</span> <span class="n">offset</span><span class="p">;</span> <span class="cm">/* offset for file */</span>
<span class="p">}</span> <span class="n">file_t</span><span class="p">;</span>
</pre></div>
</div>
<p>上述的<code class="docutils literal notranslate"><span class="pre">file_t</span></code>数据结构用于描述一个被打开的文件,因为系统当中同一个系统当中,同一个文件可能被多个程序打开,但是打开的每一个文件都会唯一的执行特定的索引节点,即最终的物理文件只有一份。</p>
</div>
<div class="section" id="aos-open">
<h2><span class="section-number">10.4. </span>以aos_open为例介绍其文件打开方式<a class="headerlink" href="#aos-open" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">aos_open</span></code>是对外的接口,外部函数可以直接使用该接口实现对于文件的打开操作,而不用去关心底层文件系统的实现细节。其代码如下所示:</p>
<p>其输入参数为:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">const</span> <span class="n">char</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span> <span class="n">即文件路径名</span>
<span class="nb">int</span> <span class="n">flags</span><span class="p">;</span> <span class="n">即操作标志</span> <span class="n">比如只读</span> <span class="n">只写</span> <span class="n">读写等</span>
</pre></div>
</div>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">aos_open</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="kt">int</span> <span class="n">flags</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">file_t</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
<span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span><span class="p">;</span>
<span class="kt">size_t</span> <span class="n">len</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">ret</span> <span class="o">=</span> <span class="n">VFS_SUCCESS</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">path</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="o">-</span><span class="n">EINVAL</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">len</span> <span class="o">=</span> <span class="n">strlen</span><span class="p">(</span><span class="n">path</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">len</span> <span class="o">&gt;</span> <span class="n">PATH_MAX</span><span class="p">)</span> <span class="p">{</span> <span class="cm">/* 文件路径名不允许超过256个字节 */</span>
<span class="k">return</span> <span class="o">-</span><span class="n">ENAMETOOLONG</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* 获取互斥锁该互斥锁在vfs_init函数中创建 */</span>
<span class="k">if</span> <span class="p">((</span><span class="n">ret</span> <span class="o">=</span> <span class="n">krhino_mutex_lock</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_vfs_mutex</span><span class="p">,</span> <span class="n">RHINO_WAIT_FOREVER</span><span class="p">))</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="n">ret</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* 根据路径名传参,打开索引节点,具体函数实现会在下文介绍 */</span>
<span class="n">node</span> <span class="o">=</span> <span class="n">inode_open</span><span class="p">(</span><span class="n">path</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">node</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="n">krhino_mutex_unlock</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_vfs_mutex</span><span class="p">);</span>
<span class="cp">#ifdef IO_NEED_TRAP</span>
<span class="k">return</span> <span class="n">trap_open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">flags</span><span class="p">);</span>
<span class="cp">#else</span>
<span class="k">return</span> <span class="o">-</span><span class="n">ENOENT</span><span class="p">;</span>
<span class="cp">#endif</span>
<span class="p">}</span>
<span class="n">node</span><span class="o">-&gt;</span><span class="n">i_flags</span> <span class="o">=</span> <span class="n">flags</span><span class="p">;</span>
<span class="cm">/*因为用户操作的文件都是在内存中新建立的文件(文件对象会反过来指向索引节点</span>
<span class="cm"> 即一个文件可能被多个程序打开)。所以需要根据索引接点对象新建立一个文件对象</span>
<span class="cm"> */</span>
<span class="n">file</span> <span class="o">=</span> <span class="n">new_file</span><span class="p">(</span><span class="n">node</span><span class="p">);</span>
<span class="cm">/* 释放互斥锁 */</span>
<span class="n">krhino_mutex_unlock</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_vfs_mutex</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">file</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="o">-</span><span class="n">ENFILE</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* 根据节点类型判断该路径名指向是一个文件还是一个目录,因为文件对象和目录对象虽然都是节点</span>
<span class="cm"> 但是其操作方法有些差别,见前文中的目录和文件操作方法 */</span>
<span class="k">if</span> <span class="p">(</span><span class="n">INODE_IS_FS</span><span class="p">(</span><span class="n">node</span><span class="p">))</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">((</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">ops</span><span class="p">.</span><span class="n">i_fops</span><span class="o">-&gt;</span><span class="n">open</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="n">ret</span> <span class="o">=</span> <span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">ops</span><span class="p">.</span><span class="n">i_fops</span><span class="o">-&gt;</span><span class="n">open</span><span class="p">)(</span><span class="n">file</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">flags</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">((</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">ops</span><span class="p">.</span><span class="n">i_ops</span><span class="o">-&gt;</span><span class="n">open</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="n">ret</span> <span class="o">=</span> <span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">ops</span><span class="p">.</span><span class="n">i_ops</span><span class="o">-&gt;</span><span class="n">open</span><span class="p">)(</span><span class="n">node</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ret</span> <span class="o">!=</span> <span class="n">VFS_SUCCESS</span><span class="p">)</span> <span class="p">{</span>
<span class="n">del_file</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
<span class="k">return</span> <span class="n">ret</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* 获得文件句柄 */</span>
<span class="k">return</span> <span class="n">get_fd</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p>inode_open 在inode_open函数用于根据文件路径名打开对应的节点。
其输入参数为: <code class="docutils literal notranslate"><span class="pre">const</span> <span class="pre">char</span> <span class="pre">*</span> <span class="pre">path;</span> <span class="pre">文件路径名</span></code> 输出参数为:
<code class="docutils literal notranslate"><span class="pre">inode_t;</span> <span class="pre">对应的节点</span></code></p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="n">inode_t</span> <span class="n">g_vfs_dev_nodes</span><span class="p">[</span><span class="n">AOS_CONFIG_VFS_DEV_NODES</span><span class="p">];</span>
<span class="n">inode_t</span> <span class="o">*</span><span class="nf">inode_open</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">e</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span><span class="p">;</span>
<span class="cm">/*AOS_CONFIG_VFS_DEV_NODES该宏定义为25.</span>
<span class="cm"> 即在保存节点的数组g_vfs_dev_nodes中仅仅会保存25个节点</span>
<span class="cm"> */</span>
<span class="k">for</span> <span class="p">(</span><span class="n">e</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">e</span> <span class="o">&lt;</span> <span class="n">AOS_CONFIG_VFS_DEV_NODES</span><span class="p">;</span> <span class="n">e</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
<span class="n">node</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">g_vfs_dev_nodes</span><span class="p">[</span><span class="n">e</span><span class="p">];</span>
<span class="k">if</span> <span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="k">continue</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* 判断该节点是一个目录还是一个文件 */</span>
<span class="k">if</span> <span class="p">(</span><span class="n">INODE_IS_TYPE</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">VFS_TYPE_FS_DEV</span><span class="p">))</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">((</span><span class="n">strncmp</span><span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">strlen</span><span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span><span class="p">))</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
<span class="p">(</span><span class="o">*</span><span class="p">(</span><span class="n">path</span> <span class="o">+</span> <span class="n">strlen</span><span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span><span class="p">))</span> <span class="o">==</span> <span class="sc">&#39;/&#39;</span><span class="p">))</span> <span class="p">{</span>
<span class="k">return</span> <span class="n">node</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span><span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="n">node</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p>new_file
在new_file()函数中完成的主要功能就是新建立一个file_t的结构体定义和初始化。
其输入参数是: inode_t *node; 上个函数中得到的节点 输出参数是:
file_t 类型。用于后续获取文件句柄</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="n">file_t</span> <span class="n">files</span><span class="p">[</span><span class="n">MAX_FILE_NUM</span><span class="p">];</span>
<span class="cp">#define MAX_FILE_NUM (AOS_CONFIG_VFS_DEV_NODES * 2)</span>
<span class="n">file_t</span> <span class="o">*</span><span class="nf">new_file</span><span class="p">(</span><span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">file_t</span> <span class="o">*</span><span class="n">f</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">idx</span><span class="p">;</span>
<span class="cm">/* 在file数组当中新建立一个数据项。且保证该数组未满。即打开的文件数量是有限的 */</span>
<span class="k">for</span> <span class="p">(</span><span class="n">idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">idx</span> <span class="o">&lt;</span> <span class="n">MAX_FILE_NUM</span><span class="p">;</span> <span class="n">idx</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
<span class="n">f</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">files</span><span class="p">[</span><span class="n">idx</span><span class="p">];</span>
<span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="o">-&gt;</span><span class="n">node</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="k">goto</span> <span class="n">got_file</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
<span class="nl">got_file</span><span class="p">:</span>
<span class="n">f</span><span class="o">-&gt;</span><span class="n">node</span> <span class="o">=</span> <span class="n">node</span><span class="p">;</span>
<span class="n">f</span><span class="o">-&gt;</span><span class="n">f_arg</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
<span class="n">f</span><span class="o">-&gt;</span><span class="n">offset</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">inode_ref</span><span class="p">(</span><span class="n">node</span><span class="p">);</span>
<span class="k">return</span> <span class="n">f</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>所有的系统调用函数类似于aos_open都位于vfs.c文件中。</p>
</div>
<div class="section" id="id3">
<h2><span class="section-number">10.5. </span>将驱动文件或者文件系统加载到VFS当中<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>在vfs_register.c文件中定义的函数</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="n">aos_register_driver</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="n">file_ops_t</span> <span class="o">*</span><span class="n">ops</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span>
<span class="kt">int</span> <span class="n">aos_register_fs</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="n">fs_ops_t</span> <span class="o">*</span><span class="n">ops</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span>
</pre></div>
</div>
<p>上述两个函数分别是将驱动文件或者是文件系统类型装载到VFS当中的函数。外部程序例如sensor驱动程序可以调用这两个接口将驱动文件加载的VFS当中去。</p>
<p>以aos_register_driver为例进行介绍</p>
<p>其输入参数为: 驱动文件路径名 const char * path /dev/null</p>
<p>驱动操作方法 file_ops_t *ops
不需要实现全部的方法实现必要的方法其余置NULL即可</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">aos_register_driver</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span> <span class="n">file_ops_t</span> <span class="o">*</span><span class="n">ops</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">inode_t</span> <span class="o">*</span><span class="n">node</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">err</span><span class="p">,</span> <span class="n">ret</span><span class="p">;</span>
<span class="n">err</span> <span class="o">=</span> <span class="n">krhino_mutex_lock</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_vfs_mutex</span><span class="p">,</span> <span class="n">RHINO_WAIT_FOREVER</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">err</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="n">err</span><span class="p">;</span>
<span class="p">}</span>
<span class="c1">//在g_vfs_dev_nodes数组中寻找一个空的数组项返回其指针给node并将path的路径名赋给node--&gt;name</span>
<span class="n">ret</span> <span class="o">=</span> <span class="n">inode_reserve</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">node</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ret</span> <span class="o">==</span> <span class="n">VFS_SUCCESS</span><span class="p">)</span> <span class="p">{</span>
<span class="cm">/* now populate it with char specific information */</span>
<span class="n">INODE_SET_CHAR</span><span class="p">(</span><span class="n">node</span><span class="p">);</span>
<span class="n">node</span><span class="o">-&gt;</span><span class="n">ops</span><span class="p">.</span><span class="n">i_ops</span> <span class="o">=</span> <span class="n">ops</span><span class="p">;</span>
<span class="n">node</span><span class="o">-&gt;</span><span class="n">i_arg</span> <span class="o">=</span> <span class="n">arg</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* step out critical area for type is allocated */</span>
<span class="n">err</span> <span class="o">=</span> <span class="n">krhino_mutex_unlock</span><span class="p">(</span><span class="o">&amp;</span><span class="n">g_vfs_mutex</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">err</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="n">krhino_mm_free</span><span class="p">(</span><span class="n">node</span><span class="o">-&gt;</span><span class="n">i_name</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">memset</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">inode_t</span><span class="p">));</span>
<span class="k">return</span> <span class="n">err</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">ret</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id4">
<h2><span class="section-number">10.6. </span>示例代码<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<p>vfs的操作类linux中操作
这里举例<code class="docutils literal notranslate"><span class="pre">aos_open</span></code><code class="docutils literal notranslate"><span class="pre">aos_close</span></code><code class="docutils literal notranslate"><span class="pre">aos_read</span></code><code class="docutils literal notranslate"><span class="pre">aos_write</span></code></p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">bl_test_uart0</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">fd</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">length</span><span class="p">;</span>
<span class="kt">char</span> <span class="n">buf_recv</span><span class="p">[</span><span class="mi">128</span><span class="p">];</span>
<span class="cm">/* 首先打开相关文件对应到UART0 */</span>
<span class="n">fd</span> <span class="o">=</span> <span class="n">aos_open</span><span class="p">(</span><span class="s">&quot;/dev/ttyS0&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">fd</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">log_error</span><span class="p">(</span><span class="s">&quot;open err.</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
<span class="cm">/* 读取UART0中的数据 */</span>
<span class="n">length</span> <span class="o">=</span> <span class="n">aos_read</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">buf_recv</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">buf_recv</span><span class="p">));</span>
<span class="k">if</span> <span class="p">(</span><span class="n">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">log_info</span><span class="p">(</span><span class="s">&quot;recv len = %d</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">length</span><span class="p">);</span>
<span class="cm">/* 直到收到&#39;exit&#39;才会主动结束循环并close相关文件 */</span>
<span class="k">if</span> <span class="p">(</span><span class="n">memcmp</span><span class="p">(</span><span class="n">buf_recv</span><span class="p">,</span> <span class="s">&quot;exit&quot;</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">aos_close</span><span class="p">(</span><span class="n">fd</span><span class="p">);</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/* UART0将收到的数据回传过去 */</span>
<span class="n">aos_write</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">buf_recv</span><span class="p">,</span> <span class="n">length</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">vTaskDelay</span><span class="p">(</span><span class="mi">100</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id5">
<h2><span class="section-number">10.7. </span>总结<a class="headerlink" href="#id5" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>VFS的一把重要的互斥锁 对VFS的相关操作都需要获取该互斥锁才能够进行。
<code class="docutils literal notranslate"><span class="pre">kmutex_t</span> <span class="pre">g_vfs_mutex;</span></code></p></li>
<li><p>VFS的两个重要的数组结构 如下所示:第一个数组是保存节点的数组结构。
第二个数组是保存文件对象的数组结构。和用户直接相关的是第二个数组结构</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="n">inode_t</span> <span class="n">g_vfs_dev_nodes</span><span class="p">[</span><span class="n">AOS_CONFIG_VFS_DEV_NODES</span><span class="p">];</span>
<span class="k">static</span> <span class="n">file_t</span> <span class="n">files</span><span class="p">[</span><span class="n">MAX_FILE_NUM</span><span class="p">];</span>
</pre></div>
</div>
<ul class="simple">
<li><p>使用者只需关心的文件 vfs_register.c文件用于注册 vfs.c
文件用于各种标准操作。</p></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../yloop/yloop.html" class="btn btn-neutral float-right" title="11. yloop" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../security/security.html" class="btn btn-neutral float-left" title="9. Security" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,538 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>11. yloop &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="12. HTTPC" href="../../Network/httpc/httpc.html" />
<link rel="prev" title="10. AOS VFS" href="../vfs/vfs.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">11. yloop</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">11.1. Yloop概要</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">11.2. Yloop上下文</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">11.3. Yloop调度</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">11.4. Yloop实现原理</a></li>
<li class="toctree-l2"><a class="reference internal" href="#api">11.5. 主要api介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">11.6. 示例代码</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id6">11.6.1. 事件注册、通知、回调、取消流程</a></li>
<li class="toctree-l3"><a class="reference internal" href="#poll">11.6.2. poll事件的注册取消</a></li>
<li class="toctree-l3"><a class="reference internal" href="#action">11.6.3. 延迟执行一个action</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id7">11.6.4. 安排一次回调</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id8">11.7. 注意事项</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">11. </span>yloop</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Middleware/yloop/yloop.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="yloop">
<h1><span class="section-number">11. </span>yloop<a class="headerlink" href="#yloop" title="永久链接至标题"></a></h1>
<hr class="docutils" />
<ul class="simple">
<li><p><a class="reference internal" href="#id1">Yloop概要</a></p></li>
<li><p><a class="reference internal" href="#id2">Yloop上下文</a></p></li>
<li><p><a class="reference internal" href="#id3">Yloop调度</a></p></li>
<li><p><a class="reference internal" href="#id4">Yloop实现原理</a></p></li>
<li><p><a class="reference internal" href="#api">主要api介绍</a></p></li>
<li><p><a class="reference internal" href="#id5">示例代码</a></p></li>
<li><p><a class="reference internal" href="#id8">注意事项</a></p></li>
</ul>
<div class="section" id="id1">
<h2><span class="section-number">11.1. </span>Yloop概要<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>Yloop 是AliOS
Things的异步事件框架。Yloop借鉴了libuv及嵌入式业界常见的event
loop综合考虑使用复杂性性能及footprint实现了一个适合于MCU的事件调度机制。我们移植了相关的插件。其主要优势是所有的处理都是在主任务中执行的不需要额外的创建任务从而节省内存使用。同时由于所有处理都是在主任务进行不需要复杂的互斥操作。</p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">11.2. </span>Yloop上下文<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>每个Yloop实例aos_loop_t与特定的任务上下文绑定AliOS
Things的程序入口application_start
所在的上下文与系统的主Yloop实例绑定该上下文也称为主任务。主任务以外的任务也可以创建自己的Yloop实例。</p>
</div>
<div class="section" id="id3">
<h2><span class="section-number">11.3. </span>Yloop调度<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>Yloop实现了对IOtimercallbackevent的统一调度管理</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IO</span></code>最常见的是Socket也可以是AliOS Things的vfs管理的设备</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">timer</span></code>:即常见的定时器</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">callback</span></code>:特定的执行函数</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">event</span></code>:包括系统事件,用户自定义事件
当调用aos_loop_run后当前任务将会等待上述的各类事件发生。</p></li>
</ul>
</div>
<div class="section" id="id4">
<h2><span class="section-number">11.4. </span>Yloop实现原理<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<p>Yloop利用协议栈的select接口实现了对IO及timer的调度。AliOS
Things自带的协议栈又暴露一个特殊的eventfd接口Yloop利用此接口把VFS的设备文件和eventfd关联起来实现了对整个系统的事件的统一调度。</p>
</div>
<div class="section" id="api">
<h2><span class="section-number">11.5. </span>主要api介绍<a class="headerlink" href="#api" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>注册事件监听函数</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/**</span>
<span class="cm"> * Register system event filter callback.</span>
<span class="cm"> *</span>
<span class="cm"> @param[in] type event type interested.</span>
<span class="cm"> * @param[in] cb system event callback.</span>
<span class="cm"> * @param[in] priv private data past to cb.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, 0 is OK, others is error.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_register_event_filter</span><span class="p">(</span><span class="kt">uint16_t</span> <span class="n">type</span><span class="p">,</span> <span class="n">aos_event_cb</span> <span class="n">cb</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">priv</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * Unregister native event callback.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] type event type interested.</span>
<span class="cm"> * @param[in] cb system event callback.</span>
<span class="cm"> * @param[in] priv private data past to cb.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, 0 is OK, others is error.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_unregister_event_filter</span><span class="p">(</span><span class="kt">uint16_t</span> <span class="n">type</span><span class="p">,</span> <span class="n">aos_event_cb</span> <span class="n">cb</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">priv</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p>发布一个 event</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/**</span>
<span class="cm"> * Post local event.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] type event type.</span>
<span class="cm"> * @param[in] code event code.</span>
<span class="cm"> * @param[in] value event value.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, 0 is OK,others is error.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_post_event</span><span class="p">(</span><span class="kt">uint16_t</span> <span class="n">type</span><span class="p">,</span> <span class="kt">uint16_t</span> <span class="n">code</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">value</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p>注册和取消一个 poll event</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/**</span>
<span class="cm"> * Register a poll event in main loop.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] fd poll fd.</span>
<span class="cm"> * @param[in] action action to be executed.</span>
<span class="cm"> * @param[in] param private data past to action.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, 0 is OK,others is error.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_poll_read_fd</span><span class="p">(</span><span class="kt">int</span> <span class="n">fd</span><span class="p">,</span> <span class="n">aos_poll_call_t</span> <span class="n">action</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">param</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * Cancel a poll event to be executed in main loop.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] fd poll fd.</span>
<span class="cm"> * @param[in] action action to be executed.</span>
<span class="cm"> * @param[in] param private data past to action.</span>
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">aos_cancel_poll_read_fd</span><span class="p">(</span><span class="kt">int</span> <span class="n">fd</span><span class="p">,</span> <span class="n">aos_poll_call_t</span> <span class="n">action</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">param</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p>发布和取消一个延迟执行的 action</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/**static void adc_cb_read(int fd, void *param)</span>
<span class="cm">{</span>
<span class="cm"> aos_post_event(EV_ADCKEY, CODE_ADCKEY_INT_TRIGGER, fd);</span>
<span class="cm">}</span>
<span class="cm"> * Post a delayed action to be executed in main loop.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] ms milliseconds to wait.</span>
<span class="cm"> * @param[in] action action to be executed.</span>
<span class="cm"> * @param[in] arg private data past to action.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, 0 is OK,others is error.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_post_delayed_action</span><span class="p">(</span><span class="kt">int</span> <span class="n">ms</span><span class="p">,</span> <span class="n">aos_call_t</span> <span class="n">action</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * Cancel a delayed action to be executed in main loop.</span>
<span class="cm"> *</span>
<span class="cm"> * @param[in] ms milliseconds to wait, -1 means don&#39;t care.</span>
<span class="cm"> * @param[in] action action to be executed.</span>
<span class="cm"> * @param[in] arg private data past to action.</span>
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">aos_cancel_delayed_action</span><span class="p">(</span><span class="kt">int</span> <span class="n">ms</span><span class="p">,</span> <span class="n">aos_call_t</span> <span class="n">action</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p>安排一次回调</p></li>
</ul>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/**</span>
<span class="cm"> * Schedule a callback in next event loop.</span>
<span class="cm"> * Unlike aos_post_delayed_action,</span>
<span class="cm"> * this function can be called from non-aos-main-loop context.</span>
<span class="cm"> * @param[in] action action to be executed.</span>
<span class="cm"> * @param[in] arg private data past to action.</span>
<span class="cm"> *</span>
<span class="cm"> * @return the operation status, &lt;0 is error,others is OK.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">aos_schedule_call</span><span class="p">(</span><span class="n">aos_call_t</span> <span class="n">action</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="id5">
<h2><span class="section-number">11.6. </span>示例代码<a class="headerlink" href="#id5" title="永久链接至标题"></a></h2>
<p>这里会介绍<a class="reference external" href="#事件注册、通知、回调、取消流程">事件注册、通知、回调、取消流程</a><a class="reference external" href="#poll事件的注册取消">poll事件的注册取消</a><a class="reference external" href="#延迟执行一个action">延迟执行一个actio</a>)以及<a class="reference external" href="#安排一次回调">安排一次回调</a>的使用方法</p>
<div class="section" id="id6">
<h3><span class="section-number">11.6.1. </span>事件注册、通知、回调、取消流程<a class="headerlink" href="#id6" title="永久链接至标题"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_register_event_filter</span><span class="p">(</span><span class="n">EV_WIFI</span><span class="p">,</span> <span class="n">event_cb_wifi_event</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
</pre></div>
</div>
<p>用户首先调用<code class="docutils literal notranslate"><span class="pre">aos_register_event_filter</span></code>注册事件监听函数,例如首先显注册一个<code class="docutils literal notranslate"><span class="pre">EV_WIFI</span></code>事件的监听函数<code class="docutils literal notranslate"><span class="pre">event_cb_wifi_event</span></code></p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_post_event</span><span class="p">(</span><span class="n">EV_WIFI</span><span class="p">,</span> <span class="n">CODE_WIFI_ON_INIT_DONE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</pre></div>
</div>
<p>当有任务调用<code class="docutils literal notranslate"><span class="pre">aos_post_event</span></code>接口,发布<code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_INIT_DONE</span></code>事件之后</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="kt">void</span> <span class="nf">event_cb_wifi_event</span><span class="p">(</span><span class="n">input_event_t</span> <span class="o">*</span><span class="n">event</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">private_data</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">switch</span> <span class="p">(</span>
<span class="k">case</span> <span class="nl">CODE_WIFI_ON_INIT_DONE</span><span class="p">:</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;[APP] [EVT] CODE_WIFI_ON_INIT_DONE %lld</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">aos_now_ms</span><span class="p">());</span>
<span class="p">}</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">case</span> <span class="nl">CODE_WIFI_ON_PRE_GOT_IP</span><span class="p">:</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;[APP] [EVT] connected %lld</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">aos_now_ms</span><span class="p">());</span>
<span class="p">}</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">case</span> <span class="nl">CODE_WIFI_ON_GOT_IP</span><span class="p">:</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;[APP] [EVT] GOT IP %lld</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">aos_now_ms</span><span class="p">());</span>
<span class="p">}</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">default</span><span class="o">:</span>
<span class="p">{</span>
<span class="cm">/*nothing*/</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">event_cb_wifi_event</span></code>会被调用并进入case<code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_INIT_DONE</span></code>分支</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_unregister_event_filter</span><span class="p">(</span><span class="n">EV_WIFI</span><span class="p">,</span> <span class="n">event_cb_wifi_event</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
</pre></div>
</div>
<p>如果用户不需要事件的监听,用户可以主动调用<code class="docutils literal notranslate"><span class="pre">aos_unregister_event_filter</span></code>取消监听</p>
</div>
<div class="section" id="poll">
<h3><span class="section-number">11.6.2. </span>poll事件的注册取消<a class="headerlink" href="#poll" title="永久链接至标题"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/*uart*/</span>
<span class="n">fd_console</span> <span class="o">=</span> <span class="n">aos_open</span><span class="p">(</span><span class="s">&quot;/dev/ttyS0&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">fd_console</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;Init CLI with event Driven</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">aos_cli_init</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="n">aos_poll_read_fd</span><span class="p">(</span><span class="n">fd_console</span><span class="p">,</span> <span class="n">aos_cli_event_cb_read_get</span><span class="p">(),</span> <span class="p">(</span><span class="kt">void</span><span class="o">*</span><span class="p">)</span><span class="mh">0x12345678</span><span class="p">);</span>
<span class="n">_cli_init</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>这里以 <code class="docutils literal notranslate"><span class="pre">uart0</span></code> 为例,用户首先注册一个<code class="docutils literal notranslate"><span class="pre">aos_poll_read_fd</span></code>poll事件</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_cancel_poll_read_fd</span><span class="p">(</span><span class="n">fd_console</span><span class="p">,</span> <span class="n">action</span><span class="p">,</span> <span class="p">(</span><span class="kt">void</span><span class="o">*</span><span class="p">)</span><span class="mh">0x12345678</span><span class="p">);</span>
</pre></div>
</div>
<p>如果用户不需要事件的poll用户可以调用<code class="docutils literal notranslate"><span class="pre">aos_cancel_poll_read_fd</span></code> 取消poll</p>
</div>
<div class="section" id="action">
<h3><span class="section-number">11.6.3. </span>延迟执行一个action<a class="headerlink" href="#action" title="永久链接至标题"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_post_delayed_action</span><span class="p">(</span><span class="mi">1000</span><span class="p">,</span> <span class="n">app_delayed_action_print</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
</pre></div>
</div>
<p>用户可以调用<code class="docutils literal notranslate"><span class="pre">aos_post_delayed_action</span></code>做一个延迟<code class="docutils literal notranslate"><span class="pre">1s</span></code>执行的事件</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="kt">void</span> <span class="nf">app_delayed_action_print</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;test.</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>那过<code class="docutils literal notranslate"><span class="pre">1s</span></code>之后会主动调用<code class="docutils literal notranslate"><span class="pre">app_delayed_action_print</span></code>函数</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_cancel_delayed_action</span><span class="p">(</span><span class="mi">1000</span><span class="p">,</span> <span class="n">app_delayed_action_print</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
</pre></div>
</div>
<p>当用户想直接取消一个延迟动作可以调用<code class="docutils literal notranslate"><span class="pre">aos_cancel_delayed_action</span></code>,其第一个<code class="docutils literal notranslate"><span class="pre">ms</span></code>参数,
<code class="docutils literal notranslate"><span class="pre">ms</span> <span class="pre">==</span> <span class="pre">-1</span></code>时,表示无需关心时间是否一致</p>
</div>
<div class="section" id="id7">
<h3><span class="section-number">11.6.4. </span>安排一次回调<a class="headerlink" href="#id7" title="永久链接至标题"></a></h3>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">aos_schedule_call</span><span class="p">(</span><span class="n">app_action_print</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
</pre></div>
</div>
<p>用户主动调用<code class="docutils literal notranslate"><span class="pre">aos_schedule_call</span></code>函数</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="nf">app_action_print</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">arg</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">&quot;test</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<p>那么会在下一次循环中主动调用<code class="docutils literal notranslate"><span class="pre">app_action_print</span></code>函数</p>
</div>
</div>
<div class="section" id="id8">
<h2><span class="section-number">11.7. </span>注意事项<a class="headerlink" href="#id8" title="永久链接至标题"></a></h2>
<p>Yloop的API(include/aos/yloop.h)除了下述API都必须在Yloop实例所绑定的任务的上下文执行</p>
<ul class="simple">
<li><p>aos_schedule_call</p></li>
<li><p>aos_loop_schedule_call</p></li>
<li><p>aos_loop_schedule_work</p></li>
<li><p>aos_cancel_work</p></li>
<li><p>aos_post_event</p></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../../Network/httpc/httpc.html" class="btn btn-neutral float-right" title="12. HTTPC" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../vfs/vfs.html" class="btn btn-neutral float-left" title="10. AOS VFS" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>12. HTTPC &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="13. HTTPS" href="../https/https.html" />
<link rel="prev" title="11. yloop" href="../../Middleware/yloop/yloop.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">12. </span>HTTPC</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Network/httpc/httpc.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="httpc">
<h1><span class="section-number">12. </span>HTTPC<a class="headerlink" href="#httpc" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../https/https.html" class="btn btn-neutral float-right" title="13. HTTPS" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../../Middleware/yloop/yloop.html" class="btn btn-neutral float-left" title="11. yloop" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>13. HTTPS &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="14. TLS" href="../tls/tls.html" />
<link rel="prev" title="12. HTTPC" href="../httpc/httpc.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">13. </span>HTTPS</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Network/https/https.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="https">
<h1><span class="section-number">13. </span>HTTPS<a class="headerlink" href="#https" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../tls/tls.html" class="btn btn-neutral float-right" title="14. TLS" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../httpc/httpc.html" class="btn btn-neutral float-left" title="12. HTTPC" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>14. TLS &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="15. Provision_WiFi" href="../../BLE/provision_WiFi/provision_WiFi.html" />
<link rel="prev" title="13. HTTPS" href="../https/https.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../https/https.html">13. HTTPS</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">14. </span>TLS</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Network/tls/tls.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="tls">
<h1><span class="section-number">14. </span>TLS<a class="headerlink" href="#tls" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../../BLE/provision_WiFi/provision_WiFi.html" class="btn btn-neutral float-right" title="15. Provision_WiFi" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../https/https.html" class="btn btn-neutral float-left" title="13. HTTPS" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,552 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WiFi &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>WiFi</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/Components/Network/wifi/wifi.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="wifi">
<span id="wifi-index"></span><h1>WiFi<a class="headerlink" href="#wifi" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>概述<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本文档介绍BL_IoT SDK的WiFi联网功能。主要包括</p>
<ul class="simple">
<li><p>基站模式(即 STA 模式或 Wi-Fi 客户端模式),此时 BL_IoT 连接到接入点 (AP)。</p></li>
<li><p>AP 模式(即 Soft-AP 模式或接入点模式),此时基站连接到 BL_IoT。</p></li>
<li><p>AP-STA 共存模式BL_IoT 既是接入点,同时又作为基站连接到另外一个接入点)。</p></li>
<li><p>上述模式的各种安全模式WPA、WPA2 及 WEPAP模式不支持</p></li>
<li><p>扫描接入点(包括主动扫描及被动扫描)。</p></li>
<li><p>使用混杂模式监控 IEEE802.11 Wi-Fi 数据包。</p></li>
</ul>
</div>
<div class="section" id="id2">
<h2>应用实例<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>BL_IoT的实例 <code class="docutils literal notranslate"><span class="pre">bl602_demo_wifi</span></code> 目录下包含了一个应用程序该demo介绍了如何使用BL_IoT模组连接到AP等一系列wifi操作。该实例实现的主要思路如下</p>
<div class="figure align-default">
<img alt="" src="../../../_images/image11.png" />
</div>
<ul class="simple">
<li><p>在主函数 <code class="docutils literal notranslate"><span class="pre">bfl_main()</span></code> 中创建一个 <code class="docutils literal notranslate"><span class="pre">aos_loop_proc()</span></code> 线程,在此线程中调用 <code class="docutils literal notranslate"><span class="pre">aos_register_event_filter()</span></code> 接口注册一个 <code class="docutils literal notranslate"><span class="pre">EV_WIFI</span></code> 事件的监听函数 <code class="docutils literal notranslate"><span class="pre">event_cb_wifi_event()</span></code> </p></li>
<li><p>首先用户在终端中输入 <code class="docutils literal notranslate"><span class="pre">stack_wifi</span></code> 命令后,在 <code class="docutils literal notranslate"><span class="pre">cmd_stack_wifi()</span></code> 函数中创建一个 <code class="docutils literal notranslate"><span class="pre">wifi_main()</span></code> 的线程,接着调用 <code class="docutils literal notranslate"><span class="pre">aos_post_event()</span></code> 接口发布 <code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_INIT_DONE</span></code> 事件后, <code class="docutils literal notranslate"><span class="pre">event_cb_wifi_event()</span></code> 会被调用并进入case <code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_INIT_DONE</span></code> 分支从而调用 <code class="docutils literal notranslate"><span class="pre">wifi_mgmr_start_background()</span></code> 开启WiFi Manager同时发布 <code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_MGMR_DONE</span></code> 事件进入case <code class="docutils literal notranslate"><span class="pre">CODE_WIFI_ON_MGMR_DONE</span></code> 分支调用 <code class="docutils literal notranslate"><span class="pre">_connect_wifi()</span></code> 函数此函数先判断easyflash中是否设置了可连接的ssid如果设置了则会自动进行wifi连接没有设置则需手动输命令设置</p></li>
<li><p>如用户在终端中输入 <code class="docutils literal notranslate"><span class="pre">wifi_sta_connect</span></code> 命令会调用相应的api实现。如需实现wifi相关的其他功能可通过调用对应api来实现。</p></li>
</ul>
</div>
<div class="section" id="reason-codes">
<h2>Reason Codes<a class="headerlink" href="#reason-codes" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_SUCCESSFUL</span></code></p>
<p>WiFi连接成功</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_TX_AUTH_FRAME_ALLOCATE_FAIILURE</span></code></p>
<p>发送验证帧分配失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_AUTHENTICATION_FAIILURE</span></code></p>
<p>验证失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_AUTH_ALGO_FAIILURE</span></code></p>
<p>身份验证响应但身份验证算法失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_TX_ASSOC_FRAME_ALLOCATE_FAIILURE</span></code></p>
<p>发送关联帧分配失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_ASSOCIATE_FAIILURE</span></code></p>
<p>关联错误</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_DEAUTH_BY_AP_WHEN_NOT_CONNECTION</span></code></p>
<p>AP取消验证但状态错误</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_DEAUTH_BY_AP_WHEN_CONNECTION</span></code></p>
<p>连接时由AP取消验证</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_4WAY_HANDSHAKE_ERROR_PSK_TIMEOUT_FAILURE</span></code></p>
<p>密码错误,四次握手超时</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_4WAY_HANDSHAKE_TX_DEAUTH_FRAME_TRANSMIT_FAILURE</span></code></p>
<p>密码错误,发送取消验证帧传输失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_4WAY_HANDSHAKE_TX_DEAUTH_FRAME_ALLOCATE_FAIILURE</span></code></p>
<p>密码错误,发送取消验证帧分配失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_TX_AUTH_OR_ASSOC_FRAME_TRANSMIT_FAILURE</span></code></p>
<p>发送授权或关联帧传输失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_SCAN_NO_BSSID_AND_CHANNEL</span></code></p>
<p>SSID错误扫描不到bssid和频道</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_CREATE_CHANNEL_CTX_FAILURE_WHEN_JOIN_NETWORK</span></code></p>
<p>加入网络时创建通道上下文失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_JOIN_NETWORK_FAILURE</span></code></p>
<p>加入网络失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_ADD_STA_FAILURE</span></code></p>
<p>加入sta模式失败</p>
<p><code class="docutils literal notranslate"><span class="pre">WLAN_FW_BEACON_LOSS</span></code></p>
<p>信标丢失</p>
</div>
<div class="section" id="api">
<h2>API参考<a class="headerlink" href="#api" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>头文件</p></li>
</ul>
<p><a class="reference external" href="../../../../components/bl602/bl602_wifidrv/bl60x_wifi_driver/include/wifi_mgmr_ext.h">wifi_mgmr_ext.h</a></p>
<ul class="simple">
<li><p>API介绍</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">wifi_mgmr_start_background(wifi_conf_t</span> <span class="pre">*conf)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 初始化并开启WiFi Manager。wifi相关的操作第一步首先调用此接口
*
* @param[in] conf WiFi配置
*
* @return 无
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">wifi_interface_t</span> <span class="pre">wifi_mgmr_sta_enable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/**</span>
<span class="o">*</span> <span class="n">function</span> <span class="n">wifi</span> <span class="n">sta</span> <span class="n">使能</span>
<span class="o">*</span>
<span class="o">*</span> <span class="nd">@param</span><span class="p">[</span><span class="ow">in</span><span class="p">]</span> <span class="n"></span>
<span class="o">*</span>
<span class="o">*</span> <span class="nd">@return</span> <span class="n">指向wifi</span> <span class="n">sta的结构体信息的指针</span>
<span class="o">*/</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_disable(wifi_interface_t</span> <span class="pre">*interface)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function wifi sta 失能
*
* @param[in] interface wifi sta结构体指针
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_mac_set(uint8_t</span> <span class="pre">mac[6])</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 设置 wifi mac 地址
*
* @param[in] mac[6] 存储mac地址的数组
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_mac_get(uint8_t</span> <span class="pre">mac[6])</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取 wifi mac 地址
*
* @param[in] mac[6] 存储mac地址的数组
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_ip_get(uint32_t</span> <span class="pre">*ip,</span> <span class="pre">uint32_t</span> <span class="pre">*gw,</span> <span class="pre">uint32_t</span> <span class="pre">*mask)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取 wifi ip
*
* @param[in] ip 指向ip的指针
* @param[in] gw 指向gateway的指针
* @param[in] mask 指向mask的指针
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_connect(wifi_interface_t</span> <span class="pre">*wifi_interface,</span> <span class="pre">char</span> <span class="pre">*ssid,</span> <span class="pre">char</span> <span class="pre">*psk,</span> <span class="pre">char</span> <span class="pre">*pmk,</span> <span class="pre">uint8_t</span> <span class="pre">*mac,</span> <span class="pre">uint8_t</span> <span class="pre">band,</span> <span class="pre">uint16_t</span> <span class="pre">freq)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function wifi sta 连接
*
* @param[in] wifi_interface wifi sta结构体指针wifi_mgmr_sta_enable的返回值
* @param[in] ssid wifi名
* @param[in] psk 密码
* @param[in] pmk pmk
* @param[in] mac mac地址
* @param[in] band band
* @param[in] freq freq
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_disconnect(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function wifi sta 断开调用此接口后需要TaskDelay 1s左右再调用wifi_mgmr_sta_disable接口才能实现wifi disconnect
*
* @param[in] 无
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">wifi_interface_t</span> <span class="pre">wifi_mgmr_ap_enable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/**</span>
<span class="o">*</span> <span class="n">function</span> <span class="n">wifi</span> <span class="n">ap模式使能</span>
<span class="o">*</span>
<span class="o">*</span> <span class="nd">@param</span><span class="p">[</span><span class="ow">in</span><span class="p">]</span> <span class="n"></span>
<span class="o">*</span>
<span class="o">*</span> <span class="nd">@return</span> <span class="n">指向wifi</span> <span class="n">ap的结构体信息的指针</span>
<span class="o">*/</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_ap_start(wifi_interface_t</span> <span class="pre">*interface,</span> <span class="pre">char</span> <span class="pre">*ssid,</span> <span class="pre">int</span> <span class="pre">md,</span> <span class="pre">char</span> <span class="pre">*passwd,</span> <span class="pre">int</span> <span class="pre">channel)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启wifi ap模式
*
* @param[in] interface wifi ap结构体指针
* @param[in] ssid wifi名
* @param[in] md md
* @param[in] passwd 密码
* @param[in] channel wifi信道
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_ap_stop(wifi_interface_t</span> <span class="pre">*interface)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 关闭wifi ap模式
*
* @param[in] interface wifi ap结构体指针
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_scan(void</span> <span class="pre">*data,</span> <span class="pre">scan_complete_cb_t</span> <span class="pre">cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启wifi扫描
*
* @param[in] data scan data
* @param[in] cb sacn cb
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_autoconnect_enable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启wifi重连
*
* @param[in] 无
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_autoconnect_disable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 关闭wifi重连
*
* @param[in] 无
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sta_powersaving(int</span> <span class="pre">ps)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 开启wifi sta省电模式
*
* @param[in] ps 0关闭省电模式
1开启省电模式
2动态切换模式
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_ap_sta_cnt_get(uint8_t</span> <span class="pre">*sta_cnt)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取ap模式下允许连接的sta个数
*
* @param[in] sta_cnt sta的个数
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_ap_sta_info_get(struct</span> <span class="pre">wifi_sta_basic_info</span> <span class="pre">*sta_info,</span> <span class="pre">uint8_t</span> <span class="pre">idx)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 获取ap模式下sta连接的信息
*
* @param[in] sta_info 存储sta的信息
* @param[in] idx sta编号
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sniffer_enable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 使能sniffer
*
* @param[in] 无
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sniffer_disable(void)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 失能sniffer
*
* @param[in] 无
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sniffer_register(void</span> <span class="pre">*env,</span> <span class="pre">sniffer_cb_t</span> <span class="pre">cb)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 注册sniffer注册之前需enable sniffer
*
* @param[in] env env
* @param[in] cb sniffer回调函数
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">wifi_mgmr_sniffer_unregister(void</span> <span class="pre">*env)</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/**
* function 注销sniffer注销之前需disable sniffer
*
* @param[in] env env
*
* @return 0成功, 其他:失败
*/
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,266 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1. arch &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
<link rel="next" title="2. helper" href="Command_line/helper.html" />
<link rel="prev" title="16. Easyflash4 boot times" href="../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">1. </span>arch</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/Components/arch.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="arch">
<h1><span class="section-number">1. </span>arch<a class="headerlink" href="#arch" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="Command_line/helper.html" class="btn btn-neutral float-right" title="2. helper" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html" class="btn btn-neutral float-left" title="16. Easyflash4 boot times" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,466 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2. BLFlashEnv &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="3. Freedom Studio" href="../freedom_studio/freedom_studio.html" />
<link rel="prev" title="1. Developer Environment" href="../Developer_Environment.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. BLFlashEnv</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#dev-cube">2.1. Dev Cube 简介</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id1">2.2. 镜像组成</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mcu">2.3. MCU程序下载</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">2.3.1. 配置程序下载方式</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">2.3.2. 配置镜像参数</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">2.3.3. 配置高级镜像参数</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id5">2.3.4. 下载程序</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#iot">2.4. IOT程序下载</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id6">2.4.1. 配置程序下载方式</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id7">2.4.2. 配置下载参数</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id8">2.4.3. 下载程序</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">2. </span>BLFlashEnv</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Developer_Environment/BLFlashEnv/BLFlashEnv.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="blflashenv">
<h1><span class="section-number">2. </span>BLFlashEnv<a class="headerlink" href="#blflashenv" title="永久链接至标题"></a></h1>
<div class="section" id="dev-cube">
<h2><span class="section-number">2.1. </span>Dev Cube 简介<a class="headerlink" href="#dev-cube" title="永久链接至标题"></a></h2>
<p>Dev Cube 是博流提供的芯片集成开发工具包含IOT程序下载、MCU程序下载和RF性能测试三种功能。本文档主要介绍IOT和MCU程序下载相关配置RF性能测试请参考《射频性能测试使用手册》。</p>
<p>Dev Cube 提供用户下载程序的功能并且支持时钟、flash等参数配置用户可根据自身需求决定是否对程序进行加密、添加签名、更换程序启动时的信息文件、用户资源文件、分区表等功能配置。</p>
<p>具体的功能如下:</p>
<ol class="arabic simple">
<li><p>支持IOT应用程序和MCU应用程序的下载</p></li>
<li><p>支持多种型号Flash 的擦、写、读;</p></li>
<li><p>可将各类文件下载到Flash并验证、回读</p></li>
<li><p>下载通讯接口支持 UART 和 JLink 两种方式。</p></li>
</ol>
<p>用户可以通过 <a class="reference external" href="https://dev.bouffalolab.com/download">Bouffalo Lab Dev Cube</a>获取最新版本的Dev Cube。
双击解压后文件夹中的<code class="docutils literal notranslate"><span class="pre">BLDevCube.exe</span></code>,在<code class="docutils literal notranslate"><span class="pre">Chip</span> <span class="pre">Selection</span></code>对话框中选择对应的芯片型号,点击<code class="docutils literal notranslate"><span class="pre">Finish</span></code>进入Dev Cube主界面。</p>
<div class="figure align-center" id="id9">
<img alt="../../_images/chipselection.png" src="../../_images/chipselection.png" />
<p class="caption"><span class="caption-text">芯片选择</span><a class="headerlink" href="#id9" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id1">
<h2><span class="section-number">2.2. </span>镜像组成<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>无论是IOT程序下载还是MCU程序下载它们的镜像组成是相同的都如下图所示</p>
<div class="figure align-center" id="id10">
<img alt="../../_images/tool2.png" src="../../_images/tool2.png" />
<p class="caption"><span class="caption-text">下载内容布局</span><a class="headerlink" href="#id10" title="永久链接至图片"></a></p>
</div>
<p>如果只下载应用程序无法使芯片正常工作必须要将引导信息下载到指定位置。引导信息包含对PLL、Boot、Flash等的配置固件是用户自己编写的应用程序。</p>
<p>以单核下载为例:根据需求选择对应的参数,将对PLL、Flash等配置的信息烧录到Bootinfo Addr对应的地址中将应用程序经过编译后的bin文件烧录到Image Addr对应的地址中。</p>
</div>
<div class="section" id="mcu">
<h2><span class="section-number">2.3. </span>MCU程序下载<a class="headerlink" href="#mcu" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">View</span></code>菜单中选择MCU选项会进入MCU程序下载界面主要分为程序下载方式的配置、镜像参数的配置和高级镜像参数的配置。</p>
<div class="section" id="id2">
<h3><span class="section-number">2.3.1. </span>配置程序下载方式<a class="headerlink" href="#id2" title="永久链接至标题"></a></h3>
<ul>
<li><p>配置参数包括:</p>
<blockquote>
<div><ul class="simple">
<li><p>Interface用于选择烧录的通信接口这里选择 Uart 进行下载</p></li>
<li><p>COM Port当选择 UART 进行下载的时候这里选择与芯片连接的 COM 口号,可以点击 Refresh 按钮进行 COM 号的刷新</p></li>
<li><p>Uart Speed当选择 UART 进行下载的时候填写波特率推荐下载频率2MHz,不宜过高</p></li>
<li><p>Chip Erase默认设置为False即下载时不擦除Flash</p></li>
<li><p>Xtal用于选择板子所使用的晶振类型。</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<div class="figure align-center" id="id11">
<img alt="../../_images/tool5.png" src="../../_images/tool5.png" />
<p class="caption"><span class="caption-text">MCU程序下载方式选择界面</span><a class="headerlink" href="#id11" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id3">
<h3><span class="section-number">2.3.2. </span>配置镜像参数<a class="headerlink" href="#id3" title="永久链接至标题"></a></h3>
<ul>
<li><p>配置参数包括:</p>
<blockquote>
<div><ul class="simple">
<li><p>Boot Source默认为Flash</p></li>
<li><p>BootInfo AddrFlash程序启动参数的存放地址填写0x0</p></li>
<li><p>Image Type默认为SingleCPU</p></li>
<li><p>Image Addr应用程序的存放地址建议填写0x2000或者0x2000以后的地址</p></li>
<li><p>Image File将编译生成的bin文件路径添加到Image File 中</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<div class="figure align-center" id="id12">
<img alt="../../_images/tool9.png" src="../../_images/tool9.png" />
<p class="caption"><span class="caption-text">镜像参数选择界面</span><a class="headerlink" href="#id12" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id4">
<h3><span class="section-number">2.3.3. </span>配置高级镜像参数<a class="headerlink" href="#id4" title="永久链接至标题"></a></h3>
<ul>
<li><p>当点击<code class="docutils literal notranslate"><span class="pre">click</span> <span class="pre">here</span> <span class="pre">to</span> <span class="pre">show</span> <span class="pre">advanced</span> <span class="pre">options</span></code>时,会展开高级镜像配置,可配置的参数包括:</p>
<blockquote>
<div><ul class="simple">
<li><p>Flash Clock默认为XTAL</p></li>
<li><p>PLL : PLL时钟配置默认为160M</p></li>
<li><p>CacheWayDis : 缓冲通道失能默认为none</p></li>
<li><p>Sign : 选择是否需要ECC校验默认为none</p></li>
<li><p>CrcIgnore : 是否需要CRC校验。当参数选择False时需要做CRC校验参数选择True时不需要做CRC校验</p></li>
<li><p>HashIgnore : 是否需要做Hash校验。当参数选择False时需要做Hash校验参数选择True时不需要做Hash校验</p></li>
<li><p>Encrypt : 选择加密方式并根据AES加密方式在AES Key 和AES IV中输入对应的值。</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<div class="figure align-center" id="id13">
<img alt="../../_images/tool10.png" src="../../_images/tool10.png" />
<p class="caption"><span class="caption-text">高级镜像参数选择界面</span><a class="headerlink" href="#id13" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id5">
<h3><span class="section-number">2.3.4. </span>下载程序<a class="headerlink" href="#id5" title="永久链接至标题"></a></h3>
<ul class="simple">
<li><p>将板子的BOOT引脚保持高电平并且使得芯片复位使其处于UART引导下载的状态。点击<code class="docutils literal notranslate"><span class="pre">Creat&amp;Program</span></code>会自动生成应用程序镜像和启动参数配置文件出现下图log信息程序下载成功</p></li>
</ul>
<div class="figure align-center" id="id14">
<img alt="../../_images/tool6.png" src="../../_images/tool6.png" />
<p class="caption"><span class="caption-text">下载程序</span><a class="headerlink" href="#id14" title="永久链接至图片"></a></p>
</div>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>若没有连接板子,只需生成应用程序镜像和启动参数配置文件,也是点击<code class="docutils literal notranslate"><span class="pre">Creat&amp;Program</span></code>按钮</p>
</div>
<ul class="simple">
<li><p>下载成功后将板子的BOOT引脚保持低电平并且使得芯片复位使其从Flash启动。此例子以2M波特率向PC端发送字符串报文</p></li>
</ul>
<div class="figure align-center" id="id15">
<img alt="../../_images/tool7.png" src="../../_images/tool7.png" />
<p class="caption"><span class="caption-text">log信息</span><a class="headerlink" href="#id15" title="永久链接至图片"></a></p>
</div>
</div>
</div>
<div class="section" id="iot">
<h2><span class="section-number">2.4. </span>IOT程序下载<a class="headerlink" href="#iot" title="永久链接至标题"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">View</span></code>菜单中选择IOT选项会进入IOT程序下载界面主要分为程序下载方式的配置和下载参数的配置。</p>
<div class="section" id="id6">
<h3><span class="section-number">2.4.1. </span>配置程序下载方式<a class="headerlink" href="#id6" title="永久链接至标题"></a></h3>
<ul>
<li><p>配置参数包括:</p>
<blockquote>
<div><ul class="simple">
<li><p>Interface用于选择烧录的通信接口这里选择 Uart 进行下载</p></li>
<li><p>COM Port: 当选择 UART 进行下载的时候这里选择与芯片连接的 COM 口号,可以点击 Refresh 按钮进行 COM 号的刷新</p></li>
<li><p>Uart Rate当选择 UART 进行下载的时候填写波特率推荐下载频率2MHz,不宜过高</p></li>
<li><p>Board选择所使用的板子型号这里选择 IoTKitA当板子选定后Xtal 会自动更新成与板子匹配的默认值,当然用户也是可以再次更改的</p></li>
<li><p>Xtal:选择下载时的晶振频率如果电路板没有焊接晶振此处应当选内部RC32M时钟源</p></li>
<li><p>Chip Erase 默认设置为False即下载时不擦除Flash</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<div class="figure align-center" id="id16">
<img alt="../../_images/iot1.png" src="../../_images/iot1.png" />
<p class="caption"><span class="caption-text">IOT程序下载方式选择界面</span><a class="headerlink" href="#id16" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id7">
<h3><span class="section-number">2.4.2. </span>配置下载参数<a class="headerlink" href="#id7" title="永久链接至标题"></a></h3>
<ul>
<li><p>配置参数包括:</p>
<blockquote>
<div><ul class="simple">
<li><p>Partition Table使用Dev Cube目录下对应芯片型号 partition 文件夹中的分区表默认选择2M的文件</p></li>
<li><p>Boot2 Bin:它是系统启动后运行的第一个Flash程序负责建立BLSP安全环境并引导主程序运行使用Dev Cube目录下对应芯片型号 builtin_imgs 文件夹中的 Boot2 文件</p></li>
<li><p>Firmware Bin用户编译生成的bin文件路径</p></li>
<li><p>Media/RomfsMedia和Romfs二选一如果勾选 Media选择的是文件如果勾选 Romfs则选择的是文件夹</p></li>
<li><p>MFG Bin选择MFG文件</p></li>
<li><p>AES-Encrypt如果使用加密功能需要将AES-Encrypt选项选中并在旁边的文本框中输入加密所使用的Key和IV。输入的是十六进制对应的“0”~“F”一个Byte由两个字符构成所以Key和IV分别要求输入32个字符。需要注意的是IV的最后8个字符即4Bytes必须全为0</p></li>
<li><p>Single Download Config勾选Enable后可下载单个文件在左侧文本框填写下载的起始地址以0x打头</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<div class="figure align-center" id="id17">
<img alt="../../_images/iot2.png" src="../../_images/iot2.png" />
<p class="caption"><span class="caption-text">下载参数选择界面</span><a class="headerlink" href="#id17" title="永久链接至图片"></a></p>
</div>
</div>
<div class="section" id="id8">
<h3><span class="section-number">2.4.3. </span>下载程序<a class="headerlink" href="#id8" title="永久链接至标题"></a></h3>
<ul class="simple">
<li><p>将板子的BOOT引脚保持高电平并且使得芯片复位使其处于UART引导下载的状态。点击<code class="docutils literal notranslate"><span class="pre">Creat&amp;Download</span></code>会自动生成应用程序镜像和启动参数配置文件出现下图log信息程序下载成功</p></li>
</ul>
<div class="figure align-center" id="id18">
<img alt="../../_images/iot3.png" src="../../_images/iot3.png" />
<p class="caption"><span class="caption-text">IOT下载程序</span><a class="headerlink" href="#id18" title="永久链接至图片"></a></p>
</div>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>若没有连接板子,只需生成应用程序镜像和启动参数配置文件,也是点击<code class="docutils literal notranslate"><span class="pre">Creat&amp;Program</span></code>按钮</p>
</div>
<ul class="simple">
<li><p>下载成功后将板子的BOOT引脚保持低电平并且使得芯片复位使其从Flash启动。此例子以2M波特率向PC端发送字符串报文</p></li>
</ul>
<div class="figure align-center" id="id19">
<img alt="../../_images/tool7.png" src="../../_images/tool7.png" />
<p class="caption"><span class="caption-text">log信息</span><a class="headerlink" href="#id19" title="永久链接至图片"></a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../freedom_studio/freedom_studio.html" class="btn btn-neutral float-right" title="3. Freedom Studio" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../Developer_Environment.html" class="btn btn-neutral float-left" title="1. Developer Environment" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,284 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1. Developer Environment &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
<link rel="next" title="2. BLFlashEnv" href="BLFlashEnv/BLFlashEnv.html" />
<link rel="prev" title="&lt;no title&gt;" href="../index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1. Developer Environment</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">1.1. 编译</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">1.2. 下载</a></li>
<li class="toctree-l2"><a class="reference internal" href="#debug">1.3. Debug</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">1. </span>Developer Environment</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/Developer_Environment/Developer_Environment.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="developer-environment">
<h1><span class="section-number">1. </span>Developer Environment<a class="headerlink" href="#developer-environment" title="永久链接至标题"></a></h1>
<p>此目录介绍编译或下载等工具的使用。</p>
<div class="section" id="id1">
<h2><span class="section-number">1.1. </span>编译<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>用户可以使用Linux平台或Windows平台进行编译具体使用方法参考 <a class="reference external" href="../Quickstart_Guide/Linux/Quickstart_Linux_ubuntu.html">Linux环境编译</a> , <a class="reference external" href="../Quickstart_Guide/Windows/Quickstart_Windows_msys.html">Windows环境编译</a></p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">1.2. </span>下载<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>用户可以使用BL自主开发的工具 <code class="docutils literal notranslate"><span class="pre">BLFlashEnv</span></code> 进行下载,具体使用方法参考 <a class="reference external" href="BLFlashEnv/BLFlashEnv.html">BLFlashEnv</a></p>
</div>
<div class="section" id="debug">
<h2><span class="section-number">1.3. </span>Debug<a class="headerlink" href="#debug" title="永久链接至标题"></a></h2>
<p>用户可以在 <code class="docutils literal notranslate"><span class="pre">Eclipse</span> <span class="pre">+</span> <span class="pre">OpenOCD</span></code><code class="docutils literal notranslate"><span class="pre">Freedom</span> <span class="pre">Studio</span> <span class="pre">+</span> <span class="pre">OpenOCD</span></code> 两种方式中选择一种方式进行debug。具体调试方法参考 <a class="reference external" href="eclipse/eclipse.html">Eclipse</a><a class="reference external" href="freedom_studio/freedom_studio.html">Freedom Studio</a></p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="BLFlashEnv/BLFlashEnv.html" class="btn btn-neutral float-right" title="2. BLFlashEnv" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../index.html" class="btn btn-neutral float-left" title="&lt;no title&gt;" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,322 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4. Eclipse &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="1. Helloword" href="../../Examples/helloworld/helloworld.html" />
<link rel="prev" title="3. Freedom Studio" href="../freedom_studio/freedom_studio.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">4. Eclipse</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">4.1. 导入工程</a></li>
<li class="toctree-l2"><a class="reference internal" href="#debug">4.2. Debug</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">4. </span>Eclipse</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Developer_Environment/eclipse/eclipse.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="eclipse">
<h1><span class="section-number">4. </span>Eclipse<a class="headerlink" href="#eclipse" title="永久链接至标题"></a></h1>
<p>本文档介绍Eclipse的使用。</p>
<div class="section" id="id1">
<h2><span class="section-number">4.1. </span>导入工程<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>首先启动 <code class="docutils literal notranslate"><span class="pre">eclipse</span></code> ,打开工具栏上的<code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">import</span></code>,选择<code class="docutils literal notranslate"><span class="pre">General</span></code>菜单下的<code class="docutils literal notranslate"><span class="pre">Existing</span> <span class="pre">Projects</span> <span class="pre">into</span> <span class="pre">Workspace</span></code>选项导入工程。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image01.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image02.png" />
</div>
</div>
<div class="section" id="debug">
<h2><span class="section-number">4.2. </span>Debug<a class="headerlink" href="#debug" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>首先让板子跑起来确认eclipse左上方的工具栏配置如下图1所示然后点击第一个红色框框起来的图标<code class="docutils literal notranslate"><span class="pre">debug</span></code>按钮eclipse会先编译工程完成后eclipse下方的 <code class="docutils literal notranslate"><span class="pre">Console</span></code> 窗口可以看到如下图2所示log。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image03.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image04.png" />
</div>
<ul class="simple">
<li><p>使用快捷键 <code class="docutils literal notranslate"><span class="pre">F8</span></code> resume一下可以看到程序停在 <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">bfl_main()</span></code> 主函数处此时可以点击下图中的3个按钮。其含义分别为</p>
<ul>
<li><p>第一个Step IntoF5 单步执行,遇到子函数就进入并且继续单步执行;</p></li>
<li><p>第二个Step Over F6在单步执行时在函数内遇到子函数时不会进入子函数内单步执行而是将子函数整个执行完在停止也就是把子函数整个作为一步</p></li>
<li><p>第三个Step ReturnF7在单步执行到子函数内时用Step Return就可以执行完子函数余下部分并返回上一层函数。</p></li>
</ul>
</li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image05.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image06.png" />
</div>
<ul class="simple">
<li><p>可以在 <code class="docutils literal notranslate"><span class="pre">c代码</span></code> 窗口最左边橙色条处双击增加、删除断点。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image08.png" />
</div>
<ul class="simple">
<li><p>还可以通过查看右边的 <code class="docutils literal notranslate"><span class="pre">Disassembly</span></code> 窗口查看对应的汇编(该窗口没有的话可以通过最上方工具栏 <code class="docutils literal notranslate"><span class="pre">Window</span> <span class="pre">&gt;</span> <span class="pre">show</span> <span class="pre">view</span> <span class="pre">&gt;</span> <span class="pre">Disassembly</span></code> 添加)。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image07.png" />
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../../Examples/helloworld/helloworld.html" class="btn btn-neutral float-right" title="1. Helloword" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../freedom_studio/freedom_studio.html" class="btn btn-neutral float-left" title="3. Freedom Studio" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,314 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3. Freedom Studio &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="4. Eclipse" href="../eclipse/eclipse.html" />
<link rel="prev" title="2. BLFlashEnv" href="../BLFlashEnv/BLFlashEnv.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">3. Freedom Studio</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">3.1. 导入工程</a></li>
<li class="toctree-l2"><a class="reference internal" href="#debug">3.2. Debug</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">3. </span>Freedom Studio</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Developer_Environment/freedom_studio/freedom_studio.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="freedom-studio">
<h1><span class="section-number">3. </span>Freedom Studio<a class="headerlink" href="#freedom-studio" title="永久链接至标题"></a></h1>
<p>本文档介绍Freedom Studio的使用。</p>
<div class="section" id="id1">
<h2><span class="section-number">3.1. </span>导入工程<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>首先启动 <code class="docutils literal notranslate"><span class="pre">Freedom</span> <span class="pre">Studio</span></code> ,打开工具栏上的<code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">import</span></code>,选择<code class="docutils literal notranslate"><span class="pre">General</span></code>菜单下的<code class="docutils literal notranslate"><span class="pre">Existing</span> <span class="pre">Projects</span> <span class="pre">into</span> <span class="pre">Workspace</span></code>选项导入工程。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image011.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image021.png" />
</div>
</div>
<div class="section" id="debug">
<h2><span class="section-number">3.2. </span>Debug<a class="headerlink" href="#debug" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>首先让板子跑起来,使用快捷键 <code class="docutils literal notranslate"><span class="pre">F11</span></code> 启动 DebugFreedom Studio会先编译工程(注意使用快捷键时确认使用的.launch文件名是bl_iot_sdk_debug_freedom_studio.launch可以通过工具栏 Run &gt; Debug As &gt; 进行查看)</p></li>
<li><p>使用快捷键 <code class="docutils literal notranslate"><span class="pre">F8</span></code> resume一下可以看到程序停在 <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">bfl_main()</span></code> 主函数处此时可以点击下图中的3个按钮。其含义分别为</p>
<ul>
<li><p>第一个Step IntoF5 单步执行,遇到子函数就进入并且继续单步执行;</p></li>
<li><p>第二个Step Over F6在单步执行时在函数内遇到子函数时不会进入子函数内单步执行而是将子函数整个执行完在停止也就是把子函数整个作为一步</p></li>
<li><p>第三个Step ReturnF7在单步执行到子函数内时用Step Return就可以执行完子函数余下部分并返回上一层函数。</p></li>
</ul>
</li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image051.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image061.png" />
</div>
<ul class="simple">
<li><p>可以在 <code class="docutils literal notranslate"><span class="pre">c代码</span></code> 窗口最左边橙色条处双击增加、删除断点。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image081.png" />
</div>
<ul class="simple">
<li><p>还可以通过查看右边的 <code class="docutils literal notranslate"><span class="pre">Disassembly</span></code> 窗口查看对应的汇编(该窗口没有的话可以通过最上方工具栏 <code class="docutils literal notranslate"><span class="pre">Window</span> <span class="pre">&gt;</span> <span class="pre">show</span> <span class="pre">view</span> <span class="pre">&gt;</span> <span class="pre">Disassembly</span></code> 添加)。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/image071.png" />
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../eclipse/eclipse.html" class="btn btn-neutral float-right" title="4. Eclipse" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../BLFlashEnv/BLFlashEnv.html" class="btn btn-neutral float-left" title="2. BLFlashEnv" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,255 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>openocd &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Examples/sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>openocd</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Developer_Environment/openocd/openocd.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="openocd">
<h1>openocd<a class="headerlink" href="#openocd" title="永久链接至标题"></a></h1>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,256 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Examples &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li>Examples</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/Examples/README.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="examples">
<h1>Examples<a class="headerlink" href="#examples" title="永久链接至标题"></a></h1>
<p>该目录包含一系列示例项目的介绍与使用,这些旨在演示bl_iot模块功能的一部分。</p>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,319 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AES-GCM &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>AES-GCM</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/benchmark_security_aes/benchmark_security_aes_gcm.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="aes-gcm">
<span id="aes-gcm-index"></span><h1>AES-GCM<a class="headerlink" href="#aes-gcm" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>AES是一种对称加密算法它的相关概念在此不赘述本文档主要介绍AES-GCM的原理和实现。</p>
<p>GCM ( Galois/Counter Mode) 指的是该对称加密采用Counter模式并带有GMAC消息认证码。
在详细介绍AES-GCM之前我们先了解一些相关概念。</p>
</div>
<div class="section" id="ctr-counter">
<h2>CTRCounTeR<a class="headerlink" href="#ctr-counter" title="永久链接至标题"></a></h2>
<blockquote>
<div><p>在CTR模式下我们对一个逐次累加的计数器进行加密用加密后的比特序列与明文分组进行异或得到密文。过程如下图</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image12.png" />
</div>
</div></blockquote>
</div></blockquote>
<p>其中, IV为初始化向量Ek表示ECB文本加密PT表示输入的明文CT表示输出的密文。</p>
<p>在BL602中我们可以直接使用硬件完成CTR算法即设置key密钥后输入IV以及需要加密的明文硬件会自动完成累加计数加密并输出密文。</p>
<p>CTR模式的优点是
1支持加解密并行计算可事先进行加解密准备
2错误密文中的对应比特只会影响明文中的对应比特。
但是它不能提供密文消息完整性校验的功能。</p>
</div>
<div class="section" id="mac-message-authentication-code">
<h2>MACMessage Authentication Code<a class="headerlink" href="#mac-message-authentication-code" title="永久链接至标题"></a></h2>
<p>想要校验消息的完整性,必须引入另一个概念:消息验证码。消息验证码是一种与秘钥相关的单项散列函数,过程如下图所示:</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image21.png" />
</div>
</div></blockquote>
<p>密文的收发双发需要提前共享一个秘钥。密文发送者将密文的MAC值随密文一起发送密文接收者通过共享秘钥计算收到密文的MAC值
这样就可以对收到的密文做完整性校验。当篡改者篡改密文后没有共享秘钥就无法计算出篡改后的密文的MAC值。</p>
</div>
<div class="section" id="gmac-galois-message-authentication-code-mode">
<h2>GMACGalois message authentication code mode<a class="headerlink" href="#gmac-galois-message-authentication-code-mode" title="永久链接至标题"></a></h2>
<p>对应到上图中的消息认证码GMAC就是利用伽罗华域(Galois FieldGF有限域)乘法运算来计算消息的MAC值。
假设秘钥长度为128bits, 当密文大于128bits时需要将密文按128bits进行分组。应用流程如下图</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image3.png" />
</div>
</div></blockquote>
<p>其中msg为需要验证的消息Mh表示在有限域上做乘法运算MAC即为生成的验证码。</p>
<p>在BL602中我们可以直接使用硬件完成GMAC验证。</p>
</div>
<div class="section" id="gcm-galois-counter-mode">
<h2>GCM Galois/Counter Mode )<a class="headerlink" href="#gcm-galois-counter-mode" title="永久链接至标题"></a></h2>
<p>GCM中的G就是指GMACC就是指CTR。于是将CTR算法加上GMAC验证就是AES-GCM模式了。过程如下图所示</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image4.png" />
</div>
</div></blockquote>
</div>
<div class="section" id="id2">
<h2>具体实现<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>具体代码实现大体如下图所示:</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image5.png" />
</div>
</div></blockquote>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,287 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AUDIO UDP &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>AUDIO UDP</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_audio_udp/audio_udp.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="audio-udp">
<span id="audio-udp-index"></span><h1>AUDIO UDP<a class="headerlink" href="#audio-udp" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍使用手机wifi连接602开发板通过UDP传输语音播报收款</p>
</div>
<div class="section" id="id2">
<h2>使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/sdk_app_audio_udp</span></code> 工程勾选烧录软件中的romfs选项</p></li>
</ul>
<p>然后选中处理后的音频文件所在的文件夹并下载工程,如图所示:</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image13.png" />
</div>
</div></blockquote>
<ul>
<li><p>板子启动后会自动开启wifi,名称为“BL60X_uAP_827302”使用手机连接该wifi如图所示</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image22.png" />
</div>
</div></blockquote>
</li>
<li><p>打开微信小程序IP地址设置为“192.168.169.1”端口为“5002”注意此时可能需要关闭数据流量</p></li>
</ul>
<p>输入需要发送播报的数字,点击“发送即可”,如图所示:</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image31.png" />
</div>
</div></blockquote>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,304 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2. aws &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="3. GPIO" href="../demo_peripherals_gpio/GPIO.html" />
<link rel="prev" title="1. Helloword" href="../helloworld/helloworld.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. aws</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">2.1. 总览</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">2.2. 使用步骤</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">2. </span>aws</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_aws/aws.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="aws">
<span id="aws-index"></span><h1><span class="section-number">2. </span>aws<a class="headerlink" href="#aws" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">2.1. </span>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍如何使用aws。</p>
</div>
<div class="section" id="id2">
<h2><span class="section-number">2.2. </span>使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">customer_app/bl602_demo_ble_pds/bl602_demo_ble_pds/aws_iot_main.c</span></code> 文件的头部有相关证书及配置,此处的配置只限于本示例演示使用(同时只能一处使用),用户需要根据实际情况修改文件开头的宏定义,下图是配置的一部分</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image14.png" />
</div>
</div></blockquote>
</li>
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/bl602_demo_event</span></code> 工程并下载工程;</p></li>
<li><p>在终端输入开启wifi的命令 <code class="docutils literal notranslate"><span class="pre">stack_wifi</span></code> 输入连接wifi的命令 <code class="docutils literal notranslate"><span class="pre">wifi_sta_connect</span> <span class="pre">&lt;name&gt;</span> <span class="pre">&lt;key&gt;</span></code> 并确认wifi连接成功如输入wifi_sta_connect bl_test_005 12345678</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image23.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image32.png" />
</div>
</div></blockquote>
</li>
<li><p>在终端输入 <code class="docutils literal notranslate"><span class="pre">aws</span></code> 不断打印如下图所示log即表明连接成功。</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image41.png" />
</div>
</div></blockquote>
</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../demo_peripherals_gpio/GPIO.html" class="btn btn-neutral float-right" title="3. GPIO" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../helloworld/helloworld.html" class="btn btn-neutral float-left" title="1. Helloword" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,395 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>15. BLSYNC-BLE &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="16. Easyflash4 boot times" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html" />
<link rel="prev" title="14. Mesh" href="../demo_mesh/mesh.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">15. BLSYNC-BLE</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">15.1. 总览</a></li>
<li class="toctree-l2"><a class="reference internal" href="#app">15.2. APP使用步骤</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">15.3. 微信小程序使用步骤</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">15. </span>BLSYNC-BLE</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_blsync_ble/blsync_ble.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="blsync-ble">
<span id="blsync-ble-index"></span><h1><span class="section-number">15. </span>BLSYNC-BLE<a class="headerlink" href="#blsync-ble" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">15.1. </span>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍如何使用ble进行wifi配网。</p>
</div>
<div class="section" id="app">
<h2><span class="section-number">15.2. </span>APP使用步骤<a class="headerlink" href="#app" title="永久链接至标题"></a></h2>
<ul>
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/sdk_app_ble_sync</span></code> 工程并下载工程固件;</p></li>
<li><p>固件上电运行会自动开启ble广播等待手机APP连接配网如下所示</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image110.png" />
</div>
</div></blockquote>
</li>
<li><p>打开手机APP搜索蓝牙设备搜索到设备名“BL602-BLE-DEV”</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image210.png" />
</div>
</div></blockquote>
</li>
<li><p>点击连接设备后点击APP中的扫描等待数秒后APP会显示开发板扫描到的wifi设备列表</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image39.png" />
</div>
<div class="figure align-default">
<img alt="" src="../../_images/image43.png" />
</div>
</div></blockquote>
</li>
<li><p>用户可以通过扫描出来的设备列表对进行需要配网的wifi进行连接</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image52.png" />
</div>
</div></blockquote>
</li>
<li><p>当用户确定配网完成时不需要再使用配网功能可以使用“blsync_ble_stop”命令将其关闭。</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image61.png" />
</div>
</div></blockquote>
</li>
</ul>
</div>
<div class="section" id="id2">
<h2><span class="section-number">15.3. </span>微信小程序使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul>
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/sdk_app_ble_sync</span></code> 工程并下载工程固件;</p></li>
<li><p>固件上电运行会自动开启ble广播等待手机APP连接配网如下所示</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image110.png" />
</div>
</div></blockquote>
</li>
<li><p>打开微信小程序搜索蓝牙设备搜索到设备名“BL602-BLE-DEV”</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image71.png" />
</div>
</div></blockquote>
</li>
<li><p>点击“BL602-BLE-DEV”连接设备连接上设备BLE后会获取到BLE的服务点击第一个服务再选择“写通知“</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image81.png" />
</div>
</div></blockquote>
</li>
<li><p>点击小程序中的”点击配网“小程序会回显获取到的wifi列表</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image91.png" />
</div>
</div></blockquote>
</li>
<li><p>用户可以通过扫描出来的设备列表对进行需要配网的wifi进行连接点击需要连接的wifi名称</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image101.png" />
</div>
</div></blockquote>
</li>
<li><p>接着在输入框输入wifi密码点击”发送密码“即可连接wifi</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image112.png" />
</div>
</div></blockquote>
</li>
<li><p>点击小程序中的”获取状态“按钮获取wifi当前的连接状态</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image122.png" />
</div>
</div></blockquote>
</li>
<li><p>当前已经连接wifi则会显示”已经连接“并弹出板子的ip地址等信息</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image132.png" />
</div>
</div></blockquote>
</li>
<li><p>点击”断开wifi“按钮即可断开wifi再次点击”获取状态“按钮可以获取当前wifi已经断开</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image142.png" />
</div>
</div></blockquote>
</li>
<li><p>当用户确定配网完成时不需要再使用配网功能可以使用“blsync_ble_stop”命令将其关闭。</p>
<blockquote>
<div><div class="figure align-default">
<img alt="" src="../../_images/image61.png" />
</div>
</div></blockquote>
</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html" class="btn btn-neutral float-right" title="16. Easyflash4 boot times" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right"></span></a>
<a href="../demo_mesh/mesh.html" class="btn btn-neutral float-left" title="14. Mesh" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,315 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>cronalarm &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>cronalarm</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_cronalarm/cronalarm.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="cronalarm">
<span id="cronalarm-index"></span><h1>cronalarm<a class="headerlink" href="#cronalarm" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍如何配置cronalarm</p>
</div>
<div class="section" id="id2">
<h2>使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>使用步骤:</p>
<ul>
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/sdk_app_cronalarm</span></code> 工程并下载工程;</p></li>
<li><p>在main.c中有相关头文件的使用main.c中aos_loop_proc 中有cronalarm相关的初始化。使用cronalarm 需要包含头文件cronalarms.h 。</p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="id3">
<h2>应用实例<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<ul>
<li><p>命令解析</p></li>
<li><img alt="" src="../../_images/01.png" />
</li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cron_alarm_create(&quot;0 30 8 * * *&quot;, MorningAlarm, 0);
每日 8:30:0 调用MorningAlarm ;
cron_alarm_create(&quot;0 30 8 * * *&quot;, MorningAlarm, 1)
仅在将要到来的8:30:0 调用一次MorningAlarm. ;
cron_alarm_create(&quot;0 15 9 * * 6&quot;, WeeklyAlarm, 0)
每周六的9:15:0 调用WeeklyAlarm。;
cron_alarm_create(&quot;*/15 * * * * *&quot;, Repeats, 0);
每15s调用一次Repeats;
cron_alarm_create(&quot;*/10 * * * * *&quot;, OnceOnly, 1);
在创建之后时钟的下一个秒达到10的倍数时将调用afterOnly函数。 且仅执行一次。
create(&quot;0 0 12 4 7 *&quot;, Celebration, 0);
每年的 7月4日 12:0:0 调用Celebration函数。
cron_alarm_create(&quot;0 */1 * * * *&quot;, test_min02, 0);
每分钟的 0s 调用test_min02
cron_alarm_create(&quot;15 15 */4 * * *&quot;, test_hour02, 0);
每4小时 15分15秒调用test_hour02
cron_alarm_create(&quot;1-10/1 * * * * *&quot;, Repeats, 0);
每分钟的前10s,每秒钟执行一次Repeats.
cron_alarm_create(&quot;0 0 0 */1 * ?&quot;, test_day01, 0);
每天的 0:0:0 执行一次test_day01
cron_alarm_create(&quot;0 0 0 * * MON,WED,FRI&quot;, test_week01, 0);
每周的周一周三周五触发一次test_week01
cron_alarm_create(&quot;11 23 1 1 JAN-FEB *&quot;, test_month02, 0);
每年的一月二月 day1 01:23:11 触发test_month02.
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,272 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DAC &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>DAC</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_dac/DAC.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="dac">
<span id="dac-index"></span><h1>DAC<a class="headerlink" href="#dac" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍如何使用iot板子的DAC播放音乐</p>
</div>
<div class="section" id="id2">
<h2>使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>编译 <code class="docutils literal notranslate"><span class="pre">customer_app/sdk_app_dac</span></code> 工程并下载工程;
烧写的时候将 audio_32k 音频文件烧写进去romfs。</p></li>
</ul>
<div class="figure align-default">
<img alt="" src="../../_images/dac.png" />
</div>
<p>应用实例:
将工程和音频文件烧写进入后。重启板子。在shell界面 输入play_audio 则可以听到音乐。</p>
<p>NOTE:烧写romfs,是将一个文件夹的所有内容写入。请确保该文件夹中仅有audio_32k 这一个文件。</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -1,272 +0,0 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HBNRAM &mdash; BL602 IoT SDK release_bl_iot_sdk_1.6.11-1-g66bb28da 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home" alt="Documentation Home"> BL602 IoT SDK
</a>
<div class="version">
release_bl_iot_sdk_1.6.11-1-g66bb28da
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="在文档中搜索" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer_Environment</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/Developer_Environment.html">1. Developer Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/BLFlashEnv/BLFlashEnv.html">2. BLFlashEnv</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/freedom_studio/freedom_studio.html">3. Freedom Studio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Developer_Environment/eclipse/eclipse.html">4. Eclipse</a></li>
</ul>
<p class="caption"><span class="caption-text">Examples</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helloworld/helloworld.html">1. Helloword</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_aws/aws.html">2. aws</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_gpio/GPIO.html">3. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_echo/uart_echo.html">4. UART_echo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_peripherals_uart_ioctl/uart_ioctl.html">5. UART_ioctl</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_http/http.html">6. Http client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_protocols_httpc/httpc.html">7. Httpc client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_psm/psm.html">8. PSM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_storage_romfs/romfs.html">9. Romfs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_cli/cli.html">10. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_system_fdt/fdt.html">11. FDT</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_wifi/wifi.html">12. WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_ble/ble.html">13. BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_mesh/mesh.html">14. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../demo_blsync_ble/blsync_ble.html">15. BLSYNC-BLE</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sdk_app_easyflash_boottimes/easyflash_boottimes.html">16. Easyflash4 boot times</a></li>
</ul>
<p class="caption"><span class="caption-text">Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../Components/arch.html">1. arch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/helper.html">2. helper</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Command_line/aos_cli.html">3. cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Hal_drv/gpio.html">4. GPIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/bloop/bloop.html">5. BLOOP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/blsync/blsync.html">6. BLSYNC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/dts/devicetree.html">7. device tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/log/blog.html">8. blog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/security/security.html">9. Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/vfs/vfs.html">10. AOS VFS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Middleware/yloop/yloop.html">11. yloop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/httpc/httpc.html">12. HTTPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/https/https.html">13. HTTPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/Network/tls/tls.html">14. TLS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/provision_WiFi/provision_WiFi.html">15. Provision_WiFi</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/mesh/mesh.html">16. Mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../Components/BLE/ble_stack/ble_stack.html">17. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../API/sys/cronalarms.html">1. cronalarms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../API/wifi/wifi_mgmr.html">2. Wi-Fi Manager</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL602 IoT SDK</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li>HBNRAM</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/Examples/demo_hbnram/hbnram.rst.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="hbnram">
<span id="hbnram-index"></span><h1>HBNRAM<a class="headerlink" href="#hbnram" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2>总览<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>本示例主要介绍如何使用hbnram的api</p>
</div>
<div class="section" id="id2">
<h2>使用步骤<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>1.首先进行初始化.调用hal_hbnram_init(void)进行初始化hbnram。如果是断电重启则会清空hbnram,如果是不断点的reboot,则仅校验数据。
2.hal_hbnram_alloc(const char <a href="#id3"><span class="problematic" id="id4">*</span></a>key, int len),key 必须是const char 类型的字符串且必须小于4个字符。len是要申请的内存的长度。
3.hal_hbnram_buffer_set(const char <a href="#id5"><span class="problematic" id="id6">*</span></a>key, uint8_t <a href="#id7"><span class="problematic" id="id8">*</span></a>buf, int length)把数据一次写入申请的buff.
4.hal_hbnram_buffer_get(const char <a href="#id9"><span class="problematic" id="id10">*</span></a>key, uint8_t <a href="#id11"><span class="problematic" id="id12">*</span></a>buf, int length)把数据一次从buff读出
5.hal_hbnram_handle_get_fromkey(const char <a href="#id13"><span class="problematic" id="id14">*</span></a>key, hbnram_handle_t <a href="#id15"><span class="problematic" id="id16">*</span></a>handle);如果需要流读写需要首先根据key获取hanlde.
6.hal_hbnram_copy_from_stream(hbnram_handle_t <a href="#id17"><span class="problematic" id="id18">*</span></a>handle, uint8_t <a href="#id19"><span class="problematic" id="id20">*</span></a>buf, int len);流读出
7.hal_hbnram_copy_to_stream(hbnram_handle_t <a href="#id21"><span class="problematic" id="id22">*</span></a>handle, uint8_t <a href="#id23"><span class="problematic" id="id24">*</span></a>buf, int len); 流写入</p>
<p>具体使用方式参考 sdk_app_hbnram下的demo.c</p>
<p>应用实例:
将工程sdk_app_hbnram 编译,烧写进入板子。重启板子。</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 版权所有 2020, Bouffalo Lab
</p>
</div>
利用 <a href="http://sphinx-doc.org/">Sphinx</a> 构建,使用了
<a href="https://github.com/rtfd/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a>开发.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More