provisioning framework : 'extern C' directives added for C++ support

This commit is contained in:
Anurag Kar 2019-01-28 15:18:47 +05:30 committed by bot
parent 2e64d2d56e
commit a7ff611b10
9 changed files with 68 additions and 4 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
*/
@ -224,3 +228,7 @@ esp_err_t protocomm_set_version(protocomm_t *pc, const char *ep_name,
* - 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 <esp_err.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Proof Of Possession for authenticating a secure session
*/
@ -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,6 +16,10 @@
#include <protocomm_security.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Protocomm security version 1 implementation
*
@ -23,3 +27,7 @@
* Curve25519 key exchange and AES-256-CTR encryption
*/
extern const protocomm_security_t protocomm_security1;
#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
@ -90,3 +94,7 @@ esp_err_t protocomm_ble_start(protocomm_t *pc, const protocomm_ble_config_t *con
* - 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, \
@ -57,3 +61,7 @@ esp_err_t protocomm_console_start(protocomm_t *pc, const protocomm_console_confi
* - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
*/
esp_err_t protocomm_console_stop(protocomm_t *pc);
#ifdef __cplusplus
}
#endif

View file

@ -22,9 +22,13 @@
.task_priority = tskIDLE_PRIORITY + 5, \
}
#ifdef __cplusplus
extern "C" {
#endif
/** Protocomm HTTP Server Configuration */
/**
* @brief Config parameters for protocomm HTTP server
*/
typedef struct {
uint16_t port; /*!< Port on which the http server will listen */
@ -93,3 +97,7 @@ esp_err_t protocomm_httpd_start(protocomm_t *pc, const protocomm_httpd_config_t
* - ESP_ERR_INVALID_ARG : Null / incorrect protocomm instance pointer
*/
esp_err_t protocomm_httpd_stop(protocomm_t *pc);
#ifdef __cplusplus
}
#endif

View file

@ -372,7 +372,7 @@ static void protocomm_ble_cleanup(void)
if (protoble_internal->g_nu_lookup) {
for (unsigned i = 0; i < protoble_internal->g_nu_lookup_count; i++) {
if (protoble_internal->g_nu_lookup[i].name) {
free(protoble_internal->g_nu_lookup[i].name);
free((void *)protoble_internal->g_nu_lookup[i].name);
}
}
free(protoble_internal->g_nu_lookup);

View file

@ -17,6 +17,10 @@
#include <lwip/inet.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief WiFi STA status for conveying back to the provisioning master
*/
@ -117,4 +121,8 @@ typedef struct wifi_prov_config_handlers {
esp_err_t wifi_prov_config_data_handler(uint32_t session_id, const uint8_t *inbuf, ssize_t inlen,
uint8_t **outbuf, ssize_t *outlen, void *priv_data);
#ifdef __cplusplus
}
#endif
#endif