Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $fwd_sock = stream_socket_client("udp://192.168.1.10:5001", $errno, $errstr);
- /*if (!$fp) {
- echo "ERROR: $errno - $errstr<br>\n";
- } else {
- */
- $write = '';
- //$chars = array(0x01, 0x01, 0x00, 0x04, 0x00, 0x28, 0x00, 0x02, 0x00, 0x95); //opendoor door=1
- $chars = array(0x01, 0x01, 0x00, 0x04, 0x00, 0x28, 0x00, 0x01, 0x00, 0x77); //opendoor door=0
- //$chars = array(0x00, 0x02, 0x00, 0x95); //open door 1
- //sendPacket(array(0x95));
- foreach ($chars as $aChar) {
- $write .= chr($aChar);
- }
- fwrite($fwd_sock,$write);
- echo fread($fwd_sock, 8);
- fclose($fwd_sock);
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement