Artnet Poll回复包未得到确认通常是因为发送Artnet Poll消息的节点与接收节点不兼容导致的。需要确保发送的回复包与接收节点相同。
以下是一个可能的解决方案,以Python代码为例:
import socket
import struct
# Create UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind socket to Artnet port
sock.bind(('', 6454))
# Define the Artnet header
artnet_header = b'Art-Net\x00'
op_code = struct.pack('!H', 0x200)
proto_version = struct.pack('B', 14)
sequence = struct.pack('B', 0)
physical = struct.pack('B', 0)
# Define the Artnet Poll Reply packet
artnet_poll_reply = artnet_header + op_code + proto_version + sequence + physical
# Send the Artnet Poll Reply packet
sock.sendto(artnet_poll_reply, ('192.168.1.100', 6454))
# Wait for acknowledgement
acknowledgement, address = sock.recvfrom(1024)
# Check for acknowledgement
if acknowledgement != artnet_poll_reply:
print("Artnet Poll Reply packet not acknowledged")
else:
print("Artnet Poll Reply packet acknowledged")
该示例代码发送了一个Artnet Poll回复,然后等待接收到的确认包。如果收到的确认包与发送的回复包相同,则认为回复已经成功。如果未收到或收到的包不匹配,则会显示“Artnet Poll Reply packet not acknowledged”错误消息。