Revision history [back]
You want bit 1 set and bits 2 & 3 clear, so mask (bitwise and) with 0x01 to test the first bit and then mask with 0x06 to test the 2nd and 3rd bits, but negating the result:
(rtp.ext.rfc5285.data[0] & 0x01) and !(rtp.ext.rfc5285.data[0] & 0x06)
You want bit 1 set and bits 2 & 3 clear, so mask (bitwise and) with 0x01 0x07 to isolate those three bits and then test if the result is equal to 1 indicating only the first bit and then mask with 0x06 to test the 2nd and 3rd bits, but negating the result:is set:
(rtp.ext.rfc5285.data[0] & 0x01) and !(rtp.ext.rfc5285.data[0] & 0x06)
&0x06)
You want bit 1 set and bits 2 & 3 clear, so mask (bitwise and) with 0x07 to isolate those three bits and then test if the result is equal to 1 indicating only the first bit is set:
(rtp.ext.rfc5285.data[0] & 0x01) and !(rtp.ext.rfc5285.data[0] &0x06)
0x07) == 1