Commit Graph

276 Commits (bdc355f873b24251199a015eb5678cb8792385da)

Author SHA1 Message Date
Seppo Takalo bdc355f873 Astyle fixes 2018-11-19 15:31:31 +02:00
Seppo Takalo 5d170f2b3e Clarify that TLSSocket should not be reopened. 2018-11-19 15:19:50 +02:00
Seppo Takalo 6192ed1480 Compare the intermediate timestamps as well 2018-11-19 15:19:50 +02:00
Seppo Takalo 2229a2f2f5 Need to protect members with MBEDTLS_PK_C and X509_CRT_PARSE flags.
This is dependency to X509_CRT_PARSE but just to make sure
that also the 'mbedtls_pk_context' structure is not used if that
flag is not enabled.
2018-11-19 15:19:49 +02:00
Seppo Takalo 46c46019bc Refactor DTLSSocket to use Socket::getpeername()
Also, let DTLSSocket to be a friend of InternetSocket so it can do
the name resolution from its _stack.

+ Some whitespace fixes
2018-11-19 15:19:49 +02:00
Seppo Takalo 695db63df8 Decrease verbosity of the TLSSocketWrapper 2018-11-19 15:19:49 +02:00
Michal Paszta 392bccf835 Add unit tests for TLSSocket and TLSSocketWrapper
This also includes their Datagram counterparts: DTLSSocket and DTLSSocketWrapper.
Coverage missing for timer-related functionality, but this would require more advanced stub development.
The extra (d)tls_test_config.h is necessary for successful compilation without HW support for the mbedtls features in unittests.
I reused the mbedtls stub found in features/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c and amended it slightly with a few missing functions.
2018-11-19 15:19:49 +02:00
Seppo Takalo 2ca1fe65dd Implement DTLSSocket helper
This is equivalent of TLSSocket class but for UDP and DTLS.
2018-11-19 15:19:49 +02:00
Seppo Takalo d22adbdb26 Implement DTLSSocketWrapper and fix non-blocking connections on TLSSocket
DTLSSocketWrapper is equivalent of TLSSocketWrapper but uses datagram mode
and timers for handling Mbed TLS timeouts.

Non-blocking connections were not working earlier, now fixed for both
secure socket modes.
2018-11-19 15:19:49 +02:00
Qinghao Shi d157e59267 reformat to following codeing style rules 2018-11-16 10:29:31 +00:00
Qinghao Shi 25e8f89567 update wait_ms() to sleep_for() 2018-11-16 10:29:31 +00:00
Qinghao Shi 78b186ec56 Update code according to the reviews
* move emac driver to COMPONENT folder
* use mbed rtos C++ API instead of CMSIS API
2018-11-16 10:29:31 +00:00
Qinghao Shi e603f1ad49 add FVP EMAC driver 2018-11-16 10:22:42 +00:00
Cruz Monrreal II 5c1c7bf71f Merge branch 'fix_astyle_error' of ssh://github.com/0xc0170/mbed-os into rollup-b.1 2018-11-15 18:26:09 -06:00
Cruz Monrreal fa2077df41
Merge pull request #8685 from bridadan/clean_up_deprecated_feature_code
Clean up deprecated feature code
2018-11-15 17:05:22 -06:00
Martin Kojtal 9a252cd218 Merge branch 'feature-emac-mxrt1050' of https://github.com/NXPmicro/mbed into dev_rollup 2018-11-15 13:58:27 +00:00
Martin Kojtal f91eed97da cellular: fix onboard cellular coding style 2018-11-15 10:47:08 +00:00
Anna Bridge 4d07bcbd6e
Merge pull request #8579 from jarvte/cellular_context
Major refactoring: changing Network inheritance from CellularNetwork to new class CellularContext
2018-11-14 14:37:19 +00:00
Mahesh Mahadevan 12c6b1bd88 MIMXRT1050EVK: Add ENET support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-11-14 07:13:07 -06:00
Cruz Monrreal II 4a5ba7f156 Merge branch 'getpeername' of ssh://github.com/SeppoTakalo/mbed-os into rollup 2018-11-13 17:26:49 -06:00
Seppo Takalo 619bcb5b4e Implement Socket::getpeername() API
This is equivalent of POSIX getpeername() function. It allows to
get remote address associated with the socket.
For example:
socket *s = server.accept();
SocketAddress remote;
s->getpeername(&remote);
2018-11-13 11:02:51 +02:00
Kevin Bracey 913103c34d TLSSocketWrapper: decouple error requirements
* Don't pull in mbedtls_strerror() if trace is not enabled.
* Output error trace even if mbedtls_strerror() is not available.
2018-11-12 13:12:34 +02:00
Teppo Järvelin 3f6e088782 Cellular: Fixed backward compatibility with OnBoardCellularInterface and set default values in NetworkInterfaceDefaults.cpp. 2018-11-11 14:13:05 +02:00
Teppo Järvelin 1a047efade Cellular: review fixes, added missing fixes from master. 2018-11-11 14:13:05 +02:00
Teppo Järvelin 9fb83024ea Changed CellularContext to inherit from CellularBase instead of NetworkInterface. \n Changed Device constructor to take Filehandle instead of eventqueue. 2018-11-11 14:13:05 +02:00
Teppo Järvelin ad2abbe887 Cellular: major refactoring while introducing new CellularContext class. 2018-11-11 14:12:49 +02:00
Teppo Järvelin 8880538eba Cellular: Introduced new state machine to replace old CellularConnectionFSM
CellularDevice class own new state machine. Now we don't have to expose state machine
which may change and so we don't have to make API changes if that happens.
EasyCellularConnection uses now CellularDevice instead of old state machine.
2018-11-11 14:11:21 +02:00
Cruz Monrreal 9d95d46d6c
Merge pull request #8591 from 0xc0170/fix_coding_style_features
features: fix coding style
2018-11-09 09:40:56 -06:00
Brian Daniels da6ce029ea Removing cellular references to COMMON_PAL 2018-11-08 16:55:59 -06:00
Cruz Monrreal II e40c357cb2 Merge branch 'internetsocket' of ssh://github.com/marcemmers/mbed-os into rollup 2018-11-08 13:24:14 -06:00
Martin Kojtal 0217f69511 Merge branch 'cm3ds_emac' of git://github.com/kapi90/mbed-os into dev_rollup 2018-11-08 09:21:38 +00:00
Martin Kojtal 63160d8c5b netsocket: fix astyle coding style 2018-11-08 08:54:17 +00:00
Marc Emmers dcb97f9f74 InternetSocket: Fixed missing unlock before return 2018-11-06 15:02:42 +01:00
Martin Kojtal 4cbcd64ca3 Merge branch 'doxy_refactor' of https://github.com/jamesbeyond/mbed-os into dev_rollup 2018-11-06 12:10:10 +00:00
Martin Kojtal cb4924151e
Merge pull request #8621 from marcuschangarm/fix_include
Add missing include for TLSSocket
2018-11-05 17:18:52 +01:00
Marcus Chang 07eb6bd159 Add missing include for TLSSocket
TCP and UDP sockets are automatically available when mbed.h is
included in an application.

