1digraph p2p {
2	ranksep=.75;
3	size = "8.5,7.5";
4
5	start -> IDLE;
6	start [label="Init",shape=none];
7
8	/* Discovery: Scan followed by Find(SEARCH,LISTEN) */
9	subgraph cluster_0 {
10		label="Discovery";
11		color=lightgrey;
12		node [color=blue];
13		/* SCAN and LISTEN currently not used in the implementation */
14		SCAN [style=dotted];
15		LISTEN [style=dotted];
16
17		SCAN -> LISTEN;
18		LISTEN -> SEARCH -> LISTEN [style=dotted];
19		SEARCH -> SD_DURING_FIND [label="Peer SD capab\nand no info", weight=100];
20		SD_DURING_FIND -> SEARCH [label="RX SD Resp\nor timeout", weight=100];
21		SEARCH -> PROV_DISC_DURING_FIND [label="Prov Disc cmd\nand no Resp", weight=100];
22		PROV_DISC_DURING_FIND -> SEARCH [label="RX Prov Disc Resp\nor timeout", weight=100];
23	}
24
25	/* Group Formation */
26	subgraph cluster_1 {
27		label="Group Formation";
28		color=lightgrey;
29		node [color=green];
30
31		CONNECT -> CONNECT_LISTEN [style=dotted,weight=100];
32		CONNECT_LISTEN -> CONNECT [style=dotted,weight=100];
33		CONNECT -> WAIT_PEER_IDLE [label="RX GO Neg Resp\n(info unavail)"];
34		WAIT_PEER_IDLE -> WAIT_PEER_CONNECT [style=dotted,weight=100];
35		WAIT_PEER_CONNECT -> WAIT_PEER_IDLE [style=dotted,weight=100];
36
37		CONNECT -> GO_NEG [label="RX GO Neg Resp\n(success)", weight=10];
38		CONNECT_LISTEN -> GO_NEG [label="RX GO Neg Req or\nTX GO Neg Resp"];
39		WAIT_PEER_CONNECT -> GO_NEG [label="RX GO Neg Req"];
40		GO_NEG -> PROVISIONING [label="TX/RX GO Neg Conf"];
41	}
42
43	PROVISIONING -> IDLE [label="WPS\nsuccess"];
44
45	/* External triggers */
46	IDLE -> SCAN [label="Find cmd",weight=20];
47	IDLE -> CONNECT [label="Connect cmd",weight=20];
48	IDLE -> LISTEN_ONLY [label="Listen cmd"];
49
50	/* Timeouts */
51/*
52	edge [color=red];
53	WAIT_PEER_IDLE -> IDLE [label="timeout", weight=0];
54	WAIT_PEER_CONNECT -> IDLE [label="timeout", weight=0];
55	CONNECT -> IDLE [label="timeout", weight=0];
56	CONNECT_LISTEN -> IDLE [label="timeout", weight=0];
57	GO_NEG -> IDLE [label="timeout", weight=0];
58	PROVISIONING -> IDLE [label="timeout", weight=0];
59	LISTEN_ONLY -> IDLE [label="timeout", weight=0];
60	SEARCH -> IDLE [label="timeout", weight=0];
61*/
62}
63