Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ethernet.cpp@1:32ebac4d3716, 2015-02-19 (annotated)
- Committer:
- meddahihadj
- Date:
- Thu Feb 19 13:29:00 2015 +0000
- Revision:
- 1:32ebac4d3716
DEUXIEME PROGRAMME
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| meddahihadj | 1:32ebac4d3716 | 1 | #include "mbed.h" |
| meddahihadj | 1:32ebac4d3716 | 2 | |
| meddahihadj | 1:32ebac4d3716 | 3 | Ethernet eth; |
| meddahihadj | 1:32ebac4d3716 | 4 | |
| meddahihadj | 1:32ebac4d3716 | 5 | int ether() { |
| meddahihadj | 1:32ebac4d3716 | 6 | char buf[0x600]; |
| meddahihadj | 1:32ebac4d3716 | 7 | |
| meddahihadj | 1:32ebac4d3716 | 8 | while(1) { |
| meddahihadj | 1:32ebac4d3716 | 9 | int size = eth.receive(); |
| meddahihadj | 1:32ebac4d3716 | 10 | if(size > 0) { |
| meddahihadj | 1:32ebac4d3716 | 11 | eth.read(buf, size); |
| meddahihadj | 1:32ebac4d3716 | 12 | printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\n", |
| meddahihadj | 1:32ebac4d3716 | 13 | buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); |
| meddahihadj | 1:32ebac4d3716 | 14 | printf("Source: %02X:%02X:%02X:%02X:%02X:%02X\n", |
| meddahihadj | 1:32ebac4d3716 | 15 | buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]); |
| meddahihadj | 1:32ebac4d3716 | 16 | } |
| meddahihadj | 1:32ebac4d3716 | 17 | |
| meddahihadj | 1:32ebac4d3716 | 18 | wait(1); |
| meddahihadj | 1:32ebac4d3716 | 19 | } |
| meddahihadj | 1:32ebac4d3716 | 20 | } |