473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Transmiting data format

8
Hi everyone,

I would like to transmit a stream of bits formatted to my liking, between two PCs, i already have a conection betwen them which will allow me to transmit data, an array with a string for example.

My problem is i don't have any idea as to how to go about defining the format, so that both PCs can parse it and pick out relevant information.

I need to know how to create and send frames, example:

start_bit + character + stop_bit; where the character will inclued the parity bit

I also need to know how to implement data identification, as i am sendng different types of information:

example; at one point i may ned to send, say, user_information;
which may include user_name user_password etc.

and at another time i may want to send somthing else, like, say,
system_info; which may include system_status, number_of_users, ect.

basically, the recieving PC must be able to tell:

1) what data is being sent: user or system info

2) if its user info, where does user_name stop, and user_password begin, and where does the whole user_info stop.



I am using MS visual studio .NET 2003 and programmng in C++.

If you can give some suggstions or direct me to some resource that covers this kind of thing, i would be most greatful.

Thanks very much for your attention

You are invited to be as generous as possible with your sugestions.
All suggestions welcomed.
Mar 24 '07 #1
1 1263
horace1
1,510 Expert 1GB
I assume you are using the serial ports of the PCs to sends bytes. What you need to do is to define a protocol or set of rules defining the communications. For example, you could send frames with a format so
frame length (byte) command (byte) data data data etc

you read the first byte with tells you the frame length and you read it into an array or vector.
The first byte of the frame then tells you what it is, e.g.
1 read a file
2 send a file
3 list a directory
etc - it all depends what you wish to do

have a look at the ftp (file transfer protocol) for an example of a protocol that has been in use for many years
http://cr.yp.to/ftp.html
Mar 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
2
by: Trader | last post by:
Hi, I'm trying to use Mark Hammond's win32clipboard module to extract more complex data than just plain ASCII text from the Windows clipboard. For instance, when you select all the content on...
7
by: Bob | last post by:
Hi, I am trying to use BULK INSERT with format file. All of our data has few bytes of header in the data file which I would like to skip before doing BULK INSERT. Is it possible to write...
8
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
2
by: Adam Honek | last post by:
I have a form. It has serveral text boxes for user data entry. I could of course write code to check if each is empty before proceeding to save this data to a file. Is there any global way...
7
by: basyarie | last post by:
Dear VB mania, especially VB6 specialist I have a problem with my GPS. So far, I have a GPS-M1zz from Pioneer Navicom company. It has 2 type of data format, i.e. Pioneer Format and NMEA data...
4
by: rajeshkrout | last post by:
actually I want to know the function of SMTP server name in transmiting the mail from a hosted web site or the proceduere for sending a mail
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.