Sie sind auf Seite 1von 4

CS23 Design Spec

Team Orange
May 21, 2008

1 Input
Input is mostly a set of simple motion commands sent from the GUI:

1. Move forward, backwards


2. Turn left, right (20, 45, 90)
3. Stop

In addition to motion commands, the user can issue a “Broadcast Key” com-
mand to tell Mary’s mote to sent out its currently stored key.

2 Output
Major outputs are:
1. Images to a window in the GUI
2. Mary’s motion
3. Broadcasted keys

4. Status messages printed to consoles on both client and server

3 Threads
3.1 Client Side
1. IMG RECV thread: Receives images

2. MAIN thread: Handles GUI events


3. BROADCAST thread: Receives keys

1
3.2 Mary Side
1. MAIN thread
2. IMG SEND thread
3. AFS Daemon

4 Data Structures
The only major data structure is the “cmd” data structure for holding com-
mands to be sent to Mary:

struct _cmd
{
int type;
int argument;
}
typedef struct _cmd cmd;

4.1 Commands
1. MOVEF - move forwards some large amount and call stop when destina-
tion reached
2. MOVEB - move backwards a small amount (a foot or so)
3. TURNR - turn right, include a number argument (20, 45, 90 degrees)
4. TURNL - turn left, include a number argument (20, 45, 90 degrees)
5. STOP - stop whatever Mary is doing
6. BROADCAST KEY - broadcast key to mote

5 Data Flow
Client-side Mary-side
_______________ ______________
| | | |
| Command | ------commands------>| Mary |
| Console | | Receiver |
|______________| |_____________|
_______________ ______________
| | | |
| Img Receiver | <-----image data-----| Img Sender |
| Thread | | Thread |
|______________| |______________|

2
_______________ ______________
| | | |
| Key | | ASF Daemon | <--key
| Receive | <----treasure-key------ |______________|
| Thread | | |
|______________| | | key
|_____V_________
| |
| Broadcast & | key-->
| Receive Key |
| Thread |
|_______________|

6 Functional decomposition
6.1 Client Side
1. Each button will have a function for sending a different command to Mary
2. sendcmd(): send a cmd struct to Mary

3. update img(): update image in the GUI window


4. recv img(): receive image from Mary
5. decompress image(): decompress received image

6. recv key(): receive a key from Mary after she’s gotten a new one
7. Connection setup and teardown

6.2 Mary Side


1. compress image(): compress image
2. recv cmd(): receive a command from the client-side
3. recv key(): receive key from mote through ASF daemon
4. broadcast key(): broadcast key to mote

5. send img(): send image to client side


6. Connection setup and teardown

3
7 Timeline
Connection setup Wednesday, May 21
GUI phase1 Thursday, May 22
Command structure setup Friday, May 23
GUI phase2 Saturday, May 24
Image Receiving threads Saturday, May 24
Key Threads Sunday, May 25
Image compression Monday, May 26
Final image compression Tuesday, May 27
Final GUI Tuesday, May 27
Experimentation and debugging Tuesday, Wednesday AM
Demo or Die Demo!

Das könnte Ihnen auch gefallen