serial-communication

Calculate Block Check Character (BCC) for serial communication

前提是你 提交于 2019-12-05 19:29:24
I am communicating with a device via serial via the SerialPort class of .NET and based on third-party device specification requirements I need to calculate a "block check character". The only information I am told is that it is an exclusive OR operation (XOR) and it must be performed over all characters. So if I have the string "Bob,001" how would one calculate the BCC? Most likely is character based XOR. You'll need to get samples of them to verify but most checksums usually end up at 0. So, for an XOR checksum, you would have the packet: Bob,001X where X is the checksum and, when you XOR all

Connect the Accessory to my JailBreak iPhone Device

我的梦境 提交于 2019-12-04 06:13:05
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() { int fileDescriptor = -1; int handshake; struct termios options; // Open the serial port read/write,

kernel driver reading ok from user space, but writing back is always 0

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 05:45:58
So I'm working my way through kernel driver programming, and currently I'm trying to build a simple data transfer between application and kernel driver. I am using simple character device as a link between these two, and I have succeeded to transfer data to driver, but I can't get meaningful data back to user space. Kernel driver looks like this: #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> /* printk() */ #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> #include <asm/uaccess.h> /* copy_from/to_user */

php serial communication in linux

喜你入骨 提交于 2019-12-04 00:55:28
问题 I have installed xampp in fedora 13.I am trying to communicate with microcontroller through serial port using php serial class. My code is example.php include("php_serial.class.php"); $serial = new phpSerial(); $serial->deviceSet("0"); $serial->confBaudRate(9600); //Baud rate: 9600 $serial->confParity("none"); //Parity (this is the "N" in "8-N-1") $serial->confCharacterLength(8); //Character length (this is the "8" in "8-N-1") $serial->confStopBits(1); //Stop bits (this is the "1" in "8-N-1")

Reading data from Arduino UNO R3 kit

我的梦境 提交于 2019-12-03 21:06:04
问题 I'm trying to read the data already stored by me in the Arduino kit , I'm using the physicaloid library to achieve this. I tested the kit (reading data) by connecting it to my PC using the Type B USB cable provided by Arduino itself and using Tera Term . The data begins to transfer after I press '@' on the keyboard (specific to our implementation). But when I connect it my Android tablet and use the test project by physicaloid to open a device and start communicating, every time I click 'open

Calculating modbus RTU 3.5 character time

荒凉一梦 提交于 2019-12-03 13:27:45
问题 am new to Modbus and developing an application using Modbus RTU. I would like to know how to find out the RTU message frame separation time. In the Modbus RTU specification, It mentions 3.5 chars time, but there is no more data about how i can decide this intervals. and wat are the steps to calculate the separation time? 回答1: Take a look at page 13 of the Modbus Serial Line Protocol and Implementation Guide V1.02 At the bottom you will find a remark explaining the inter-character time-out (t1

Calculating modbus RTU 3.5 character time

半城伤御伤魂 提交于 2019-12-03 03:26:26
am new to Modbus and developing an application using Modbus RTU. I would like to know how to find out the RTU message frame separation time. In the Modbus RTU specification, It mentions 3.5 chars time, but there is no more data about how i can decide this intervals. and wat are the steps to calculate the separation time? Take a look at page 13 of the Modbus Serial Line Protocol and Implementation Guide V1.02 At the bottom you will find a remark explaining the inter-character time-out (t1.5) and inter-frame delay (t3.5) values. For baud rates over 19200 values are fixed. For slower baud rates

Using GPRS and GSM Simulatneously

十年热恋 提交于 2019-12-02 16:00:54
问题 I am trying to use GPRS functionality of the GSM/GPRS modem for sending data to the remote server but i am unable to do so.I had posted a question on Arduino Forum but didn't get any reply.Here is the link for the question. Well my Main concern is i) I am using a GPRS/GSM Modem and i am not sure about the Power requirements of the Modem.At present i am using a 9V and 1 amp supply but the network LED on the modem is dignifying that Modem is not getting the network. So can this be because of

Serial RS232 Communication Checksums?

痴心易碎 提交于 2019-12-02 12:45:46
I am communicating with a servo via RS232 serial. The built-in functions that came with my servo are too slow (25 ms for a simple 54 byte message on a 57,600 baud port), so I am trying to write my own communication functions, however the built-in functions are not documented. I have used a port monitor to determine what information is being sent to the servo and I need help deciphering the results. I used the built-in functions to command the servo to "goto" incrementally increasing steps (1, 2, 3, etc.). This resulted 5 packets being sent to the servo for each "goto" command. The first 4

Using GPRS and GSM Simulatneously

泄露秘密 提交于 2019-12-02 09:22:57
I am trying to use GPRS functionality of the GSM/GPRS modem for sending data to the remote server but i am unable to do so.I had posted a question on Arduino Forum but didn't get any reply. Here is the link for the question . Well my Main concern is i) I am using a GPRS/GSM Modem and i am not sure about the Power requirements of the Modem.At present i am using a 9V and 1 amp supply but the network LED on the modem is dignifying that Modem is not getting the network. So can this be because of the insufficient supply to the modem? I very much doubt it's a power thing. Although I have limited