serial-port

Bluetooth Chat between Android device and PC [closed]

自古美人都是妖i 提交于 2019-12-19 04:11:54
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . Is it possible to connect the Bluetooth Chat sample with a PC? How can I receive the information to the PC? I thought that I can use the Serial Port Profile (SPP) from the Android device and open a regular COM Terminal on the PC. Actually my application requires sending the

Freeze on SerialPort.Open / DeviceIoControl / GetcommState with usbser.sys

江枫思渺然 提交于 2019-12-19 04:03:10
问题 I have a C program which opens a handle to a COM port, writes some bytes to it, reads some bytes out, then closes the handle and exits. However, when I run the program like 10 times in a row, it starts to take very long to complete the GetCommState function and to get stuck in the SetCommState function. The same thing happens in C# with a simple SerialPort object. The only fix I could find is reconnecting the device to the port. Is there some more elegant way to get rid of this freeze? Is it

C# serial communication with u-blox gps

假装没事ソ 提交于 2019-12-19 03:45:29
问题 I have a GPS from u-blox.com with a USB-connection and driver. The driver installs a virual COM port that pops up when you plug the USB in. Using a hyperterminal I can then watch the flow of data from the GPS. Then I want the data in my program, not so easy... I have implemented some methods using the serialPort class to read from the GPS, but am unsuccessful. I have programmed several serial device readers and writers before in C#, but this one stops me. As an example, the simple code in

PySerial [Error 5] Access is Denied

你离开我真会死。 提交于 2019-12-19 03:45:26
问题 I am trying to write a program in Python that will loop to keep checking the serial port (COM4) and print out a message when the character "1" is read from the serial port. I want to send "1" over the serial port from an Arduino gadget upon the push of a button. However, I get the error "[Error 5]: Access is Denied" when I try to create an instance of a serial object. (It automatically tries to open upon instantiation, which is where the error is, from what I can see from the file in the

PySerial [Error 5] Access is Denied

隐身守侯 提交于 2019-12-19 03:45:14
问题 I am trying to write a program in Python that will loop to keep checking the serial port (COM4) and print out a message when the character "1" is read from the serial port. I want to send "1" over the serial port from an Arduino gadget upon the push of a button. However, I get the error "[Error 5]: Access is Denied" when I try to create an instance of a serial object. (It automatically tries to open upon instantiation, which is where the error is, from what I can see from the file in the

Continuously reading from serial port asynchronously properly

百般思念 提交于 2019-12-19 03:14:11
问题 I'm just going to preface this by saying I just started trying to use Async today, so I have a very limited understanding of what I am doing. I was previously using threads to read data from a serial port, process that data into data to write, and then writing it. I had 1 thread reading data and placing it into a buffer, another thread processing data from a buffer, and a final thread writing it. This way if I clicked a button, I could send additional data. Now I am just trying to learn and

how to detect a buffer over run on serial port in linux using c++

元气小坏坏 提交于 2019-12-18 17:57:33
问题 I have a big problem. At present I am accessing a serial port via the following hooks: fd = open( "/dev/ttyS1", O_RDWR | O_NOCTTY ) then I read from it using the following chunk of code i = select( fd + 1, &rfds, NULL, NULL, &tv ) ... iLen = read( fd, buf, MAX_PACKET_LEN ) the problem is that before I read, I need to detect if there were any buffer overruns. Both at the serial port level and the internal tty flip buffers. We tried cat /proc/tty/driver/serial but it doesn't seem to list the

Set DCB Fails When Attempting to Configure COM Port

强颜欢笑 提交于 2019-12-18 17:13:33
问题 I'm trying to write a C++ MFC application that uses the serial port (e.g. COM8). Every time I try to set the DCB it fails. If someone can point out what I'm doing wrong, I'd really appreciate it. DCB dcb = {0}; dcb.DCBlength = sizeof(DCB); port.Insert( 0, L"\\\\.\\" ); m_hComm = CreateFile( port, // Virtual COM port GENERIC_READ | GENERIC_WRITE, // Access: Read and write 0, // Share: No sharing NULL, // Security: None OPEN_EXISTING, // The COM port already exists. FILE_FLAG_OVERLAPPED, //

Open com port in php

主宰稳场 提交于 2019-12-18 17:08:31
问题 I have a usb 3G modem Huawei E1550 and Windows XP. I want to send sms with this modem trhow php. I use this function to open a modem com port: $fp = fopen ("COM3:", "wb+"); if (!$fp) { echo "Not open"; } else { echo "Open"; } And every time I get a error: Warning: fopen(COM3:) [function.fopen]: failed to open stream: Invalid argument in D:\Apache\htdocs\z91.ru\audio\test.php on line 3 回答1: You can also try removing the colon next to the COMn for this to work exec("mode COM3 BAUD=9600 PARITY=N

Serial port binary transfer changes carriage return

偶尔善良 提交于 2019-12-18 16:40:31
问题 I have been trying to implement a primitive serial file transfer protocol in C this past week and I've come across a really weird problem which I can't seem to find the solution for online. I've managed to transfer binary data over the serial port and receive it but in the process, all the "0D" bytes are converted to "0A". The following is my code. #include <stdlib.h> #include <stdio.h> /* Standard input/output definitions */ #include <string.h> /* String function definitions */ #include