]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Updated the ActiveMessageAddress interface after discovering issues with calling...
authorrincon <rincon>
Tue, 19 Jun 2007 17:30:08 +0000 (17:30 +0000)
committerrincon <rincon>
Tue, 19 Jun 2007 17:30:08 +0000 (17:30 +0000)
tos/interfaces/ActiveMessageAddress.nc
tos/system/ActiveMessageAddressC.nc

index 7d43d7f8e4bec982f4fbf533b05ea31566f7f3d4..c622a5aa79dfe27ddb3f76f4590715bb02435412 100644 (file)
  * @author David Moss
  */
 interface ActiveMessageAddress {
+
   /**
-   * @return the active message address of this node
+   * Set the active message address of this node
+   * @param group The node's group ID
+   * @param addr The node's active message address
    */
-  async command am_addr_t amAddress();
+  async command void setAddress(am_group_t group, am_addr_t addr);
   
   /**
-   * Set the active message address of this node
-   * @param addr The target active message address
+   * @return the active message address of this node
    */
-  async command void setAmAddress(am_addr_t addr);
+  async command am_addr_t amAddress();
   
   /**
    * @return the group address of this node
    */
   async command am_group_t amGroup();
   
-  /**
-   * Set the group address of this node
-   * @param group The group address
-   */
-  async command void setAmGroup(am_group_t group);
-  
-  
   /**
    * Notification that the address or group settings changed.
    */
index 40f0c0fe0c716b1a1015438aa18c1b02a7a7f46a..7f1abb911d465ef20192555fee84f980f6ac895e 100644 (file)
@@ -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;