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.
Revision 0:02ad3aa4b420, committed 2012-03-01
- Comitter:
- ceri
- Date:
- Thu Mar 01 15:01:27 2012 +0000
- Commit message:
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Mar 01 15:01:27 2012 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+
+extern "C" void mbed_mac_address(char *s)
+{
+ char mac[6];
+ mac[0] = 0x00;
+ mac[1] = 0x02;
+ mac[2] = 0xf7;
+ mac[3] = 0xf0;
+ mac[4] = 0x46;
+ mac[5] = 0x4b;
+
+ memcpy(s, mac, 6);
+}
+
+
+// the one on my desk ........ 00 02 f7 f0 55 5e
+// the one on the fireplace .. 00 02 f7 f0 46 4b
+
+// 00:02:f7:f0:46:4b .. from tweet program ?
+
+// -> http://mbed.org/forum/mbed/topic/972/?page=1#comment-10318
+
+// Going to write the MAC address from one of my MBED's to annother MBED.
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX); // tx, rx pc.baud(921600);
+
+int main()
+{
+ uint64_t uid = 0;
+ char mmac[6];
+ char mac[6];
+
+ pc.baud(921600);
+
+ pc.printf("Trying to overwrite MAC Address ..\r\n");
+
+ mbed_mac_address(mmac);
+ uid = mmac[0] << 40 | mmac[1] << 32 |
+ mmac[2] << 24 | mmac[3] << 16 |
+ mmac[4] << 8 | mmac[5] << 0;
+
+ pc.printf ("Here it is .. %02x %02x %02x %02x %02x %02x .. \r\n", mmac[0], mmac[1], mmac[2], mmac[3], mmac[4], mmac[5]);
+
+ while (1)
+ {
+ myled = 1;
+ wait(0.2);
+ myled = 0;
+ wait(0.2);
+ }
+}
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 01 15:01:27 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4c0c40fd0593