serial-communication

Connect the Accessory to my JailBreak iPhone Device

余生长醉 提交于 2020-01-01 09:25:09
问题 I am using serial programming for get connected serial cable to my iPhone my code is as under #include <stdio.h> /* Standard input/output definitions */ #include <string.h> /* String function definitions */ #include <unistd.h> /* UNIX standard function definitions */ #include <fcntl.h> /* File control definitions */ #include <errno.h> /* Error number definitions */ #include <termios.h> /* POSIX terminal control definitions */ static struct termios gOriginalTTYAttrs; static int OpenSerialPort(

Why the buffer is empty?

岁酱吖の 提交于 2019-12-25 08:59:02
问题 I am trying to check some values some AT commands ran on a GSM modem. I am stuck at the point where when trying to check if the output of a command contains some values is true or not. Using the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.IO; using System.Timers; namespace SerialTest { public class Program { public static void Main(string[] args) { string buff="0"; string ok = "OK"; SerialPort p =

Inheriting QSerialPort

早过忘川 提交于 2019-12-25 08:43:11
问题 Perhaps a rather silly and newbie question but I have been struggling with keeping my QSerialPort serial; being used within the entirety of the application I am making. (Ughh this is frustrating to explain) To be more clear I have the aforementioned QSerialPort serial; established in my MainWindow.cpp , but as I transition to another form which has a different class (for example operations.cpp ) I am unsure on how to keep and use my serial.* functions. My mainwindow.cpp form is just a

read the latest line of a serial port

大憨熊 提交于 2019-12-25 00:51:14
问题 I haven't ever written any code in tcl and pretty novice on serial communication, so sorry in advance if my question doesn't make sense. I'm trying to solve this problem where I want to listen to a serial port and print the updates line by line in SciLab like a normal serial terminal (e.g. Arduino's serial monitor). The Serial Communication Toolbox for Scilab has a readserial macro (source on GitHub): function buf=readserial(h,n) if ~exists("n","local") then N=serialstatus(h); n=N(1) end TCL

Scilab 5.5.2 function as a block in xcos : Variable returned by scilab argument function is incorrect [

拜拜、爱过 提交于 2019-12-25 00:38:08
问题 I have been trying to get the ultrasonic data from an arduino using serial communication toolbox in scilab to be brought in the xcos simulation. To do this I followed Include a Scilab function/script as a block in xcos/scicos and created my own function. Is there a way to plot the serialread data in xcos scope? or i think my implementation is wrong in the scilab function. Iam Using Windows 10 64bit SCILAB function function y = serialREAD(a) h = openserial(7, "9600,n,8,1") // open COM7 for ii

how to send 100 digit in serial communication from processing to arduino

痴心易碎 提交于 2019-12-24 19:29:20
问题 i am converting pixel array to String and send this String to arduino. but i Think this String is not converted properly because Serial.write send (8 bit or 8 character) i don’t know. and also want to send 100 character of string into Serial . please send your suggestion and getting help me out of this problem. for any mistake Sorry in advance. for(int x =0 ; x < img.height; x++) { for(int y=0; y <img.width; y++) { int i = x+y*width; if(img.pixels[i] == color(0,0,0)) { i=1; } else { i=0; }

to transmit and receive floating point using serial communication c++

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 06:44:07
问题 using WiringPi library for serial communication on Raspberrypi the function serialPutchar(int fd, unsigned char c) and serialGetchar (int fd) works fine to send and receive integer value but does not show floating points sender side int main () { int fd ; int count ; float val; if ((fd = serialOpen ("/dev/ttyAMA0", 9600)) < 0) { fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ; return 1 ; } if (wiringPiSetup () == -1) { fprintf (stdout, "Unable to start wiringPi: %s\n

Serial port - how to perform safe search for my device?

家住魔仙堡 提交于 2019-12-24 01:49:22
问题 Im writing application that communicate (via serial port) with electronic device which i designed myself. When my PC application starts - it opens available COM ports one by one and it sends some string ("What are you?" for example). My device is programmed, to reply to that "magic question" with own ID (for example: "I am evil device for supervising employees"). When my PC software receive that "magic reply" it starts working normally and its not searching other ports anymore. Of course im

What is the minimum packet latency that can be achieved with classic bluetooth (2.1) devices?

左心房为你撑大大i 提交于 2019-12-24 01:38:10
问题 I'm using RN42 (http://www.microchip.com/wwwproducts/en/RN42) bluetooth module at 115200 bauds (UART SSP mode) to send very small (1 - 20 byte) serial data messages between a computer and a ATMega328 MCU. I find that the latency for one message is somewhere around 60 - 100 ms. I would need 10 ms or less in my application. I'm wondering if this is even possible with bluetooth 2.1 devices.´ I know that theoretically bluetooth packets can be sent every 2 * 625 us from one end since 625 us is the

Change SerialPort's BaudRate while connection is open

廉价感情. 提交于 2019-12-24 00:58:07
问题 I am using SerialPort class to communicate with an external device. I start the communication at 300 Baud per second however after the initial "handshake" I have to switch to a Baud rate specified by the device (usually 9600 Bps). I have been unsuccessful in my attempts to continue communicating after I increase Baud rate however I am not sure why. That leads me to my question: What is the proper way of changing the Baud rate? Can it be done while the connection is open, or should I close the