Question: The aracalmagoData function should be caled when the first image pecket is recelved to erase the memory. If any pecket is drapped or comupied during
The aracalmagoData function should be caled when the first image pecket is recelved to erase the
memory. If any pecket is drapped or comupied during transmission, you can cal this function to erase the
Imape.
The cavilmagaData function should be called every tirre when you wart to save parts of the imape data.
Plesse nats you art not allowsd to edt the main function, oracsimagoData function, cavelmagoData
function.
Plesse complete tre Imagefiecelver function, taking care to implement the necessary fanctionality. Also
write a fanction to calculste crciixmodem of the packet as mentioned to make sure the packet is not
corrupted.
The code is presented in the mainc fle provided wth this document. You can copy the progrem and pasis it
When you run the program without ediling, you wil see "Toy Prqjector Flmmere v is running" without any
warnings and emors. You will aso notice that the imspefiecelver function is receling a stram of imape
packets. If you write the imagefiecelver finction consctly, you will see the image printed in the consal. A small boy is used to project images.The projector has limited memory and can store only one image at a time.To update the image in the projector, It must be sent over the usb connection. However since the image is large, it cannot be sent in a single packet. Therefore the pc software divides the image into packets for transmission. The packet frame looks like header: Byte, packet length: byte, packet number: bytes, Total image size: bytes, payload: depends on packet length, CRCXMODEM: Bytes, Footer: byte Each packets consist of the following components:
Header: byte fixed value of xD used to detect the beginingof the packet.
Packet length: byte indicating the total number of bytes in the packet.
Packet Number: bytes representing packets order
total image size: bytes indicates the size of image in bytes.
Payload: The length can be calculated by subtracting the other components from packet length. It contains the image data.
CRCXMODEM: bytes A bit checksumfield using the CRC algorithm. Example if CRC is calculated over xxxxxxxxx then calculated CRC is xC
Footer : byte with a fixed value of xD used to detect the end of the point.
We need to calculate the image receiver function which receives these packets validates them and saves the image in memory asthe packets are received If any packets is dropped or invalid corrupted during the transmission, The image should erase and all the remaining packets of that particular image should be ignored The function will be called whenever a packet is received.The eraseimageData function should be called when the first image packet is received to erase the memory If any packet is droped or corrupted during transmission, you can call this function to erase the image.
Savingdata function should be called every time when you want to save parts of the image data. We have main.c where it is already implemented eraseImageData : it will be called when first image packet is received to erase memory, if any image packet is dropped or corrupted during transmission, you can call this function to erase the image, similarly saveImageData : it will be called everytime when you want to save parts of image data. we already have implemented both the function and cant make any changes in it
void eraseImageData
systemclear;
void saveImageDataunintt imageDataChunk uintt imageDataChunkLength
forint i;i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
