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.
Dependents: IBMIoTClientEthernetExample_WIZnet
Fork of MQTT by
Revision 49:66f37eda441b, committed 2015-09-17
- Comitter:
- hkjung
- Date:
- Thu Sep 17 04:42:08 2015 +0000
- Parent:
- 48:1de971b62543
- Commit message:
- Modified the netinfo allocation method
Changed in this revision
| MQTTEthernet.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MQTTEthernet.h Tue Sep 15 00:42:21 2015 +0000
+++ b/MQTTEthernet.h Thu Sep 17 04:42:08 2015 +0000
@@ -6,11 +6,16 @@
#include "EthernetInterface.h"
#include "MQTTSocket.h"
-uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x1D, 0x69, 0xF3};
-//uint8_t mac_addr[6] = {0x00, 0x02, 0xf7, 0xf2, 0x05, 0x00};
-//const char * ip_addr = "222.98.173.213";
-//const char * gw_addr = "222.98.173.254";
-//const char * snmask = "255.255.255.192";
+// Use DHCP mode
+// Note: Please fill up the mac_addr array using VALID MAC address
+uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x00, 0x99};
+
+// Use Static IP
+// Note: Please fill up the 'xx' field using VALID network information
+//uint8_t mac_addr[6] = {xx, xx, xx, xx, xx, xx};
+//const char * ip_addr = "xx.xx.xx.xx";
+//const char * gw_addr = "xx.xx.xx.xx";
+//const char * snmask = "xx.xx.xx.xx";
class MQTTEthernet : public MQTTSocket
{
@@ -19,8 +24,8 @@
{
wait(1);
this->createSocket();
- //eth.init(mac_addr,ip_addr,snmask,gw_addr); // Use Static IP
- eth.init(mac_addr); // Use DHCP
+ //eth.init(mac_addr, ip_addr, snmask, gw_addr); // Use Static IP
+ eth.init(mac_addr); // Use DHCP
eth.connect();
}
