You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following describes a semantic bug found in the latest version of nesc.
When a module provides a parameterized interface, with more than one parameter on the interface, the parameters in the function implementing the interface come in the reversed order.
For example, we are wiring to a module TestC implementing interface Test.
Parameters arrive in the reverse order (should be 10, 20, 30).
This bug can have a compile-time error, when the parameter values are heterogeneous. If we expect parameters, [uint8, uint8, uint16] and assign values [10, 20, 300] then we get
'constant out of range for argument type'
because 300 is assigned to the first parameter of type uint8_t.
The following describes a semantic bug found in the latest version of nesc.
When a module provides a parameterized interface, with more than one parameter on the interface, the parameters in the function implementing the interface come in the reversed order.
For example, we are wiring to a module TestC implementing interface Test.
then TestC provides interface as follows:
and implements interface function bug():
At run time, we observe the following serial print output:
Receive Parameters 30 20 10
Receive Parameters 30 20 10
Receive Parameters 30 20 10
...
Parameters arrive in the reverse order (should be 10, 20, 30).
This bug can have a compile-time error, when the parameter values are heterogeneous. If we expect parameters, [uint8, uint8, uint16] and assign values [10, 20, 300] then we get
because 300 is assigned to the first parameter of type uint8_t.
A sample test code has been uploaded to: http://www.cs.columbia.edu/~msz/wsn/nesc_interface_params/
The test code is configured for the TOSv3, tested on the latest tinyos-main branch, on telosB.
The text was updated successfully, but these errors were encountered: