Hi,

If I'm not mistaken, you can bit-inverse a value with the ~ operator 
(tilde). Something like "complement = ~value;". If this doesn't work, 
you could also use the xor operator (^) and one of the operants with all 
bits set to 1:

uint8_t value;
uint8_t complement;
//...
complement = value ^ 0xFF;

Cheers,
Urs

ram kishore wrote:
> Hi,
>      I need to find 1's complement of the incoming hex message.How to add
> #include<stdio.h> to my application?
>     Is there any alternative way of doing this?
> 
> Regards,
> Kishore

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to