There are several reasons for the frame. First, it places all of the component's local state in it's own name space. This allows all of the components to have a variable named "state" for example. Additionally, it prevents components from accessing other component's private state. This is an attempt to force components to interact through the narrow interface of commands and events. Finally, it allows us to modify the memory and storage models without modifying the components. We have not released any code that does this yet, however we are leveraging this capability in our multimode simulator. Jason -----Original Message----- From: Jeremy Elson [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 21, 2001 9:14 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [tinyos@mm] What's the purpose of TOS_FRAME_BEGIN/END and VAR? Hi folks, I was wondering if there's a hidden purpose I'm not seeing to the TOS_FRAME_BEGIN/END and VAR macros. It looks like they are just helping to define a structure, declare one instance of that structure, and then (using VAR) reference fields of the instance. Why is all this done? Do global variables have to be contained in a structure for some reason? Can I just declare global variables and use them, like I would in a normal C program? Thanks, -Jer
