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 crci6ixmodem 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 v1.0 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: 1 Byte, packet length: 1 byte, packet number: 2 bytes, Total image size: 2 bytes, payload: depends on packet length, CRC16/XMODEM: 2 Bytes, Footer: 1 byte]. Each packets consist of the following components:
Header:1 byte fixed value of 0x7D, used to detect the beginingof the packet.
Packet length: 1 byte indicating the total number of bytes in the packet.
Packet Number: 2 bytes representing packets order
total image size: 2 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.
CRC-16/XMODEM: 2 bytes . A 16 bit checksumfield using the CRC-16 algorithm. Example if CRC is calculated over 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39 then calculated CRC is 0x31C3.
Footer : 1 byte with a fixed value of 0xD7, 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(){
system("clear");
}
void saveImageData(unint8_t *imageDataChunk, uint16_t imageDataChunkLength){
for(int i=0;i
The aracalmagoData function should be caled when

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!