Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Conversion to binary, how to? in C and matlab?? help me plz!

Status
Not open for further replies.

ahmad_abdulghany

Advanced Member level 4
Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,206
Helped
102
Reputation
206
Reaction score
22
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,769
Hello all,
I have a problem and i think that it can be solved via Matlab (i hope to solve it whatever was the method, matlab or not)

The problem is explained here after:

I have a file (.exe or .mp3 or any other type of files)

As far as i know, these files are stored on the computer hard disk in binary format, right?

I have a wireless link (Tx and Rx), I want to convert any file to serial data to go through COM serial port

I aim also of course that to retrieve the file to its original state after reception at the Rx end..

I think that it can also be done using C function, that read the file in binary format, and store it in a matrix, and i then read it byte by byte or something like that, but i don't know anything about syntax, i also ASSUME that it can be done as i said now... If there's a clever C guy, so please help me by writing that code ...

How can i do that? :(

Please help me out!
Thanks alot in advance,
Ahmad,
 

Ok...in plainer and simpler english?
You want to send or "copy" a data file over a wifi or serial?
link to a remotedestination, in C, C++ or Matlab.
If I understand it correctly, this is not so bad.
since it is not the programmer's but the operating system's
job to do the actual transfer and breakup into bits and bytes to
send over a communication channel, may it be serial or wifi (non serial).
 

Re: Conversion to binary, how to? in C and matlab?? help me

Anno said:
Ok...in plainer and simpler english?
You want to send or "copy" a data file over a wifi or serial?
link to a remotedestination, in C, C++ or Matlab.
If I understand it correctly, this is not so bad.
since it is not the programmer's but the operating system's
job to do the actual transfer and breakup into bits and bytes to
send over a communication channel, may it be serial or wifi (non serial).

Sorry, but i want to point out some thing
I'm not a programmer, I will build my own Tx and Rx (Whatever how),
then i want to connect the system as:
i have a Tx and Rx,
i have also a PC file (any type even txt file)
i want to convert it over any port (i said serial as i think it will be simple) to bit stream
this bit stream have to go from one PC to the Tx to air, to the Rx to the other PC .. all via any port

I dont' care what i will use, Matlab, C or even Visual Basic...
Link will be wireless one, so a protocole may be a must in this case to enhance BER and correct or detect errors, (but it's not important right now)

I will build the Tx and Rx not use them ready made modules ... and data rate is not an issue now...

thanks in advance,
Ahmad,
 

Then it sounds like a big project that will take you from 6months to a year.
The convertion to a byte or bitstream will def depend on the
Tx and Rx you are going to build.
Lets say you are using a DSP or other micro controller, it will depend on their input, isn't it.
Any way, maybe easiest way to send the file will be to
use Linux, open the file, open the desired port's filedescriptor and stream to the filedescriptor.
 

Re: Conversion to binary, how to? in C and matlab?? help me

Anno said:
use Linux, open the file, open the desired port's filedescriptor and stream to the filedescriptor.

Well, I'm using Suse 10,
and i have an mp3 file for example, how can i make the above steps to make it ready to send on COM1? and how to recieve it from the other end ??

Thanks,
Ahmad,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top