]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/interfaces/AMPacket.nc
Added AM group.
[tinyos-2.x.git] / tos / interfaces / AMPacket.nc
index 05140a768eeecc3b5b1d18605e6058c3c9b8a432..f403c21d18b84a5b28fa7ace4d5243b351a4ecc7 100644 (file)
@@ -150,4 +150,36 @@ interface AMPacket {
   
   command void setType(message_t* amsg, am_id_t t);
 
+  /**
+   * Get the AM group of the AM packet. The AM group is a logical
+   * identifier that distinguishes sets of nodes which may share
+   * a physical communication medium but wish to not communicate.
+   * The AM group logically separates the sets of nodes. When
+   * a node sends a packet, it fills in its AM group, and typically
+   * nodes only receive packets whose AM group field matches their
+   * own.
+   *
+   * @param amsg the packet
+   * @return the AM group of this packet
+   */
+  
+  command am_group_t group(message_t* amsg);
+
+  /**
+   * Set the AM group field of a packet. Note that most data link
+   * stacks will set this field automatically on a send request, which
+   * may overwrite changes made with this command.
+   *
+   * @param amsg the packet
+   * @param group the packet's new AM group value
+   */
+  command void setGroup(message_t* amsg, am_group_t grp);
+
+  /**
+   * Provides the current AM group of this communication interface.
+   *
+   * @return The AM group.
+   */
+  
+  command am_group_t localGroup();
 }