Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dale McClure Michael McEwen Sam Hishmeh Nanxiang Li Dec 5th, 2006

Similar presentations


Presentation on theme: "Dale McClure Michael McEwen Sam Hishmeh Nanxiang Li Dec 5th, 2006"— Presentation transcript:

1 Dale McClure Michael McEwen Sam Hishmeh Nanxiang Li Dec 5th, 2006
Packet Rx/Tx Dale McClure Michael McEwen Sam Hishmeh Nanxiang Li Dec 5th, 2006

2 Team Tasks Rx: Receive packets from the VHF radio
1. Continuously check for and receive packets 2. Decode the received packet 3. Pass raw data to Command Executor Tx: Send packets to UHF radio 1. Receive packets as raw data 2. Add encoding information and form packets 3. Pass packets data to radio driver

3 Rx Design

4 Tx Design

5 Required Communication Library
Rx: Communicate with Packet Rx / Command Parse Queue Tx: Communicate with Packet Tx / Beacon Queue Communicate with Tx Queue

6 Communication Library
Rx: send_cmd_rx(cmd, data, num_bytes) Checks Message Queue if( !full ) add_message() Tx: try_bcn_tx(data, num_bytes ); try_raw_tx(cmd, data, num_bytes ); Keep checking if there is any data in the queue send_tx_raw(cmd, data, num_bytes); send_bcn_tx(data, num_bytes ); Get the data in the queue and send data

7 Required Packet Rx/Tx Library
Decodes a character string in MIME to standard ASCII Decodes single KS64 encoded characters to standard ASCII Encodes a character string in MIME format Encodes single characters in KS64 format Checks packet for correctness

8 Packet Rx Library KS64_lib.c Encodes single characters in KS64 format
ks64_encode(ubyte raw, ubyte *location) Encodes single characters in KS64 format ks64_decode(ubyte rx_char, ubyte *location) Decodes single KS64 encoded characters to standard ASCII MIME_lib.c mime_encode(ubyte *raw, ubyte loc[4], ubyte length) Encodes a character string in MIME format using ks64_encode mime_decode(ubyte string[3], ubyte *loc, ubyte length) Decodes a character string in MIME to standard ASCII using ks64_decode

9 Functions packet_rx_task.c -decode the data received by VHF radio
void init_q( circular_q* q_ptr, ubyte* buf_addr, const ubyte size ) -initialize the buffer/queue -sets the “get_index () and inc_index ()” ubyte check_packet( circular_q* rx_q ) -starts retrieving packets and ensures the packet is correct ubyte dec_index( circular_q* q_ptr ) -search for the end of the previous packet. -checks to ensure the payload length is a multiple of 4 (required for a MIME decode) ubyte depacketize( ubyte cmd, ubyte* raw_data, ubyte num_bytes, ubyte* enc_data ) -decode the data received by VHF radio

10 Functions packet_tx_task.c try_bcn_tx( rcvd_data, &num_bytes )
-check if there is data from beacon task try_raw_tx( &cmd, rcvd_data, num_bytes ) -check if there is data from command excutor ubyte form_bcn( ubyte* aprs_data, ubyte num_bytes, ubyte* packet ) -check the beacon packet for correctness -sends it on to the UHF radio. ubyte packetize( ubyte cmd, ubyte* raw_data, ubyte num_bytes, ubyte* enc_data ) -encode the raw data to be sent by UHF radio

11 Functions ubyte packetize( ubyte cmd, ubyte* raw_data, ubyte num_bytes, ubyte* enc_data ) - calls “ubyte KS64_encode( ubyte character, ubyte *destination)” which is in KS64_lib.c to encodes raw data - call “MIME_encode (ubyte string*, ubyte destination*, ubyte length* )”, which is in MIME_lib.c to encodes MIME payload void depacketizer( circular_q* rx_q, ubyte* cmd, ubyte* dec_packet, ubyte* num_data_bytes ) : - calls “ubyte KS64_decode( ubyte character, ubyte *destination)” which lives in KS64_lib.c to decodes KS64 framelength - call “MIME_decode (ubyte string*, ubyte destination*, ubyte length* )”, which is in MIME_lib.c to decodes MIME payload

12 Testing Strategy Use software UART and HyperTerminal to simulate incoming packets. Packet rx task sends its information directly to Packet tx task. The output backs out the software UART and HyperTerminal. Check the output’s correctness..

13 Testing Tested different types of packets:
Packets with missing header bytes Packets with missing APRS characters Packets with corrupted command, data or frame length Packets with missing data Packets with 0, a few data bytes, and 45 (the max) data bytes All these cases can be handled correctly, which means the error is found and the packet is dropped

14 Status Every needed function works: * KS64_lib.c * MIME_lib.c
* packet_rx_task.c * packet_tx_task.c

15 Future Add some form of recovery for corrupted packets in packet rx
Cleaning up the code Comments and documentation


Download ppt "Dale McClure Michael McEwen Sam Hishmeh Nanxiang Li Dec 5th, 2006"

Similar presentations


Ads by Google