[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/apps/AgillaAgents/GroupComm/mobile-chat Member.ma, 1.1, 1.2

Chien-Liang Fok chien-liang at users.sourceforge.net
Wed Nov 15 05:47:12 PST 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/AgillaAgents/GroupComm/mobile-chat
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27579/mobile-chat

Modified Files:
	Member.ma 
Log Message:
Test memeber react to leader and PDA.  no move yet.


Index: Member.ma
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/AgillaAgents/GroupComm/mobile-chat/Member.ma,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Member.ma	15 Nov 2006 01:11:32 -0000	1.1
--- Member.ma	15 Nov 2006 13:47:10 -0000	1.2
***************
*** 1,32 ****
! // get use rname from cmd line
! // store user name in heap[0]
! //		pushn fei
! //		setvar 0
! 
! // Send a string to the base station to create GUI
! // 'msc', agentID, screen name
! 		getvar	0
! 		aid
! 		pushn	msc
! 		pushc	3
! 		pushloc	force_uart_x force_uart_y
! 		rout
  
! pushc 8
! sleep
  
! // discover the leader location
  		loc
! 		pushn abc	// group name = "abc"
  		pushn req
! 		pushc 3
  		pushloc uart_x uart_y
! 		rout		// send request message: <"req", "abc", loc>
  
  		pushc 8		// sleep for 1 second to allow BS to generate reponse
  		sleep
  		
! 		pusht location
! 		pushn grl
  		pushc 2		
  
--- 1,30 ----
! // screen name
! // groupname:  hard coded as "abc"
! // heap[0] = PDA+Proxy location
! // heap[1] = leader location
! 	
! 	pushc	8
! 	sleep
  
! BEGIN	randnbr			// look for a node in the network
! 	rjumpc FND_NODE
! 	pushc	16
! 	sleep
! 	rjump BEGIN
! FND_NODE	smove		// migrate to the node	
  
! // Query Base station, Discover the leader location
  		loc
! 		pushn abc	// group name = "abc", HARD CODED
  		pushn req
! 		pushc 3		
  		pushloc uart_x uart_y
! 		rout		// Send To BaseStation:  <"req", "abc", member loc>
  
  		pushc 8		// sleep for 1 second to allow BS to generate reponse
  		sleep
  		
! 		pusht location  // React to BS:  <"grl", leader loc>
! 		pushn grl		// future:  <"grl", member ID, leader loc>
  		pushc 2		
  
***************
*** 36,63 ****
  		setvar 1	// heap[1] = leader location
  		
! // register with the leader
  		loc
  		aid
  		pushn jng
! 		pushc 3
  		getvar 1
! 		rout
  
! // register reaction for leader broadcast messages
  		pusht string
  		pusht string
  		aid
! 		pushn lbm
  		pushc 4
! 		pushcl RXN_FIRED
  		regrxn
  
! // register reaction for messages to send		
  		pusht string
! 		getvar 0		// name of agent
! 		aid
! 		pushn snd
! 		pushc 4
! 		pushcl SND_MSG
  		regrxn
  		
--- 34,61 ----
  		setvar 1	// heap[1] = leader location
  		
! // Register with the leader
  		loc
  		aid
  		pushn jng
! 		pushc 3		// To Leader:  <"jng", member ID, member loc>
  		getvar 1
! 		rout		// send to leader location
  
! // register reaction: for leader broadcast messages
  		pusht string
  		pusht string
  		aid
! 		pushn lbm	// <"lbm", memeber ID, screen name, chat msg>
  		pushc 4
! 		pushcl LEADER_MSG
  		regrxn
  
! // register reaction: for messages from PDA+Proxy to send	
! // FromPDA+Proxy:  <'ocm', screen name, chat msg>
  		pusht string
! 		pusht string
! 		pushn ocm
! 		pushc 3
! 		pushcl PDA_MSG
  		regrxn
  		
***************
*** 71,82 ****
  WAIT		wait
  		
! RXN_FIRED	remove			// remove the tuple
! 		pushloc force_uart_x force_uart_y
! 		rout			// send tuple to base station
  		endrxn
  
! SND_MSG		remove
! 		pop
  		pop
  		pushn mbm
  		pushc 4			// <"mbm", AgentID, String:name, String:msg>
--- 69,96 ----
  WAIT		wait
  		
! // React to:  <"lbm", memeber ID, screen name, chat msg>
! // Send to Proxy:  
! LEADER_MSG	remove			// remove the tuple
! 		pop
! 		pop
! 		pop			//   Stack:  (screen name, chat msg)
! 		getvar	0
! 		cisnbr			// check if the PDA+Proxy is still a valid neighbor
! 		rjumpc	LM_CONT
! 		pop			//   fail, disgard chat msg
! 		pop
! 		endrxn
! 	LM_CONT	pushn	icm		// <"icm", screen name, chat msg>
! 		pushc	3
! 		getvar	0
! 		rout			//   success, send tuple to PDA+Proxy
  		endrxn
  
! // React to:  <'ocm', screen name, chat msg> from PDA+Proxy
! // Send to leader:  <"mbm", AgentID, String:name, String:msg>
! PDA_MSG		remove
  		pop
+ 		pop			//  Stack:  (screen name, chat msg)
+ 		aid
  		pushn mbm
  		pushc 4			// <"mbm", AgentID, String:name, String:msg>



More information about the Tinyos-contrib-commits mailing list