[Tinyos-help] How to declare a pointer to user defined structure

Michael Schippling schip at santafe.edu
Thu Dec 11 16:36:48 PST 2008


Welcome to the Wonders of TOSworld.
MS


JD wrote:
> Greetings Folks,
> 
> Thanks a lot for the reply. I moved that declaration in to 
> _implementation_ block instead of function and it worked fine.
> 
> Thanks,
> JD
> ---------------------------
> Love All, Serve All
> ----------------------------
> 
> Dwight L. Moody  - "I have had more trouble with myself than with any 
> other man I've met."
> 
> On Thu, Dec 11, 2008 at 1:22 PM, Michael Schippling <schip at santafe.edu 
> <mailto:schip at santafe.edu>> wrote:
> 
>     That looks fine to me...
> 
>     Perhaps there is something else wrong in the file before
>     you get to the declaration? Try moving it around. And then
>     start eliminating stuff...my suspicious nature would start
>     with the nx_ things...
> 
>     MS
> 
>     JD wrote:
> 
>         Greetings Folks,
> 
>         I've a stupid (I believe) question.  I've following structure
>         defined in header file,
> 
>         typedef nx_struct __msg
>         {
>         CommonHeader cmnHdr;
> 
>         nx_union
>         {
>         InitMsg    __iMsg;
>         AckMsg   __aMsg;
>         } __msgType;
> 
>         } ActiveMessage;
> 
>         Now in the module implementation, I try to declare a pointer as
>         follows,
> 
>         ActiveMessage *pMsg = NULL;
> 
>         Doing so, nesc gives me following error,
>         "Syntax errorr before * "
>         "pMsg undeclared"
> 
>         Nothing clicks me if what exactly I'm doing wrong out here. I
>         sure its something really stupid, I guess.
> 
>         Please let me know if you find me doing thing wrong.
> 
>         Thanks,
>         JD
>         ---------------------------
>         Love All, Serve All
>         ----------------------------
> 
> 
>         ------------------------------------------------------------------------
> 
>         _______________________________________________
>         Tinyos-help mailing list
>         Tinyos-help at millennium.berkeley.edu
>         <mailto:Tinyos-help at millennium.berkeley.edu>
>         https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> 
>     -- 
>     Platform: WinXP/Cygwin
>     TinyOS version: 1.x, Boomerang
>     Programmer: MIB510
>     Device(s): Mica2, MicaZ, Tmote
>     Sensor board: homebrew
> 
> 

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list