Please send messages to the help list as I am not
qualified to have a final opinion...

I tried something like this and got the XOR to compile:

        struct *x;
        struct *y;
        int z = ( (int)x ^ (int)y );

MS

t'aim . wrote:
> Hi,
> Thanks for replying ,Yea i am trying but it is still not working..I 
> change every message_t to int but still facing the same problem any idea 
> dude
> 
> taimoor
> 
>  > Date: Thu, 25 Mar 2010 11:51:39 -0600
>  > From: [email protected]
>  > To: [email protected]
>  > CC: [email protected]
>  > Subject: Re: [Tinyos-help] invalid operands to binary ^
>  >
>  > hmmm, interesting....
>  >
>  > I don't know what a ONE_NOK is or what that syntax means
>  > but I think your line* variables are arrays of pointers.
>  > I just tried XORing two pointers and got your complaint,
>  > so apparently GCC thinks they are not the same as integers.
>  > Try explicitly casting them to ints, that seems to work.
>  >
>  > MS
>  >
>  > t'aim . wrote:
>  > > Hi,
>  > > I am facing error in Xor program ..It is showing invalid operands to
>  > > binary ^ error ..here is the program plzz help me guys
>  > >
>  > >
>  > >
>  > > implementation
>  > > {
>  > > message_t radioQueueBufs[2],line_aBufs[2],line_bBufs[2];
>  > > //RADIO_QUEUE_LENGTH=12
>  > > message_t * ONE_NOK radioQueue[2];
>  > > message_t * ONE_NOK line_a[2];
>  > > message_t * ONE_NOK line_b[2];
>  > > uint8_t radioIn, radioOut,c,j,z;
>  > > bool radioBusy, radioFull;
>  > >
>  > > ...............................................
>  > > .....................................................
>  > >
>  > > event void Boot.booted() {
>  > > uint8_t i;
>  > >
>  > > for (i = 0; i < 1; i++)
>  > > {
>  > > radioQueue[i] = &radioQueueBufs[i];
>  > > line_a[i]=&line_aBufs[i];
>  > > line_b[i]=&line_bBufs[i];
>  > > }
>  > > radioBusy = FALSE;
>  > > radioFull = TRUE;
>  > >
>  > > .............................
>  > > ................................
>  > >
>  > > task void radioSendTask();
>  > > event message_t *RadioReceive.receive[am_id_t id](message_t *msg,void
>  > > *payload,uint8_t len) {
>  > >
>  > > message_t *ret=msg;
>  > >
>  > > if (!radioFull)
>  > > {
>  > > ret=radioQueue[radioIn];
>  > > radioQueue[radioIn] = msg;
>  > > (++radioIn >= 2) && (radioIn = 0) ;
>  > >
>  > > }
>  > > post radioSendTask();
>  > > return ret;
>  > > }
>  > >
>  > >
>  > > task void radioSendTask() {
>  > > uint8_t len;
>  > >
>  > >
>  > > message_t* msg;
>  > >
>  > > if (radioIn == radioOut && !radioFull)
>  > > {
>  > >
>  > >
>  > >
>  > > for (j=0;j<=9;j++)
>  > > {
>  > > line_a[j]=radioQueue[radioOut];
>  > > }
>  > > //line_a=[9];
>  > >
>  > >
>  > > for (j=0;j<=18;j++)
>  > > {
>  > > line_b[j]=radioQueue[radioOut];
>  > > }
>  > > //line_b=[18];
>  > >
>  > > c=(line_a[9]) ^ (line_b[18]); // error line .I am XORing
>  > > data in buffer
>  > >
>  > >
>  > > return;
>  > > }
>  > > msg = radioQueue[c];
>  > >
>  > >
>  > >
>  > > if (call RadioSend.send[2](AM_BROADCAST_ADDR, msg, len) == SUCCESS)
>  > > call Leds.led2Toggle();
>  > > ........
>  > > ........
>  > > .......
>  > >
>  > > 
> ------------------------------------------------------------------------
>  > > The New Busy is not the old busy. Search, chat and e-mail from your
>  > > inbox. Get started.
>  > > 
> <http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3>
>  > >
>  > >
>  > > 
> ------------------------------------------------------------------------
>  > >
>  > > _______________________________________________
>  > > Tinyos-help mailing list
>  > > [email protected]
>  > > 
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> ------------------------------------------------------------------------
> The New Busy is not the old busy. Search, chat and e-mail from your 
> inbox. Get started. 
> <http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to