diff --git a/source/amebad/API_Documents/OTA/Class OTA.rst b/source/amebad/API_Documents/OTA/Class OTA.rst new file mode 100644 index 0000000..25e0d43 --- /dev/null +++ b/source/amebad/API_Documents/OTA/Class OTA.rst @@ -0,0 +1,105 @@ +Class OTA +========= + +.. contents:: + :local: + :depth: 2 + +**OTA Class** +------------- + +**Description** +~~~~~~~~~~~~~~~ + +A class used for updating firmware Over the Air (OTA) in local area network. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + class OTA + +**Members** +~~~~~~~~~~~ + ++------------------------------------------+-------------------------------------------------+ +| **Public Constructors** | ++==========================================+=================================================+ +| A public constructor should not be used as this class is intended to be a singleton class. | +| Access member functions using the object instance named OTA. | ++------------------------------------------+-------------------------------------------------+ +| **Public Methods** | ++------------------------------------------+-------------------------------------------------+ +| OTA::beginOTA | Starts to connect to MDNS OTA server | +| | and receive the new firmware. | +| | | ++------------------------------------------+-------------------------------------------------+ +| OTA::start_OTA_threads | Starts multithreading tasks to connect | +| | to HTTP OTA server and receive new firmware | +| | upon triggered. | ++------------------------------------------+-------------------------------------------------+ + +**OTA::beginOTA** +----------------- + +**Description** +~~~~~~~~~~~~~~~ + +Starts the connect of OTA server and waiting to receive the new OTA firmware sending from the OTA client via TCP socket. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void beginOTA(int port); + +**Parameters** +~~~~~~~~~~~~~~ + +port: port number for the OTA MDNS IP address, default port address is 8082. + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `OTA_Basic `_ + +.. note :: Configures and registers the MDNS service required for the Arduino IDE to discover and recognize Ameba OTA. "OTA.h" must be included to use the class function. + +**OTA::start_OTA_threads** +-------------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Starts the connect of OTA server and waiting to receive the new OTA firmware sending from the OTA client via TCP socket. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void start_OTA_threads(int port, char *server); + +**Parameters** +~~~~~~~~~~~~~~ + +port: port number for the OTA HTTP server IP address, default port address is 3000. + +\*server: pointer for OTA HTTP server IP address. + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `OTA_Http `_ diff --git a/source/amebad/API_Documents/OTA/index.rst b/source/amebad/API_Documents/OTA/index.rst new file mode 100644 index 0000000..25cd22a --- /dev/null +++ b/source/amebad/API_Documents/OTA/index.rst @@ -0,0 +1,7 @@ +OTA +=== + +.. toctree:: + :maxdepth: 1 + + Class OTA \ No newline at end of file diff --git a/source/amebad/API_Documents/index.rst b/source/amebad/API_Documents/index.rst new file mode 100644 index 0000000..ebc4501 --- /dev/null +++ b/source/amebad/API_Documents/index.rst @@ -0,0 +1,7 @@ +API Documents +============= + +.. toctree:: + :maxdepth: 1 + + OTA/index \ No newline at end of file diff --git a/source/amebad/index.rst b/source/amebad/index.rst index abf6d81..320e0c0 100644 --- a/source/amebad/index.rst +++ b/source/amebad/index.rst @@ -6,6 +6,7 @@ AmebaD Arduino :maxdepth: 2 Example_Guides/index + API_Documents/index SDK Source Code ---------------