Browse Source

add files

coolsoul 1 year ago
parent
commit
9642e4c101
2 changed files with 19 additions and 0 deletions
  1. 3 0
      libreelec/buildcommand.txt
  2. 16 0
      qt/udpserver.txt

+ 3 - 0
libreelec/buildcommand.txt

@@ -0,0 +1,3 @@
+https://wiki.libreelec.tv/development/build-commands/build-commands-le10
+
+PROJECT=Allwinner ARCH=arm DEVICE=H3 make image

+ 16 - 0
qt/udpserver.txt

@@ -0,0 +1,16 @@
+QUdpSocket* m_udpSocket = nullptr;
+    m_udpSocket = new QUdpSocket(this);
+    m_udpSocket->bind(QHostAddress::Any, 8776);
+    connect(m_udpSocket, &QUdpSocket::readyRead, this, [this](){
+        while(m_udpSocket->hasPendingDatagrams())
+        {
+            QByteArray datagram;
+            QHostAddress address;
+            quint32 ipAddress;
+            datagram.resize(m_udpSocket->pendingDatagramSize());
+            qint64 bytesRead = m_udpSocket->readDatagram(datagram.data(), datagram.size(), &address);
+            ipAddress = address.toIPv4Address();
+            QString ipAddressString = QString("%1.%2.%3.%4").arg((ipAddress>>24) & 0xFF).arg((ipAddress>>16) & 0xFF).arg((ipAddress>>8) & 0xFF).arg((ipAddress) & 0xFF);
+            qDebug() << datagram.data() << ipAddressString;
+        }
+    });