本文整理汇总了C++中WiFiUDP::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ WiFiUDP::stop方法的具体用法?C++ WiFiUDP::stop怎么用?C++ WiFiUDP::stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WiFiUDP
的用法示例。
在下文中一共展示了WiFiUDP::stop方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stopAll
void WiFiUDP::stopAll()
{
for (WiFiUDP* it = _s_first; it; it = it->_next) {
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) it, (uint32_t) _s_first);
it->stop();
}
}
示例2: AJ_Net_MCastUp
AJ_Status AJ_Net_MCastUp(AJ_MCastSocket* mcastSock)
{
uint8_t ret = 0;
AJ_InfoPrintf(("AJ_Net_MCastUp(mcastSock=0x%p)\n", mcastSock));
//
// Arduino does not choose an ephemeral port if we enter 0 -- it happily
// uses 0 and then increments each time we bind, up through the well-known
// system ports.
//
ret = g_clientUDP.begin(AJ_EphemeralPort());
if (ret != 1) {
g_clientUDP.stop();
AJ_ErrPrintf(("AJ_Net_MCastUp(): begin() fails. status=AJ_ERR_READ\n"));
return AJ_ERR_READ;
} else {
AJ_IOBufInit(&mcastSock->rx, rxData, sizeof(rxData), AJ_IO_BUF_RX, (void*)&g_clientUDP);
mcastSock->rx.recv = AJ_Net_RecvFrom;
AJ_IOBufInit(&mcastSock->tx, txData, sizeof(txData), AJ_IO_BUF_TX, (void*)&g_clientUDP);
mcastSock->tx.send = AJ_Net_SendTo;
}
AJ_InfoPrintf(("AJ_Net_MCastUp(): status=AJ_OK\n"));
return AJ_OK;
}
示例3: stopAll
void WiFiUDP::stopAll()
{
for (WiFiUDP* it = _s_first; it; it = it->_next) {
DEBUGV("%s %p %p\n", __func__, it, _s_first);
it->stop();
}
}
示例4: stopAllExcept
void WiFiUDP::stopAllExcept(WiFiUDP * exC) {
for (WiFiUDP* it = _s_first; it; it = it->_next) {
if (it->_ctx != exC->_ctx) {
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) it, (uint32_t) _s_first);
it->stop();
}
}
}
示例5: stopAllExcept
void WiFiUDP::stopAllExcept(WiFiUDP * exC) {
for (WiFiUDP* it = _s_first; it; it = it->_next) {
if (it->_ctx != exC->_ctx) {
DEBUGV("%s %p %p\n", __func__, it, _s_first);
it->stop();
}
}
}
示例6: readLinuxEpochUsingNTP
// http://www.arduino.cc/en/Tutorial/WiFiRTC
unsigned long readLinuxEpochUsingNTP()
{
Udp.begin(localPort);
sendNTPpacket(timeServer); // send an NTP packet to a time server
// wait to see if a reply is available
delay(1000);
if ( Udp.parsePacket() ) {
Serial.println("NTP time received");
// We've received a packet, read the data from it
Udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
//the timestamp starts at byte 40 of the received packet and is four bytes,
// or two words, long. First, esxtract the two words:
unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
// combine the four bytes (two words) into a long integer
// this is NTP time (seconds since Jan 1 1900):
unsigned long secsSince1900 = highWord << 16 | lowWord;
// now convert NTP time into everyday time:
// Unix time starts on Jan 1 1970. In seconds, that's 2208988800:
const unsigned long seventyYears = 2208988800UL;
// subtract seventy years:
Udp.stop();
return (secsSince1900 - seventyYears + timeZone * SECS_PER_HOUR);
}
else {
Udp.stop();
return 0;
}
}
示例7: AJ_Net_MCastDown
void AJ_Net_MCastDown(AJ_MCastSocket* mcastSock)
{
AJ_InfoPrintf(("AJ_Net_MCastDown(mcastSock=0x%p)\n", mcastSock));
g_clientUDP.flush();
g_clientUDP.stop();
}