mirror of https://github.com/ARMmbed/mbed-os.git
netsocket: fix astyle coding style
parent
884a7748b2
commit
63160d8c5b
|
|
@ -10,6 +10,7 @@ features/storage/FEATURE_STORAGE
|
||||||
features/frameworks
|
features/frameworks
|
||||||
features/FEATURE_BLE/targets
|
features/FEATURE_BLE/targets
|
||||||
features/unsupported/
|
features/unsupported/
|
||||||
|
features/netsocket/emac-drivers
|
||||||
hal/storage_abstraction
|
hal/storage_abstraction
|
||||||
features/nanostack/coap-service
|
features/nanostack/coap-service
|
||||||
features/nanostack/sal-stack-nanostack
|
features/nanostack/sal-stack-nanostack
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,14 @@ public:
|
||||||
* @param stack Network stack as target for socket
|
* @param stack Network stack as target for socket
|
||||||
* @return 0 on success, negative error code on failure
|
* @return 0 on success, negative error code on failure
|
||||||
*/
|
*/
|
||||||
virtual nsapi_error_t open(NetworkStack *stack) {
|
virtual nsapi_error_t open(NetworkStack *stack)
|
||||||
|
{
|
||||||
return tcp_socket.open(stack);
|
return tcp_socket.open(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
nsapi_error_t open(S *stack) {
|
nsapi_error_t open(S *stack)
|
||||||
|
{
|
||||||
return open(nsapi_create_stack(stack));
|
return open(nsapi_create_stack(stack));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ TLSSocketWrapper::TLSSocketWrapper(Socket *transport, const char *hostname, cont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TLSSocketWrapper::~TLSSocketWrapper() {
|
TLSSocketWrapper::~TLSSocketWrapper()
|
||||||
|
{
|
||||||
if (_transport) {
|
if (_transport) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +140,8 @@ nsapi_error_t TLSSocketWrapper::set_client_cert_key(const void *client_cert, siz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsapi_error_t TLSSocketWrapper::do_handshake() {
|
nsapi_error_t TLSSocketWrapper::do_handshake()
|
||||||
|
{
|
||||||
nsapi_error_t _error;
|
nsapi_error_t _error;
|
||||||
const char DRBG_PERS[] = "mbed TLS client";
|
const char DRBG_PERS[] = "mbed TLS client";
|
||||||
|
|
||||||
|
|
@ -228,7 +230,8 @@ nsapi_error_t TLSSocketWrapper::do_handshake() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsapi_error_t TLSSocketWrapper::send(const void *data, nsapi_size_t size) {
|
nsapi_error_t TLSSocketWrapper::send(const void *data, nsapi_size_t size)
|
||||||
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!_transport) {
|
if (!_transport) {
|
||||||
|
|
@ -255,7 +258,8 @@ nsapi_size_or_error_t TLSSocketWrapper::sendto(const SocketAddress &, const void
|
||||||
return send(data, size);
|
return send(data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsapi_size_or_error_t TLSSocketWrapper::recv(void *data, nsapi_size_t size) {
|
nsapi_size_or_error_t TLSSocketWrapper::recv(void *data, nsapi_size_t size)
|
||||||
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!_transport) {
|
if (!_transport) {
|
||||||
|
|
@ -287,7 +291,8 @@ nsapi_size_or_error_t TLSSocketWrapper::recvfrom(SocketAddress *address, void *d
|
||||||
return recv(data, size);
|
return recv(data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TLSSocketWrapper::print_mbedtls_error(const char *name, int err) {
|
void TLSSocketWrapper::print_mbedtls_error(const char *name, int err)
|
||||||
|
{
|
||||||
#ifdef MBEDTLS_ERROR_C
|
#ifdef MBEDTLS_ERROR_C
|
||||||
char *buf = new char[128];
|
char *buf = new char[128];
|
||||||
mbedtls_strerror(err, buf, 128);
|
mbedtls_strerror(err, buf, 128);
|
||||||
|
|
@ -329,10 +334,9 @@ int TLSSocketWrapper::my_verify(void *data, mbedtls_x509_crt *crt, int depth, ui
|
||||||
mbedtls_x509_crt_info(buf, buf_size - 1, " ", crt);
|
mbedtls_x509_crt_info(buf, buf_size - 1, " ", crt);
|
||||||
tr_debug("%s", buf);
|
tr_debug("%s", buf);
|
||||||
|
|
||||||
if (*flags == 0)
|
if (*flags == 0) {
|
||||||
tr_info("No verification issue for this certificate\n");
|
tr_info("No verification issue for this certificate\n");
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
mbedtls_x509_crt_verify_info(buf, buf_size, " ! ", *flags);
|
mbedtls_x509_crt_verify_info(buf, buf_size, " ! ", *flags);
|
||||||
tr_info("%s\n", buf);
|
tr_info("%s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
@ -345,7 +349,8 @@ int TLSSocketWrapper::my_verify(void *data, mbedtls_x509_crt *crt, int depth, ui
|
||||||
#endif /* MBED_CONF_TLS_SOCKET_DEBUG_LEVEL > 0 */
|
#endif /* MBED_CONF_TLS_SOCKET_DEBUG_LEVEL > 0 */
|
||||||
|
|
||||||
|
|
||||||
int TLSSocketWrapper::ssl_recv(void *ctx, unsigned char *buf, size_t len) {
|
int TLSSocketWrapper::ssl_recv(void *ctx, unsigned char *buf, size_t len)
|
||||||
|
{
|
||||||
int recv;
|
int recv;
|
||||||
|
|
||||||
TLSSocketWrapper *my = static_cast<TLSSocketWrapper *>(ctx);
|
TLSSocketWrapper *my = static_cast<TLSSocketWrapper *>(ctx);
|
||||||
|
|
@ -365,7 +370,8 @@ int TLSSocketWrapper::ssl_recv(void *ctx, unsigned char *buf, size_t len) {
|
||||||
return recv;
|
return recv;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TLSSocketWrapper::ssl_send(void *ctx, const unsigned char *buf, size_t len) {
|
int TLSSocketWrapper::ssl_send(void *ctx, const unsigned char *buf, size_t len)
|
||||||
|
{
|
||||||
int size = -1;
|
int size = -1;
|
||||||
TLSSocketWrapper *my = static_cast<TLSSocketWrapper *>(ctx);
|
TLSSocketWrapper *my = static_cast<TLSSocketWrapper *>(ctx);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,9 @@ static nsapi_error_t do_sim_pin_check(ATCmdParser *at, const char *pin)
|
||||||
success = at->send("AT+CLCK=\"SC\",0,\"%s\"", pin) && at->recv("OK");
|
success = at->send("AT+CLCK=\"SC\",0,\"%s\"", pin) && at->recv("OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) return NSAPI_ERROR_OK;
|
if (success) {
|
||||||
|
return NSAPI_ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
return NSAPI_ERROR_AUTH_FAILURE;
|
return NSAPI_ERROR_AUTH_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
@ -444,7 +446,8 @@ nsapi_error_t PPPCellularInterface::initialize_sim_card()
|
||||||
return nsapi_error;
|
return nsapi_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPPCellularInterface::set_sim_pin(const char *pin) {
|
void PPPCellularInterface::set_sim_pin(const char *pin)
|
||||||
|
{
|
||||||
/* overwrite the default pin by user provided pin */
|
/* overwrite the default pin by user provided pin */
|
||||||
_pin = pin;
|
_pin = pin;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,8 @@ Case cases[] = { Case("UDP echo test", test_udp_echo),
|
||||||
Case("TCP async echo test", test_tcp_echo_async),
|
Case("TCP async echo test", test_tcp_echo_async),
|
||||||
#endif
|
#endif
|
||||||
Case("Connect with credentials", test_connect_credentials),
|
Case("Connect with credentials", test_connect_credentials),
|
||||||
Case("Connect with preset credentials", test_connect_preset_credentials) };
|
Case("Connect with preset credentials", test_connect_preset_credentials)
|
||||||
|
};
|
||||||
|
|
||||||
Specification specification(test_setup, cases);
|
Specification specification(test_setup, cases);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue