Spam detection software, running on the system "mail.Millennium.Berkeley.EDU", 
has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Dear All, i've had some trouble debugging my TinyOS 2.1.1
  application today. I've had some code that essentially was the same as: 
uint8_t
   a = 5; [...]

Content analysis details:   (4.3 points, 3.3 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 3.2 FH_DATE_PAST_20XX      The date is grossly in the future.
 0.0 BAYES_50               BODY: Bayesian spam probability is 40 to 60%
                            [score: 0.4483]
 1.1 DNS_FROM_OPENWHOIS     RBL: Envelope sender listed in bl.open-whois.org.


--- Begin Message ---
Dear All,

i've had some trouble debugging my TinyOS 2.1.1 application today. I've had 
some code that essentially was the same as:

uint8_t a = 5;

what struck me, was that the following returned FALSE:

(~a == (255-a))


{ Note:
b00000101 = 5
b11111010 = ~5 = 250 = (255-5)
}

Did i miss something or is this a (un-)known problem?

I ended up using (255-b) instead of ~b.

regards,
 Bruno Juchli

PS: this is an excerpt from the actual code:

uint8_t rxLength;

async event void UartStream.receivedByte( uint8_t byte ) {
 (...)
                        case STATE_WAIT_FOR_LEN:
                                rxLength = byte;
                                mReceiveState = STATE_WAIT_FOR_NLEN;
                                break;
                        case STATE_WAIT_FOR_NLEN:
                                //if (byte == ~rxLength) { //not working
                                if ((255-byte) == rxLength) { //working just 
fine
                                        mReceiveState = STATE_WAIT_FOR_MESSAGE;
                                        rxBytesToRead   = rxLength + 4; //+ 
address + contentType + CRC16
                                        messageBuffer[0] = rxLength;
                                        rxBufferBegin   = 1;
                                } else {
                                        mReceiveState = STATE_WAIT_FOR_ALERT;
                                }
                                break;
 (...)
}

________________________________________
Bruno Juchli

University of Applied Sciences Lucerne, Switzerland

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

Reply via email to