Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.Pot.nc

Interface: Pot

The Pot interface allows users to adjust the potentiometer on the input to the RFM radio which controls the RF transmit power or connectivity range. The interface controls the potentiometer, rather than the signal strength, so the settings may be a bit counterintuitive: the low potentiometer settings correspond to high transmission power, and high potentiometer settings correspond to low transmission power. Valid range depends on the platform being used:

Note: the transmission power is NOT linear with respect to the potentiometer setting; see mote schematics and RFM TR1000 manual for more information.

Note: any change to the potentiometer value will cause LEDs to blink. This behavior is normal, expected, and unavoidable; at the end of a potentiometer setting operation you may be left with an inconsistent LED state, though the functions provided by the LED component will continue to work correctly.

Components providing this interface:
tos.lib.Attributes.AttrPot
tos.lib.Commands.CommandPot
tos.system.PotC
tos.system.PotM

Components requiring this interface:
tos.lib.Attributes.AttrPotM
tos.lib.Commands.CommandPotM
tos.system.RealMain

Commands

Commands - Details

init

result_t init(uint8_t initialSetting)

Initialize the potentiometer and set it to a specified value.

Parameters:

initialSetting - The initial value for setting of the signal strength; see above for valid ranges and communication radii achieved with them.

Returns: Returns SUCCESS upon successful initialization.

set

result_t set(uint8_t setting)

Set the potentiometer value

Parameters:

setting - The new value of the potentiometer.

Returns: Returns SUCCESS if the setting was successful. The operation returns FAIL if the component has not been initialized or the desired setting is outside of the valid range.

increase

result_t increase(void)

Increment the potentiometer value by 1. This function proves to be quite useful in active potentiometer control scenarios.
Returns: Returns SUCCESS if the increment was successful. Returns FAIL if the component has not been initialized or if the potentiometer cannot be incremented further.

decrease

result_t decrease(void)

Decrement the potentiometer value by 1. This function proves to be quite useful in active potentiometer control scenarios.
Returns: Returns SUCCESS if the decrement was successful. Returns FAIL if the component has not been initialized or if the potentiometer cannot be decremented further.

get

uint8_t get(void)

Return the current setting of the potentiometer.
Returns: An unsigned 8-bit value denoting the current setting of the potentiometer.