Update IDF to ebdcbe8c6 (#2539)

- ESP-Face to 2937054
- ESP32-Camera to 113629b
This commit is contained in:
Me No Dev
2019-03-03 17:19:11 +01:00
committed by GitHub
parent 566f659e90
commit 7df50a97d1
127 changed files with 1594 additions and 681 deletions

View File

@ -17,6 +17,10 @@
#include <protocomm_security.h>
#include <esp_err.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Function prototype for protocomm endpoint handler
*/
@ -42,7 +46,7 @@ typedef struct protocomm protocomm_t;
* @brief Create a new protocomm instance
*
* This API will return a new dynamically allocated protocomm instance
* with all elements of the protocomm_t structure initialised to NULL.
* with all elements of the protocomm_t structure initialized to NULL.
*
* @return
* - protocomm_t* : On success
@ -71,7 +75,8 @@ void protocomm_delete(protocomm_t *pc);
* - An endpoint must be bound to a valid protocomm instance,
* created using `protocomm_new()`.
* - This function internally calls the registered `add_endpoint()`
* function which is a member of the protocomm_t instance structure.
* function of the selected transport which is a member of the
* protocomm_t instance structure.
*
* @param[in] pc Pointer to the protocomm instance
* @param[in] ep_name Endpoint identifier(name) string
@ -81,7 +86,7 @@ void protocomm_delete(protocomm_t *pc);
* Pass NULL if not needed.
*
* @return
* - ESP_OK : Added new endpoint succesfully
* - ESP_OK : Success
* - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
* - ESP_ERR_NO_MEM : Error allocating endpoint resource
* - ESP_ERR_INVALID_ARG : Null instance/name/handler arguments
@ -103,7 +108,7 @@ esp_err_t protocomm_add_endpoint(protocomm_t *pc, const char *ep_name,
* @param[in] ep_name Endpoint identifier(name) string
*
* @return
* - ESP_OK : Added new endpoint succesfully
* - ESP_OK : Success
* - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
* - ESP_ERR_INVALID_ARG : Null instance/name arguments
*/
@ -111,12 +116,12 @@ esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name);
/**
* @brief Calls the registered handler of an endpoint session
* for processing incoming data and giving the output
* for processing incoming data and generating the response
*
* @note
* - An endpoint must be bound to a valid protocomm instance,
* created using `protocomm_new()`.
* - Resulting output buffer must be deallocated by the user.
* - Resulting output buffer must be deallocated by the caller.
*
* @param[in] pc Pointer to the protocomm instance
* @param[in] ep_name Endpoint identifier(name) string
@ -130,7 +135,7 @@ esp_err_t protocomm_remove_endpoint(protocomm_t *pc, const char *ep_name);
* @param[out] outlen Buffer length of the allocated output buffer
*
* @return
* - ESP_OK : Request handled succesfully
* - ESP_OK : Request handled successfully
* - ESP_FAIL : Internal error in execution of registered handler
* - ESP_ERR_NO_MEM : Error allocating internal resource
* - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
@ -159,7 +164,7 @@ esp_err_t protocomm_req_handle(protocomm_t *pc, const char *ep_name, uint32_t se
* @param[in] pop Pointer to proof of possession for authenticating a client
*
* @return
* - ESP_OK : Added new security endpoint succesfully
* - ESP_OK : Success
* - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
* - ESP_ERR_INVALID_STATE : Security endpoint already set
* - ESP_ERR_NO_MEM : Error allocating endpoint resource
@ -179,7 +184,7 @@ esp_err_t protocomm_set_security(protocomm_t *pc, const char *ep_name,
* @param[in] ep_name Endpoint identifier(name) string
*
* @return
* - ESP_OK : Added new endpoint succesfully
* - ESP_OK : Success
* - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
* - ESP_ERR_INVALID_ARG : Null instance/name arguments
*/
@ -189,7 +194,7 @@ esp_err_t protocomm_unset_security(protocomm_t *pc, const char *ep_name);
* @brief Set endpoint for version verification
*
* This API can be used for setting an application specific protocol
* version which can be verfied by clients through the endpoint.
* version which can be verified by clients through the endpoint.
*
* @note
* - An endpoint must be bound to a valid protocomm instance,
@ -200,7 +205,7 @@ esp_err_t protocomm_unset_security(protocomm_t *pc, const char *ep_name);
* @param[in] version Version identifier(name) string
*
* @return
* - ESP_OK : Added new security endpoint succesfully
* - ESP_OK : Success
* - ESP_FAIL : Error adding endpoint / Endpoint with this name already exists
* - ESP_ERR_INVALID_STATE : Version endpoint already set
* - ESP_ERR_NO_MEM : Error allocating endpoint resource
@ -219,8 +224,12 @@ esp_err_t protocomm_set_version(protocomm_t *pc, const char *ep_name,
* @param[in] ep_name Endpoint identifier(name) string
*
* @return
* - ESP_OK : Added new endpoint succesfully
* - ESP_OK : Success
* - ESP_ERR_NOT_FOUND : Endpoint with specified name doesn't exist
* - ESP_ERR_INVALID_ARG : Null instance/name arguments
*/
esp_err_t protocomm_unset_version(protocomm_t *pc, const char *ep_name);
#ifdef __cplusplus
}
#endif

View File

@ -16,6 +16,10 @@
#include <protocomm.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* BLE device name cannot be larger than this value
*/
@ -30,7 +34,7 @@ typedef struct name_uuid {
/**
* Name of the handler, which is passed to protocomm layer
*/
char *name;
const char *name;
/**
* UUID to be assigned to the BLE characteristic which is
@ -63,10 +67,10 @@ typedef struct {
* the initialization for characteristics/service for BLE.
*
* @param[in] pc Protocomm instance pointer obtained from protocomm_new()
* @param[in] config Pointer to config structure for initialising BLE
* @param[in] config Pointer to config structure for initializing BLE
*
* @return
* - ESP_OK : if successful
* - ESP_OK : Success
* - ESP_FAIL : Simple BLE start error
* - ESP_ERR_NO_MEM : Error allocating memory for internal resources
* - ESP_ERR_INVALID_STATE : Error in ble config
@ -85,8 +89,12 @@ esp_err_t protocomm_ble_start(protocomm_t *pc, const protocomm_ble_config_t *con
* @param[in] pc Same protocomm instance that was passed to protocomm_ble_start()
*
* @return
* - ESP_OK : For success or appropriate error code
* - ESP_OK : Success
* - ESP_FAIL : Simple BLE stop error
* - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance
*/
esp_err_t protocomm_ble_stop(protocomm_t *pc);
#ifdef __cplusplus
}
#endif

View File

@ -16,6 +16,10 @@
#include <protocomm.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PROTOCOMM_CONSOLE_DEFAULT_CONFIG() { \
.stack_size = 4096, \
.task_priority = tskIDLE_PRIORITY + 3, \
@ -25,7 +29,7 @@
* @brief Config parameters for protocomm console
*/
typedef struct {
size_t stack_size; /*!< Stack size of console taks */
size_t stack_size; /*!< Stack size of console task */
unsigned task_priority; /*!< Priority of console task */
} protocomm_console_config_t;
@ -39,7 +43,7 @@ typedef struct {
* @param[in] config Config param structure for protocomm console
*
* @return
* - ESP_OK : Server started succefully
* - ESP_OK : Success
* - ESP_ERR_INVALID_ARG : Null arguments
* - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance
* - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance
@ -53,7 +57,11 @@ esp_err_t protocomm_console_start(protocomm_t *pc, const protocomm_console_confi
* @param[in] pc Same protocomm instance that was passed to protocomm_console_start()
*
* @return
* - ESP_OK : Server stopped succefully
* - ESP_OK : Success
* - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
*/
esp_err_t protocomm_console_stop(protocomm_t *pc);
#ifdef __cplusplus
}
#endif

View File

@ -22,11 +22,16 @@
.task_priority = tskIDLE_PRIORITY + 5, \
}
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Config parameters for protocomm HTTP server
*/
typedef struct {
uint16_t port; /*!< Port on which the http server will listen */
uint16_t port; /*!< Port on which the HTTP server will listen */
/**
* Stack size of server task, adjusted depending
@ -34,6 +39,31 @@ typedef struct {
*/
size_t stack_size;
unsigned task_priority; /*!< Priority of server task */
} protocomm_http_server_config_t; /*!< HTTP Server Configuration, if HTTP Server has not been started already */
/** Protocomm HTTPD Configuration Data
*/
typedef union {
/** HTTP Server Handle, if ext_handle_provided is set to true
*/
void *handle;
/** HTTP Server Configuration, if a server is not already active
*/
protocomm_http_server_config_t config;
} protocomm_httpd_config_data_t;
/**
* @brief Config parameters for protocomm HTTP server
*/
typedef struct {
/** Flag to indicate of an external HTTP Server Handle has been provided.
* In such as case, protocomm will use the same HTTP Server and not start
* a new one internally.
*/
bool ext_handle_provided;
/** Protocomm HTTPD Configuration Data */
protocomm_httpd_config_data_t data;
} protocomm_httpd_config_t;
/**
@ -46,10 +76,10 @@ typedef struct {
* one instance can be bound to an HTTP transport layer.
*
* @param[in] pc Protocomm instance pointer obtained from protocomm_new()
* @param[in] config Pointer to config structure for initialising HTTP server
* @param[in] config Pointer to config structure for initializing HTTP server
*
* @return
* - ESP_OK : Server started succefully
* - ESP_OK : Success
* - ESP_ERR_INVALID_ARG : Null arguments
* - ESP_ERR_NOT_SUPPORTED : Transport layer bound to another protocomm instance
* - ESP_ERR_INVALID_STATE : Transport layer already bound to this protocomm instance
@ -67,7 +97,11 @@ esp_err_t protocomm_httpd_start(protocomm_t *pc, const protocomm_httpd_config_t
* @param[in] pc Same protocomm instance that was passed to protocomm_httpd_start()
*
* @return
* - ESP_OK : Server stopped succefully
* - ESP_OK : Success
* - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
*/
esp_err_t protocomm_httpd_stop(protocomm_t *pc);
#ifdef __cplusplus
}
#endif

View File

@ -16,6 +16,10 @@
#include <esp_err.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Proof Of Possession for authenticating a secure session
*/
@ -42,12 +46,12 @@ typedef struct protocomm_security_pop {
*/
typedef struct protocomm_security {
/**
* Unique version number of security implmentation
* Unique version number of security implementation
*/
int ver;
/**
* Function for initialising/allocating security
* Function for initializing/allocating security
* infrastructure
*/
esp_err_t (*init)();
@ -91,3 +95,7 @@ typedef struct protocomm_security {
const uint8_t *inbuf, ssize_t inlen,
uint8_t *outbuf, ssize_t *outlen);
} protocomm_security_t;
#ifdef __cplusplus
}
#endif

View File

@ -16,6 +16,10 @@
#include <protocomm_security.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Protocomm security version 0 implementation
*
@ -23,3 +27,7 @@
* security is required for the protocomm instance
*/
extern const protocomm_security_t protocomm_security0;
#ifdef __cplusplus
}
#endif

View File

@ -16,10 +16,18 @@
#include <protocomm_security.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Protocomm security version 1 implementation
*
* This is a full fledged security implmentation using
* This is a full fledged security implementation using
* Curve25519 key exchange and AES-256-CTR encryption
*/
extern const protocomm_security_t protocomm_security1;
#ifdef __cplusplus
}
#endif