]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/ActiveMessageAddressC.nc
Update tos-bsl for win32 python
[tinyos-2.x.git] / tos / system / ActiveMessageAddressC.nc
index 40f0c0fe0c716b1a1015438aa18c1b02a7a7f46a..ae0aafbf510e05a750914104ef61e11532f508b4 100644 (file)
@@ -1,5 +1,5 @@
 // $Id$
-/*                                                                     tab:4
+/*
  * "Copyright (c) 2004-2005 The Regents of the University  of California.  
  * All rights reserved.
  *
@@ -38,7 +38,7 @@
  * @author David Moss
  */
 
-module ActiveMessageAddressC  {
+module ActiveMessageAddressC @safe() {
   provides {
     interface ActiveMessageAddress;
     async command am_addr_t amAddress();
@@ -64,10 +64,15 @@ implementation {
   
   /**
    * Set the active message address of this node
-   * @param a The target active message address
+   * @param group The node's group ID
+   * @param addr The node's active message address
    */
-  async command void ActiveMessageAddress.setAmAddress(am_addr_t a) {
-    call setAmAddress(a);
+  async command void ActiveMessageAddress.setAddress(am_group_t myGroup, am_addr_t myAddr) {
+    atomic {
+      addr = myAddr;
+      group = myGroup;
+    }
+    signal ActiveMessageAddress.changed();
   }
   
     
@@ -80,14 +85,6 @@ implementation {
     return myGroup;
   }
   
-  /**
-   * Set the group address of this node
-   * @param group The group address
-   */
-  async command void ActiveMessageAddress.setAmGroup(am_group_t myGroup) {
-    atomic group = myGroup;
-    signal ActiveMessageAddress.changed();
-  }
 
   /***************** Deprecated Commands ****************/
   /**
@@ -105,7 +102,7 @@ implementation {
    * Set the node's default AM address.
    *
    * @param a - the address.
-   * @deprecated Use ActiveMessageAddress.setAmAddress() instead
+   * @deprecated Use ActiveMessageAddress.setAddress() instead
    */
   async command void setAmAddress(am_addr_t a) {
     atomic addr = a;