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.

how to detect the end of a binary file when i receive from uart

Status
Not open for further replies.

akshada

Member level 3
Joined
Jun 29, 2010
Messages
67
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
india
Activity points
1,746
hello all,
i am trying to receive binary file from my pc to microcontroller using uart.
but i am confused how to detect the end of file?
as i tried to detect \r(attached at the end of the binary string) which i am sending with the binary file.
but unfortunately only a few bytes i could have received because in my binary file there is a hex value 0x0D (equivalent of \r). So, is there any othere means to detect the end of binary file if i don't have any knowledge of the binary file(even size).


thanks in advance...
 

Detecting something implies that there is a characteristic that can directly or indirectly observed, related to the thing you're trying
to detect!
i don't have any knowledge of the binary file(even size)
If this is really true, then the sender needs to notify you, or you can infer the end of file by a delay, since the stream will
have stopped.

The sender can notify by sending a unique sequence, e.g. "!!!akshada this is the end of the file".
 

The sender can notify by sending a unique sequence, e.g. "!!!akshada this is the end of the file".
Because a binary file can contain arbitrary sequences, including the defíned eof sequence, you would regularly implement a protocol with an escape character. There are various commonly used protcocols for transmission of binary files, e.g. X-,Y- and ZMODEM.

The suggested timeout would be the most simple solution, provided you can guarantee a continuous transmission with an upper bound for the character-to-character delay.
 

thanks for the reply. I did put time limit and now i can receive the whole bunch of data ..thanks again..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top