This change lets the TLSSocket be used in the same way.
2018-11-01 13:32:37 -07:00
Seppo Takalo f92108c0f3 Make sure that close() is called before the transport is destroyed.
Transport is a member of TLSSocket which is derived from TLSSocketWrapper.
Make sure that TLSSocketWrapper::close() is called before the transport is
destroyed.
2018-11-01 15:30:27 +02:00
Qinghao Shi 60cc0c295d fixed NetworkInterface Class missing in doxy 2018-10-31 14:50:59 +00:00
Martin Kojtal 2015a61b37
Merge pull request #8580 from tz-arm/fix_incorrect_comment_in_socket_h
Fix the incorrect comment for set_blocking()
2018-10-31 13:10:35 +01:00
Terence Zhang 2c56bd8151 Fix the incorrect comment for set_blocking() 2018-10-30 15:41:32 +08:00
Amanda Butler eae570ef08 Edit EMAC.h
Change Latin abbreviation to English phrase and fix capitalization of EMAC while I'm at it.
2018-10-29 15:14:07 -05:00
kegilbert 4bc7bf3b1e Fix typos in Features/Netsocket 2018-10-29 15:14:07 -05:00
Bence Kaposzta 9e6b1246a4 This commit adds EMAC driver for CM3DS that uses an SMSC LAN 9220
Ethernet controller. To ensure proper operation, some methods
needed to be updated in the SMSC9220's native driver as well.
It passes all related Greentea tests, however when supervised by
the Python environment it tends to fail because of Timeout.

The current timeout is set to 1200s that seems to be a little bit short
to finish all test cases, the timeout happens towards the end of the
last test case.

Change-Id: I914608c34828b493a80e133cd132537a297bfc84
Signed-off-by: Bence Kaposzta <bence.kaposzta@arm.com>
2018-10-29 15:30:47 +01:00
Cruz Monrreal 9403a2f16c
Merge pull request #8499 from michalpasztamobica/master
Socket closing improvements and tests adjustments
2018-10-29 08:47:25 -05:00
Cruz Monrreal II e8728148ac Merge branch 'docs-fix-networkiface' of ssh://github.com/paul-szczepanek-arm/mbed-os into rollup 2018-10-26 11:48:45 -05:00
Mel W 2bab24ffc5
Commas 2018-10-26 17:32:47 +03:00
Mel W ae75dfcf92
Capitalization, formatting of true and false, punctuation. 2018-10-26 17:32:10 +03:00
Mel W b165fc0f93
Articles and capitalization 2018-10-26 16:18:57 +03:00
Mel W 25b1625fff
Sentence restructuring, punctuation 2018-10-26 15:42:26 +03:00
Michal Paszta 0da0f16d60 TCPSocket accept refactored to close cleanly and icetea test added
Private constructor called in TCPSocket accept, when creating a new Socket.
Close() method calls moved "up" to InternetSocket.
InternetSocket::close() returns proper error code when no socket available.
Add TcpSocket::accept icetea tests.
Deleting sockets moved to teardown.
2018-10-26 12:02:25 +03:00