pull/123/head
Hieromon Ikasamo 6 years ago
parent 2d2819a7fa
commit 73d3502ab5
  1. 10
      mkdocs/achandling.md
  2. 2
      mkdocs/acupload.md
  3. 6
      mkdocs/apiaux.md
  4. 2
      src/AutoConnectAux.cpp
  5. 2
      src/AutoConnectElement.h
  6. 2
      src/AutoConnectUpdate.h

@ -13,10 +13,10 @@ The AutoConnectAux class has several functions to manipulate AutoConnectElements
To add AutoConnectElment(s) to an AutoConnectAux object, use the add function.
```cpp
void AutoConnectAux::add(AutoConenctElement& addon)
void AutoConnectAux::add(AutoConnectElement& addon)
```
```cpp
void AutoConnectAux::add(AutoConenctElementVT addons)
void AutoConnectAux::add(AutoConnectElementVT addons)
```
The add function adds the specified AutoConnectElement to AutoConnectAux. The AutoConnectElementVT type is the [*std::vector*](https://en.cppreference.com/w/cpp/container/vector) of the [*reference wrapper*](https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper) to AutoConnectElements, and you can add these elements in bulk by using the [*list initialization*](https://en.cppreference.com/w/cpp/language/list_initialization) with the sketch.
@ -70,7 +70,7 @@ AutoConnectElement* AutoConnectAux::getElement(const String& name)
```
```cpp
T& AutoConenctAux::getElement<T>(const String& name)
T& AutoConnectAux::getElement<T>(const String& name)
```
```cpp
@ -108,10 +108,10 @@ The AutoConnectElement type behaves as a variant of other element types. Therefo
```cpp
const String auxJson = String("{\"title\":\"Page 1 title\",\"uri\":\"/page1\",\"menu\":true,\"element\":[{\"name\":\"caption\",\"type\":\"ACText\",\"value\":\"hello, world\"}]}");
AutoConenct portal;
AutoConnect portal;
portal.load(auxJson);
AutoConnectAux* aux = portal.aux("/page1"); // Identify the AutoConnectAux instance with uri
AutoConenctText& text = aux->getElement<AutoConnectText>("caption"); // Cast to real type and access members
AutoConnectText& text = aux->getElement<AutoConnectText>("caption"); // Cast to real type and access members
Serial.println(text.value);
```

@ -125,7 +125,7 @@ The AutoConnect built-in upload handler can save the upload file to three locati
2. SD device externally connected to the ESP8266/ESP32 module
3. Other character devices
You can specify the device type to save with the [**store**](acelements.md#store) attribute of AutoConenctFile, and it accepts the following values:
You can specify the device type to save with the [**store**](acelements.md#store) attribute of AutoConnectFile, and it accepts the following values:
- Flash : `AC_File_FS` for the API parameter or `fs` for the JSON document
- SD : `AC_File_SD` for the API parameter or `sd` for the JSON document

@ -195,7 +195,7 @@ Load specified element from JSON document into AutoConnectAux. The JSON document
```cpp
void menu(const bool post)
```
Set or reset the display as menu item for this AutoConnectAux. This function programmatically manipulates the menu parameter of the [AutoConenctAux constructor](apiaux.md#autoconnectaux).
Set or reset the display as menu item for this AutoConnectAux. This function programmatically manipulates the menu parameter of the [AutoConnectAux constructor](apiaux.md#autoconnectaux).
<dl class="apidl">
<dt>**Parameter**</dt>
<dd><span class="apidef">true</span><span class="apidesc">Show on the menu.</span></dd>
@ -255,7 +255,7 @@ typedef struct {
```cpp
bool release(const String& name)
```
Release a specified AutoConnectElement from AutoConenctAux. The release function is provided to dynamically change the structure of the custom Web pages with the sketch. By combining the release function and the [add](apiaux.md#add) function or the [loadElement](apiaux.md#loadelement) function, the sketch can change the style of the custom Web page according to its behavior.
Release a specified AutoConnectElement from AutoConnectAux. The release function is provided to dynamically change the structure of the custom Web pages with the sketch. By combining the release function and the [add](apiaux.md#add) function or the [loadElement](apiaux.md#loadelement) function, the sketch can change the style of the custom Web page according to its behavior.
<dl class="apidl">
<dt>**Parameter**</dt>
<dd><span class="apidef">name</span><span class="apidesc">Specifies the name of AutoConnectElements to be released.</span></dd>
@ -269,7 +269,7 @@ Release a specified AutoConnectElement from AutoConenctAux. The release function
```cpp
size_t saveElement(Stream& out, std::vector<String> const& names = {})
```
Write elements of AutoConnectAux to the stream. The saveElement function outputs the specified AutoConenctElements as a JSON document using the [prettyPrintTo](https://arduinojson.org/v5/api/jsonobject/prettyprintto/) function of the [ArduinoJson](https://arduinojson.org/) library.
Write elements of AutoConnectAux to the stream. The saveElement function outputs the specified AutoConnectElements as a JSON document using the [prettyPrintTo](https://arduinojson.org/v5/api/jsonobject/prettyprintto/) function of the [ArduinoJson](https://arduinojson.org/) library.
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">out</span><span class="apidesc">Output stream to be output. SPIFFS, SD also Serial can be specified generally.</span></dd>

@ -327,7 +327,7 @@ void AutoConnectAux::_concat(AutoConnectAux& aux) {
/**
* Register the AutoConnect that owns itself.
* AutoConenctAux needs to access the AutoConnect member. Also
* AutoConnectAux needs to access the AutoConnect member. Also
* AutoConnectAux is cataloged by chain list. The _join function
* registers AutoConnect in the following AutoConnectAux chain list.
* @param ac A reference of AutoConnect.

@ -8,7 +8,7 @@
*/
#ifndef _AUTOCONNECTELEMENT_H_
#define _AUTOCONENCTELEMENT_H_
#define _AUTOCONNECTELEMENT_H_
#include "AutoConnectElementBasis.h"
#ifdef AUTOCONNECT_USE_JSON

@ -136,7 +136,7 @@ class AutoConnectUpdateAct : public AutoConnectUpdateVoid, public HTTPUpdateClas
// Attribute definition of the element to be placed on the update page.
typedef struct {
const ACElement_t type;
const char* name; /**< Name to assign to AutoConenctElement */
const char* name; /**< Name to assign to AutoConnectElement */
const char* value; /**< Value owned by an element */
const char* peculiar; /**< Specific ornamentation for the element */
} ACElementProp_t;

Loading…
Cancel
Save