|
楼主 |
发表于 2015-8-28 12:17:28
|
显示全部楼层
- #include <net.h>
- #include <EtherCard.h>
-
- // ethernet interface mac address, must be unique on the LAN
- static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
-
- byte Ethernet::buffer[800];
- static uint32_t timer;
-
- char website[] = "www.vckbase.com/index.php/video";
-
- // called when the client request is complete
- static void response_callback (byte status, word off, word len) {
-
- Serial.print((const char*) Ethernet::buffer + off);
- }
-
- void setup () {
- Serial.begin(9600);
- Serial.println("\n[webClient]");
-
- if (ether.begin(sizeof Ethernet::buffer, mymac,10) == 0)
- Serial.println( "Failed to access Ethernet controller");
- if (!ether.dhcpSetup())
- Serial.println("DHCP failed");
-
- ether.printIp("IP: ", ether.myip);
- ether.printIp("GW: ", ether.gwip);
- ether.printIp("DNS: ", ether.dnsip);
-
- if (!ether.dnsLookup(website))
- Serial.println("DNS failed");
-
- ether.printIp("SRV: ", ether.hisip);
-
- }
-
- void loop () {
- ether.packetLoop(ether.packetReceive());
-
- if (millis() > timer) {
- timer = millis() + 10000;
- Serial.println();
- Serial.print("<<<REQ\n");
- ether.browseUrl(PSTR("/demo/"), "aphorisms.php", website, response_callback);
- }
- }
复制代码
这是测试的论坛里的另外一段代码,串口显示
真是要被逼疯了,求大神解救
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|