Specifications

If you need an energy reading for a SNAP channel on a platform with 900 MHz frequency-hopping
firmware, you could use a function like this to retrieve an average value of the appropriate frequencies:
def GetEnergy():
if getInfo(2) == 6 and getInfo(1) == 5:
# RF300, or compatible hardware, running FHSS
incomingChannel = getChannel()
energyLevel = 0
channelLoop = 0
while channelLoop < 25:
setChannel((incomingChannel * 4 + channelLoop) % 64 + 1)
energyLevel += getEnergy()
channelLoop += 1
setChannel(incomingChannel)
return energyLevel / 25
elif getInfo(2) == 6 and getInfo(1) == 3:
# RF301, or compatible hardware, operating at 868 MHz
incomingChannel = getChannel
energyLevel = 0
channelLoop = 0
while channelLoop < 3:
setChannel(channelLoop)
energyLevel += getEnergy()
channelLoop += 1
setChannel(incomingChannel)
return energyLevel / 3
else:
return getEnergy()
Alternately, you could use the scanEnergy() function and work with the appropriate three or 25 values
returned by that function.
The getEnergy() function takes no parameters.
getI2cResult() – Get status code from most recent I
2
C operation
This function takes no parameters. It returns the result of the most recently attempted I
2
C operation.
(It also resets the error code for next time). The possible return values and their meanings are:
0 = I2C_OFF means I
2
C was never initialized (you need to call i2cInit()!)
1 = I2C_SUCCESS means the most recent I
2
C read/write/etc. succeeded
2 = I2C_BUS_BUSY means the I
2
C bus was in use by some other device
3 = I2C_BUS_LOST means some other device stole the I2C bus
4 = I2C_BUS_STUCK means there is some sort of hardware or configuration problem
5 = I2C_NO_ACK means the slave device did not respond properly
For more information on interfacing SNAP nodes to I
2
C devices, refer to section 6.
Page 50 of 202 SNAP Reference Manual Document Number 600-0007K