takashi kadono
/
Nucleo_446
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/TESTS/netsocket/tcp/tcp_tests.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2018, ARM Limited, All Rights Reserved |
kadonotakashi | 0:8fdf9a60065b | 3 | * SPDX-License-Identifier: Apache-2.0 |
kadonotakashi | 0:8fdf9a60065b | 4 | * |
kadonotakashi | 0:8fdf9a60065b | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
kadonotakashi | 0:8fdf9a60065b | 6 | * not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 7 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 8 | * |
kadonotakashi | 0:8fdf9a60065b | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
kadonotakashi | 0:8fdf9a60065b | 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 14 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 15 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 16 | */ |
kadonotakashi | 0:8fdf9a60065b | 17 | |
kadonotakashi | 0:8fdf9a60065b | 18 | #ifndef TCP_TESTS_H |
kadonotakashi | 0:8fdf9a60065b | 19 | #define TCP_TESTS_H |
kadonotakashi | 0:8fdf9a60065b | 20 | |
kadonotakashi | 0:8fdf9a60065b | 21 | NetworkInterface *get_interface(); |
kadonotakashi | 0:8fdf9a60065b | 22 | void drop_bad_packets(TCPSocket &sock, int orig_timeout); |
kadonotakashi | 0:8fdf9a60065b | 23 | void fill_tx_buffer_ascii(char *buff, size_t len); |
kadonotakashi | 0:8fdf9a60065b | 24 | nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock); |
kadonotakashi | 0:8fdf9a60065b | 25 | nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock); |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | /** |
kadonotakashi | 0:8fdf9a60065b | 28 | * Single testcase might take only half of the remaining execution time |
kadonotakashi | 0:8fdf9a60065b | 29 | */ |
kadonotakashi | 0:8fdf9a60065b | 30 | int split2half_rmng_tcp_test_time(); // [s] |
kadonotakashi | 0:8fdf9a60065b | 31 | |
kadonotakashi | 0:8fdf9a60065b | 32 | namespace tcp_global { |
kadonotakashi | 0:8fdf9a60065b | 33 | static const int TESTS_TIMEOUT = 960; |
kadonotakashi | 0:8fdf9a60065b | 34 | static const int TCP_OS_STACK_SIZE = 2048; |
kadonotakashi | 0:8fdf9a60065b | 35 | |
kadonotakashi | 0:8fdf9a60065b | 36 | static const int RX_BUFF_SIZE = 1220; |
kadonotakashi | 0:8fdf9a60065b | 37 | static const int TX_BUFF_SIZE = 1220; |
kadonotakashi | 0:8fdf9a60065b | 38 | |
kadonotakashi | 0:8fdf9a60065b | 39 | extern char rx_buffer[RX_BUFF_SIZE]; |
kadonotakashi | 0:8fdf9a60065b | 40 | extern char tx_buffer[TX_BUFF_SIZE]; |
kadonotakashi | 0:8fdf9a60065b | 41 | } |
kadonotakashi | 0:8fdf9a60065b | 42 | |
kadonotakashi | 0:8fdf9a60065b | 43 | /* |
kadonotakashi | 0:8fdf9a60065b | 44 | * Test cases |
kadonotakashi | 0:8fdf9a60065b | 45 | */ |
kadonotakashi | 0:8fdf9a60065b | 46 | void TCPSOCKET_CONNECT_INVALID(); |
kadonotakashi | 0:8fdf9a60065b | 47 | void TCPSOCKET_ECHOTEST(); |
kadonotakashi | 0:8fdf9a60065b | 48 | void TCPSOCKET_ECHOTEST_NONBLOCK(); |
kadonotakashi | 0:8fdf9a60065b | 49 | void TCPSOCKET_ECHOTEST_BURST(); |
kadonotakashi | 0:8fdf9a60065b | 50 | void TCPSOCKET_ECHOTEST_BURST_NONBLOCK(); |
kadonotakashi | 0:8fdf9a60065b | 51 | void TCPSOCKET_ENDPOINT_CLOSE(); |
kadonotakashi | 0:8fdf9a60065b | 52 | void TCPSOCKET_OPEN_CLOSE_REPEAT(); |
kadonotakashi | 0:8fdf9a60065b | 53 | void TCPSOCKET_OPEN_LIMIT(); |
kadonotakashi | 0:8fdf9a60065b | 54 | void TCPSOCKET_RECV_100K(); |
kadonotakashi | 0:8fdf9a60065b | 55 | void TCPSOCKET_RECV_100K_NONBLOCK(); |
kadonotakashi | 0:8fdf9a60065b | 56 | void TCPSOCKET_RECV_TIMEOUT(); |
kadonotakashi | 0:8fdf9a60065b | 57 | void TCPSOCKET_SEND_REPEAT(); |
kadonotakashi | 0:8fdf9a60065b | 58 | void TCPSOCKET_SEND_TIMEOUT(); |
kadonotakashi | 0:8fdf9a60065b | 59 | void TCPSOCKET_THREAD_PER_SOCKET_SAFETY(); |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | #endif //TCP_TESTS_H |