I'm using windows 7 and connected my phone using bluetooth. This connection uses a virtual COM port for communication, which I've configured to specified baud rate, flow control, word length, etc. before I call my php function
function sendmsg($str = 'AT\r\n', $device = 'COM5'){
$handle = fopen($device, "w+b");
stream_set_blocking($handle, 0);
fwrite($handle, $str);
fclose($handle);
return true;
}
Now the problem is fopen() throws me an error saying that it is an invalid argument and it has failed to opened stream and all else fails. But my phone says it is connected to my computer and then flashes an alert that bluetooth connection has failed. When I tried the same configuration parameters over PuTTY I was able to do what I wanted to do. I've also tried it on C# but that too ended up with the same result :(