Taaak to nevím. Nemohu sloužit. Je to laborování na dlouhé večery. Možná jen popostrčení co jsem kdysi použil v .NET......
Z nápovědy PHP bych asi použil toto:
A simple example how to send a raw udp packet
<?php
$frame = array(
array(1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1),
array(1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1),
array(1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1),
array(1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1),
array(1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1),
array(1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1),
array(1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1),
array(1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1)
);
send_frame($frame, 1500);
/**
* Sends 18x8 MCUF-UDP packet to target host.
*
* see also:
* wiki.blinkenarea.org/index.php/MicroControllerUnitFrame
*
* @param array $frame 18x8 '0' or '1'
* @param int $delay delay in msec
* @param string $host target host
* @param int $port target port (udp)
*/
function send_frame($frame, $delay, $host="192.168.0.23", $port=2323) {
$header = "\x23\x54\x26\x66\x00\x08\x00\x12\x00\x01\x00\xff";
$buf = $header;
for ($i=0;$i<8;$i++) {
for ($j=0;$j<18;$j++) {
if ($frame[$i][$j]) {
$buf.="\xff";
} else {
$buf.="\x00";
}
}
}
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_sendto($socket, $buf, strlen($buf), 0, $host, $port);
socket_close($socket);
usleep($delay*1000);
}
?>
Data naplnit něčím jako je toto:
ReDim SendData(67 + (Values.Length / 2) * 8)
SendData(0) = &H0
SendData(1) = &H41
SendData(2) = &H4E
SendData(3) = &H2D
SendData(4) = &H44
SendData(5) = &H2E
SendData(6) = &H63
SendData(7) = &H7A
SendData(8) = &H2F
SendData(9) = &H53
SendData(10) = &H44
SendData(11) = &H53
SendData(12) = &H2
SendData(13) = &H6
SendData(14) = &H0
SendData(15) = &H77
SendData(16) = &H72
SendData(17) = &H72
SendData(18) = &H61
SendData(19) = &H6D
SendData(20) = &H0
SendData(21) = &H0
SendData(22) = &H0
SendData(23) = &H0
SendData(24) = &H0
SendData(25) = &H0
SendData(26) = &H0
SendData(27) = &H1
'delka hesla
SendData(28) = &H0
SendData(29) = &H0
SendData(30) = &H0
SendData(31) = gPSW.Length
'kodovani hesla
For n = 0 To 31
If n < gPSW.Length Then
SendData(32 + n) = &HA5 Xor Asc(Mid(gPSW, n + 1, 1))
Else
SendData(32 + n) = &H0
End If
Next
'pocet paru
D2H(Values.Length / 2, dword) 'rozlozi na hex pary
SendData(64) = Val(dword(0))
SendData(65) = Val(dword(1))
SendData(66) = Val(dword(2))
SendData(67) = Val(dword(3))
'pary 4x index + 4x value
nn = 0
For n = 68 To 68 + ((Values.Length / 2) - 1) * 8 Step 8
D2H(Values(0, nn), dword) 'index do ram
SendData(n + 0) = Val(dword(0))
SendData(n + 1) = Val(dword(1))
SendData(n + 2) = Val(dword(2))
SendData(n + 3) = Val(dword(3))
D2H(Values(1, nn), dword) 'hodnota
SendData(n + 4) = Val(dword(0))
SendData(n + 5) = Val(dword(1))
SendData(n + 6) = Val(dword(2))
SendData(n + 7) = Val(dword(3))
nn = nn + 1
Next