program the PIC to work as a Super Router, and reading the serial
port frame, forwards them to the standard, or rejected. The next message
format:
1. Destination MAC, 6 bytes fixed - variable value for each frame
2. TTL, 1 byte fixed - variable value for each frame
3.Length,1 byte fixed - variable value for each frame
4. Data, [1, 16] bytes - variable value, variable length for each frame
5. Error Code, 1 byte fixed - sum of all units in the field 1-4
And process the PIC as follows:
First Checking the MAC address.
- If it is rejected and the LCD display reads in two lines - "Receive
frame which is not for me ".
- If it is addressed, go to step 2
Second Checking the Error Code.
- If the frame is error, rejecting the LCD screen and write in two rows -
"Receive frame which is error".
- If the frame is not an error, go to step 3
Third Check the TTL.
- If the TTL is 0, the frame is discarded and the LCD display reads in two rows -
"Receive frame TTL = 0".
- If TTL> 0, go to step 4.
4th Creating a framework for sending.
- In the Dest. MAC value is entered as DestMac own arbitrary will
create it as a variable
- TTL field is reduced by 1 from the received frame
- Length field remains the same
- Data remains the same field
- Calculate new value for the Error Code field
After creating the frame, it sends the serial port, and write the first row of the LCD
- "Receive frame:", second row area Data
After sending, wait for a new framework. Assume that in the meantime not to arrive
new framework.
Any ideas how to solve this problem, It is very important for me, please help me....
port frame, forwards them to the standard, or rejected. The next message
format:
1. Destination MAC, 6 bytes fixed - variable value for each frame
2. TTL, 1 byte fixed - variable value for each frame
3.Length,1 byte fixed - variable value for each frame
4. Data, [1, 16] bytes - variable value, variable length for each frame
5. Error Code, 1 byte fixed - sum of all units in the field 1-4
And process the PIC as follows:
First Checking the MAC address.
- If it is rejected and the LCD display reads in two lines - "Receive
frame which is not for me ".
- If it is addressed, go to step 2
Second Checking the Error Code.
- If the frame is error, rejecting the LCD screen and write in two rows -
"Receive frame which is error".
- If the frame is not an error, go to step 3
Third Check the TTL.
- If the TTL is 0, the frame is discarded and the LCD display reads in two rows -
"Receive frame TTL = 0".
- If TTL> 0, go to step 4.
4th Creating a framework for sending.
- In the Dest. MAC value is entered as DestMac own arbitrary will
create it as a variable
- TTL field is reduced by 1 from the received frame
- Length field remains the same
- Data remains the same field
- Calculate new value for the Error Code field
After creating the frame, it sends the serial port, and write the first row of the LCD
- "Receive frame:", second row area Data
After sending, wait for a new framework. Assume that in the meantime not to arrive
new framework.
Any ideas how to solve this problem, It is very important for me, please help me....