Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // declare variables
- $handle = $reply = null;
- $filename = '/dev/ttyUSB1';
- $handle = fopen($filename, 'r+');
- // validate file handle
- // main code.
- if ( fwrite($handle, 'AT') ) {
- echo 'Command is sent';
- $reply = fread($handle, 4);
- echo $reply;
- }else{
- echo 'The device isn\'t read';
- }
- fclose( $handle );
- die;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement