I think you should, as suggested above, explain what your code should do.
Because you are doing some, in my oppinion, strage things here.
For example this line of code:
(++radioIn >= 2) && (radioIn = 0) ;
doesnt make sense when written as a statement. You will add one to radioIn
and set radioIn to zero while doing a logic and (?).
And one other thing:
for (j=0;j<=9;j++)
{
line_a[j]=radioQueue[radioOut];
}
You are accessing 10 elements in line_a, but it only has 2 elements?
And the final question: why do you want to xor 2 message_t struct pointers.
If everything is correct then I guess casting the pointers to ints as
suggested by Michael would do the job.
/Henrik
2010/3/25 t'aim . <[email protected]>
> 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
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help