Ah, I didn't see it correctly. I was seeing it as:
(m_state = cca) ? S_SAMPLE_CCA : S_BEGIN_TRANSMIT;
instead of:
m_state = (cca ? S_SAMPLE_CCA : S_BEGIN_TRANSMIT);
On 07/09/2012 10:20 PM, Vinai Sundaram wrote:
> It's not an error.
>
> 'm_state' is assigned to either 'S_SAMPLE_CCA' or 'S_BEGIN_TRANSMIT'
> depending on the truth value of the boolean variable 'cca'.
>
> You can refer to
> http://en.wikipedia.org/wiki/%3F:#Conditional_assignment.
>
>
> Vinai
> --
> Vinai Sundaram @ www.ece.purdue.edu/~vsundar
>
>
>
> On 7/9/2012 10:36 PM, Ted Ward wrote:
>> I was just looking in the module CC2420TransmitP.nc and noticed the
>> starred line of code below. Is that supposed to be a single equals sign
>> or a double?
>>
>> error_t resend( bool cca ) {
>> ...
>> m_cca = cca;
>> ** m_state = cca ? S_SAMPLE_CCA : S_BEGIN_TRANSMIT;
>> totalCcaChecks = 0;
>>
>> If it is meant to be an assignment, then I assume the return value is
>> whatever is in cca?
>>
>> I don't know the version because at some point I deleted all the .svn
>> folders, but it was checked out around two months ago.
>>
>> _______________________________________________
>> 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