Simple mbed OS sockets example for mbed OS5 & W5500 SPI Ethernet controller. This is a quick example of a simple HTTP client program using the network-socket API that is provided as a part of mbed-os. The program brings up an underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket.
Dependencies: W5500Interface easy-connect
Fork of mbed-os-example-mbed5-sockets by
Result
- Serial Terminal Log
README.md@14:147f7f2bc7c7, 2017-03-09 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Mar 09 17:15:06 2017 +0000
- Revision:
- 14:147f7f2bc7c7
- Parent:
- 13:ed9e4aa00044
- Child:
- 20:446908281db5
Merge pull request #23 from ARMmbed/oob_test_mbed-os-5.4
Merging oob-test-mbed-os-5.4
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-sockets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:17bd84fc5087 | 1 | ### Getting started with the network-socket API ### |
mbed_official | 0:17bd84fc5087 | 2 | |
mbed_official | 0:17bd84fc5087 | 3 | This is a quick example of a simple HTTP client program using the |
mbed_official | 0:17bd84fc5087 | 4 | network-socket API that is provided as a part of [mbed-os](github.com/armmbed/mbed-os). |
mbed_official | 0:17bd84fc5087 | 5 | |
mbed_official | 0:17bd84fc5087 | 6 | The program brings up an underlying network interface, and uses it to perform an HTTP |
mbed_official | 0:17bd84fc5087 | 7 | transaction over a TCPSocket. |
mbed_official | 0:17bd84fc5087 | 8 | |
mbed_official | 5:3e952c60d705 | 9 | **Note:** The current example is limited to the ethernet interface on supported devices. |
mbed_official | 5:3e952c60d705 | 10 | To use the example with a different interface, you will need to modify main.cpp and |
mbed_official | 5:3e952c60d705 | 11 | replace the EthernetInterface class with the appropriate interface. |
mbed_official | 0:17bd84fc5087 | 12 | |
mbed_official | 13:ed9e4aa00044 | 13 | ### Expected output ### |
mbed_official | 13:ed9e4aa00044 | 14 | |
mbed_official | 13:ed9e4aa00044 | 15 | ``` |
mbed_official | 13:ed9e4aa00044 | 16 | IP address: 10.118.14.45 |
mbed_official | 13:ed9e4aa00044 | 17 | Netmask: 255.255.252.0 |
mbed_official | 13:ed9e4aa00044 | 18 | Gateway: 10.118.12.1 |
mbed_official | 13:ed9e4aa00044 | 19 | sent 39 [GET / HTTP/1.1] |
mbed_official | 13:ed9e4aa00044 | 20 | recv 173 [HTTP/1.1 200 OK] |
mbed_official | 13:ed9e4aa00044 | 21 | External IP address: 217.140.111.135 |
mbed_official | 13:ed9e4aa00044 | 22 | Done |
mbed_official | 13:ed9e4aa00044 | 23 | ``` |
mbed_official | 13:ed9e4aa00044 | 24 | |
mbed_official | 0:17bd84fc5087 | 25 | ### Documentation ### |
mbed_official | 0:17bd84fc5087 | 26 | |
mbed_official | 12:2e7466eba9a3 | 27 | More information on the network-socket API can be found in the [mbed handbook](https://docs.mbed.com/docs/mbed-os-api-reference/en/latest/APIs/communication/network_sockets/). |
mbed_official | 14:147f7f2bc7c7 | 28 | |
mbed_official | 14:147f7f2bc7c7 | 29 | ### Known issues |
mbed_official | 14:147f7f2bc7c7 | 30 | |
mbed_official | 14:147f7f2bc7c7 | 31 | - ARCH_PRO runtime fails for all toolchains - issue [here](https://github.com/ARMmbed/mbed-os-example-sockets/issues/17) |