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:
- Mica -- parameters range from 0 to 99; the actual
transmission range is heavily dependent on the antenna. With the built-in
antenna one can generally expect the range from 1 inch to 15 feet; with the
external antenna the range is from 1 foot to 100 feet.
- Rene -- parameters range from 20 to 77, though the exact
upper bound depends heavily on battery voltage. The exact range achieved
depends heavily on the battery used, but covers roughly the same range as
Mica (from 1 to 100 feet). Let us emphasize this again: The exact low
transmission power bound for the Rene is dependent on battery voltage; it
is VERY difficult to get a reliable short range communication over an
extended time period without active control of the potentiometer.
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
-
result_t
init
(uint8_t initialSetting)
-
result_t
set
(uint8_t setting)
-
result_t
increase
(void)
-
result_t
decrease
(void)
-
uint8_t
get
(void)
init
result_t init(uint8_t initialSetting)
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.
|