描述 回传目前收到的封包所包含的资料量,这些资料都是目前可以读取的。要使用 available() 前必须先呼叫 UDP.parsePacket() ,否则 available() 的呼叫会失败。 available() 是从 Stream 继承而来。 语法 Udp.available() 参数 无参数 回传 int:目前可以读取的资料量,以位元组为单位 范例 See Also - Stream.available() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into […]
描述 封包完成后呼叫 endPacket() 会把封包传送到 beginPacket() 指定的目的地。 语法 Udp.endPacket(); 参数 无参数 回传 无回传值 范例 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 初始化 UDP 封包并指定封包欲传送至的 IP 位址及埠编号。 语法 Udp.beginPacket(remoteIP, remotePort); 参数 remoteIP:接收封包目的地的 IP 位址 remotePort:接收封包目的地的埠编号,型态为 int 回传 无回传值 范例 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 是否要使用大小为 16KB 的虚拟 EEPROM (它是透过 flash 实作的)。 语法 EEPROM.set_bank(flag) 参数 flag: 在 EEPROM 函式库中,指定是否要存取 16KB 的虚拟 EEPROM (布林值)。 假如 flag = true,代表 EEPROM 函式库存取的是 16 KB 虚拟 EEPROM。假如 flag = false,就是存取 200-byte 的 CMOS 虚拟 EEPROM。预设值是 false (存取 200-byte 的 CMOS 虚拟 EEPROM)。 回传 无回传值 范例 See also - EEPROM.read() - EEPROM.write() 函式库参考主页面 The […]
描述 把资料写进要透过 UDP 传送的封包。write() 必须在 beginPacket() 和 endPacket() 之间呼叫,beginPacket() 会初始化 UDP 封包,初始化后我们可以透过 write() 把资料写入封包中,要传送的资料都写入封包后呼叫 endPacket() 把封包传送出去。使用 86Duino 时封包最大可达 512 位元组,如果使用的是 arduino 封包最大可达 24 位元组。 语法 Udp.write(message); Udp.write(buffer, size); 参数 message:要写入封包的资料,型态是 char 或 string buffer:存有要写入封包资讯的阵列,型态是 byte 或 char size:buffer 的大小 回传 byte:回传写入封包的位元组数量 范例 函式库参考主页 The text of the 86Duino reference is a modification of the Arduino […]
描述 读取透过 UDP 接收到的资料。如果没有给参数,会回传待读资料中的第一个资料。 要使用 read() 前必须先呼叫 UDP.parsePacket() ,否则 read() 的呼叫会失败。 语法 Udp.read(); Udp.read(packetBuffer, MaxSize); 参数 packetBuffer:用来存放读取资料的阵列,型态为 char MaxSize:packetBuffer 的大小,型态为 int 回传 char:回传透过 UDP 接收到的资料 范例 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference […]
描述 设定与初始化 EthernetUDP 物件。 语法 Udp.begin(localPort); 参数 localPort:要监听的本地端埠编号,型态为 int 回传 无回传值 范例 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 中断与伺服端的连线。 语法 client.stop() 参数 无参数 回传 无回传值 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 删除所有接收到但还没读取的资料。 flush() 是从 Stream 继承而来。 语法 client.flush() 参数 无参数 回传 无回传值 See also - Stream.flush() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
描述 读取从伺服端传送至 Client 的资料。 read() 是从 Stream 继承而来。 语法 client.read() 参数 无参数 回传 byte:从伺服器传送来的资料,如果没有资料可以读取,会回传 -1 See Also - Stream.read() 函式库参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.