Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation fixes #2116

Merged
merged 8 commits into from
Oct 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixes from final readthrough
  • Loading branch information
mikee47 committed Oct 19, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit df1cc8913b0c4d56de5857ce216aded0740f92cb
4 changes: 4 additions & 0 deletions Sming/Arch/Esp32/Components/esp_idf/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ESP IDF
=======

Provides make targets which are redirected to the ESP IDF.
4 changes: 4 additions & 0 deletions Sming/Arch/Esp32/Components/esp_spiffs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Esp32 SPIFFS
============

SPIFFS implementation for ESP32 devices.
26 changes: 18 additions & 8 deletions Sming/Components/ssl/adapter.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
Adapter API
===========
SSL Adapter API
===============

These classes provide the interface between a :cpp:class:`Ssl::Session` and an appropriate adapter.

*
* Returned `int` error codes are 0 for success, or < 0 for error.
*
* The error codes themselves are implementation-specific.
* Use `getErrorString()` to obtain the message.
* SSL `Alerts` are also reported via error codes. Use `getAlert`

Error codes
-----------

Error codes are implementation specific, however 0 always indicates success and < 0 for error.

To obtain a description for an error code, use :cpp:func:`Ssl::Connection::getErrorString`.

SSL `Alerts` are reported via error codes. To obtain the alert code call
:cpp:func:`Ssl::Connection::getAlert` which returns an :cpp:enum:`Ssl::Alert` code.
If the error code is not an alert then ``Alert::INVALID`` is returned.

.. doxygenenum:: Ssl::Alert


Classes
-------

.. doxygenclass:: Ssl::Factory
:members:
3 changes: 2 additions & 1 deletion Sming/Components/ssl/include/Network/Ssl/Alert.h
Original file line number Diff line number Diff line change
@@ -44,9 +44,10 @@ namespace Ssl

/**
* @brief Alert codes defined by the standard
* @see See https://tools.ietf.org/html/rfc8446#page-85
*/
enum class Alert {
Invalid = -1,
Invalid = -1, ///< Not an alert code
#define XX(tag, code) tag = code,
SSL_ALERT_CODE_MAP(XX)
#undef XX
1 change: 0 additions & 1 deletion Sming/Components/ssl/session.rst
Original file line number Diff line number Diff line change
@@ -11,4 +11,3 @@ Session
:members:

.. doxygenenum:: MaxBufferSize
:members:
2 changes: 1 addition & 1 deletion Sming/Core/Data/Stream/MemoryDataStream.h
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@

#include "ReadWriteStream.h"

/*
/**
* @brief Read/write stream using expandable memory buffer
*
* This is intended to allow data to be streamed into it, then streamed back out at a later date.
7 changes: 7 additions & 0 deletions Sming/Core/Network/Http/HttpBodyParser.h
Original file line number Diff line number Diff line change
@@ -15,6 +15,11 @@
#include "HttpCommon.h"
#include "HttpRequest.h"

/**
* @ingroup http
* {
*/

/** @brief special length values passed to parse functions */
const int PARSE_DATASTART = -1; ///< Start of incoming data
const int PARSE_DATAEND = -2; ///< End of incoming data
@@ -47,3 +52,5 @@ size_t formUrlParser(HttpRequest& request, const char* at, int length);
* @note The content later can be retrieved by calling request.getBody()
*/
size_t bodyToStringParser(HttpRequest& request, const char* at, int length);

/** @} */
12 changes: 11 additions & 1 deletion Sming/Core/Network/Http/HttpCommon.h
Original file line number Diff line number Diff line change
@@ -31,8 +31,16 @@

#include "http-parser/http_parser.h"

typedef enum http_method HttpMethod;
/**
* @ingroup http
* {
*/

using HttpMethod = enum http_method;

/**
* @brief Identifies current state for an HTTP connection
*/
enum HttpConnectionState {
eHCS_Ready = 0,
eHCS_StartSending,
@@ -75,3 +83,5 @@ static inline String httpGetStatusText(unsigned code)
{
return httpGetStatusText((enum http_status)code);
}

/** @} */
5 changes: 4 additions & 1 deletion Sming/Core/Network/Http/HttpHeaderBuilder.h
Original file line number Diff line number Diff line change
@@ -12,7 +12,10 @@

#include "HttpHeaders.h"

/** @brief Re-assembles headers from fragments via onHeaderField / onHeaderValue callbacks */
/**
* @brief Re-assembles headers from fragments via onHeaderField / onHeaderValue callbacks
* @ingroup http
*/
class HttpHeaderBuilder
{
public:
1 change: 1 addition & 0 deletions Sming/Core/Network/Http/HttpHeaders.h
Original file line number Diff line number Diff line change
@@ -92,6 +92,7 @@ enum HttpHeaderFieldName {
* Behaviour is as for HashMap, with the addition of methods to support enumerated field names.
*
* @todo add name and/or value escaping
* @ingroup http
*/
class HttpHeaders : private HashMap<HttpHeaderFieldName, String>
{
5 changes: 4 additions & 1 deletion Sming/Core/Network/Http/HttpParams.h
Original file line number Diff line number Diff line change
@@ -22,11 +22,14 @@
#include "WHashMap.h"
#include "Printable.h"

/** @brief
/**
* @brief Handles the query portion of a URI
*
* @todo values stored in escaped form, unescape return value and escape provided values.
* Revise HttpBodyParser.cpp as it will no longer do this job.
*
* @ingroup http
*
*/
class HttpParams : public HashMap<String, String>, public Printable
{
6 changes: 4 additions & 2 deletions Sming/Core/Network/Http/HttpRequest.h
Original file line number Diff line number Diff line change
@@ -29,8 +29,10 @@ typedef Delegate<int(HttpConnection& client, HttpResponse& response)> RequestHea
typedef Delegate<int(HttpConnection& client, const char* at, size_t length)> RequestBodyDelegate;
typedef Delegate<int(HttpConnection& client, bool successful)> RequestCompletedDelegate;

/*
* Encapsulates an incoming or outgoing request
/**
* @brief Encapsulates an incoming or outgoing request
* @ingroup http
*
*/
class HttpRequest
{
4 changes: 4 additions & 0 deletions Sming/Core/Network/Http/HttpResource.h
Original file line number Diff line number Diff line change
@@ -27,6 +27,10 @@ typedef Delegate<int(HttpServerConnection& connection, HttpRequest&, char* at, i
typedef Delegate<int(HttpServerConnection& connection, HttpRequest& request, HttpResponse& response)>
HttpResourceDelegate;

/**
* @brief Instances of this class are registered with an HttpServer for a specific URL
* @ingroup http
*/
class HttpResource
{
public:
4 changes: 3 additions & 1 deletion Sming/Core/Network/Http/HttpResourceTree.h
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ typedef Delegate<void(HttpRequest& request, HttpResponse& response)> HttpPathDel
/** @brief Identifies the default resource path */
#define RESOURCE_PATH_DEFAULT String('*')

/** @brief Class to map URL paths to classes which handle them
/**
* @brief Class to map URL paths to classes which handle them
* @ingroup http
*/
class HttpResourceTree : public ObjectMap<String, HttpResource>
{
5 changes: 5 additions & 0 deletions Sming/Core/Network/Http/HttpResponse.h
Original file line number Diff line number Diff line change
@@ -17,6 +17,11 @@
#include "HttpHeaders.h"
#include "FileSystem.h"

/**
* @brief Represents either an incoming or outgoing response to a HTTP request
* @ingroup http
*
*/
class HttpResponse
{
public:
4 changes: 4 additions & 0 deletions Sming/Core/Network/Http/Websocket/WebsocketResource.h
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@
#include "WebsocketConnection.h"
#include "WString.h"

/**
* @brief Class associated with an open websocket to handle communcations
* @ingroup http
*/
class WebsocketResource : public HttpResource
{
public: