Apply clang-format for more source files (#795)

Apply clang-format for C source files in folder core/app-mgr,
core/app-framework, and test-tools.
And rename folder component_test to component-test, update
zephyr build document.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-10-21 13:58:34 +08:00
committed by GitHub
parent 225f5d0a64
commit 32242988ed
143 changed files with 5377 additions and 4627 deletions

View File

@ -12,7 +12,6 @@
extern "C" {
#endif
/* CoAP request method codes */
typedef enum {
COAP_GET = 1,
@ -26,39 +25,40 @@ typedef enum {
typedef enum {
NO_ERROR = 0,
CREATED_2_01 = 65, /* CREATED */
DELETED_2_02 = 66, /* DELETED */
VALID_2_03 = 67, /* NOT_MODIFIED */
CHANGED_2_04 = 68, /* CHANGED */
CONTENT_2_05 = 69, /* OK */
CREATED_2_01 = 65, /* CREATED */
DELETED_2_02 = 66, /* DELETED */
VALID_2_03 = 67, /* NOT_MODIFIED */
CHANGED_2_04 = 68, /* CHANGED */
CONTENT_2_05 = 69, /* OK */
CONTINUE_2_31 = 95, /* CONTINUE */
BAD_REQUEST_4_00 = 128, /* BAD_REQUEST */
UNAUTHORIZED_4_01 = 129, /* UNAUTHORIZED */
BAD_OPTION_4_02 = 130, /* BAD_OPTION */
FORBIDDEN_4_03 = 131, /* FORBIDDEN */
NOT_FOUND_4_04 = 132, /* NOT_FOUND */
METHOD_NOT_ALLOWED_4_05 = 133, /* METHOD_NOT_ALLOWED */
NOT_ACCEPTABLE_4_06 = 134, /* NOT_ACCEPTABLE */
PRECONDITION_FAILED_4_12 = 140, /* BAD_REQUEST */
BAD_REQUEST_4_00 = 128, /* BAD_REQUEST */
UNAUTHORIZED_4_01 = 129, /* UNAUTHORIZED */
BAD_OPTION_4_02 = 130, /* BAD_OPTION */
FORBIDDEN_4_03 = 131, /* FORBIDDEN */
NOT_FOUND_4_04 = 132, /* NOT_FOUND */
METHOD_NOT_ALLOWED_4_05 = 133, /* METHOD_NOT_ALLOWED */
NOT_ACCEPTABLE_4_06 = 134, /* NOT_ACCEPTABLE */
PRECONDITION_FAILED_4_12 = 140, /* BAD_REQUEST */
REQUEST_ENTITY_TOO_LARGE_4_13 = 141, /* REQUEST_ENTITY_TOO_LARGE */
UNSUPPORTED_MEDIA_TYPE_4_15 = 143, /* UNSUPPORTED_MEDIA_TYPE */
UNSUPPORTED_MEDIA_TYPE_4_15 = 143, /* UNSUPPORTED_MEDIA_TYPE */
INTERNAL_SERVER_ERROR_5_00 = 160, /* INTERNAL_SERVER_ERROR */
NOT_IMPLEMENTED_5_01 = 161, /* NOT_IMPLEMENTED */
BAD_GATEWAY_5_02 = 162, /* BAD_GATEWAY */
SERVICE_UNAVAILABLE_5_03 = 163, /* SERVICE_UNAVAILABLE */
GATEWAY_TIMEOUT_5_04 = 164, /* GATEWAY_TIMEOUT */
INTERNAL_SERVER_ERROR_5_00 = 160, /* INTERNAL_SERVER_ERROR */
NOT_IMPLEMENTED_5_01 = 161, /* NOT_IMPLEMENTED */
BAD_GATEWAY_5_02 = 162, /* BAD_GATEWAY */
SERVICE_UNAVAILABLE_5_03 = 163, /* SERVICE_UNAVAILABLE */
GATEWAY_TIMEOUT_5_04 = 164, /* GATEWAY_TIMEOUT */
PROXYING_NOT_SUPPORTED_5_05 = 165, /* PROXYING_NOT_SUPPORTED */
/* Erbium errors */
MEMORY_ALLOCATION_ERROR = 192, PACKET_SERIALIZATION_ERROR,
MEMORY_ALLOCATION_ERROR = 192,
PACKET_SERIALIZATION_ERROR,
/* Erbium hooks */
MANUAL_RESPONSE, PING_RESPONSE
MANUAL_RESPONSE,
PING_RESPONSE
} coap_status_t;
/**
* @typedef request_handler_f
*
@ -87,7 +87,6 @@ typedef void (*request_handler_f)(request_t *request);
*/
typedef void (*response_handler_f)(response_t *response, void *user_data);
/*
*****************
* Request APIs
@ -102,7 +101,8 @@ typedef void (*response_handler_f)(response_t *response, void *user_data);
*
* @return true if success, false otherwise
*/
bool api_register_resource_handler(const char *url, request_handler_f handler);
bool
api_register_resource_handler(const char *url, request_handler_f handler);
/**
* @brief Send request asynchronously.
@ -111,8 +111,9 @@ bool api_register_resource_handler(const char *url, request_handler_f handler);
* @param response_handler callback function to handle the response
* @param user_data user data
*/
void api_send_request(request_t * request, response_handler_f response_handler,
void * user_data);
void
api_send_request(request_t *request, response_handler_f response_handler,
void *user_data);
/**
* @brief Send response.
@ -130,8 +131,8 @@ void api_send_request(request_t * request, response_handler_f response_handler,
* }
* @endcode
*/
void api_response_send(response_t *response);
void
api_response_send(response_t *response);
/*
*****************
@ -149,9 +150,8 @@ void api_response_send(response_t *response);
*
* @return true if success, false otherwise
*/
bool api_publish_event(const char *url, int fmt, void *payload,
int payload_len);
bool
api_publish_event(const char *url, int fmt, void *payload, int payload_len);
/**
* @brief Subscribe an event.
@ -161,7 +161,8 @@ bool api_publish_event(const char *url, int fmt, void *payload,
*
* @return true if success, false otherwise
*/
bool api_subscribe_event(const char * url, request_handler_f handler);
bool
api_subscribe_event(const char *url, request_handler_f handler);
#ifdef __cplusplus
}

View File

@ -14,7 +14,7 @@ extern "C" {
/* board producer define user_timer */
struct user_timer;
typedef struct user_timer * user_timer_t;
typedef struct user_timer *user_timer_t;
/**
* @typedef on_user_timer_update_f
@ -43,15 +43,17 @@ typedef void (*on_user_timer_update_f)(user_timer_t timer);
*
* @return the timer created if success, NULL otherwise
*/
user_timer_t api_timer_create(int interval, bool is_period, bool auto_start,
on_user_timer_update_f on_timer_update);
user_timer_t
api_timer_create(int interval, bool is_period, bool auto_start,
on_user_timer_update_f on_timer_update);
/**
* @brief Cancel timer.
*
* @param timer the timer to cancel
*/
void api_timer_cancel(user_timer_t timer);
void
api_timer_cancel(user_timer_t timer);
/**
* @brief Restart timer.
@ -59,7 +61,8 @@ void api_timer_cancel(user_timer_t timer);
* @param timer the timer to cancel
* @param interval the timer interval
*/
void api_timer_restart(user_timer_t timer, int interval);
void
api_timer_restart(user_timer_t timer, int interval);
#ifdef __cplusplus
}