diff --git a/src/energenie/OnAir.py b/src/energenie/OnAir.py index 86ecaa7..8abd9ea 100644 --- a/src/energenie/OnAir.py +++ b/src/energenie/OnAir.py @@ -13,42 +13,50 @@ # NOTE: This also might include intelligent power level selection based # on RSSI reports from different devices. +import radio + class OpenThingsAirInterface(): - pass + def __init__(self): + pass #TODO + # radio params defaults FSK, inner_repeats, outer_delay, outer_repeats, power_level, frequency + # tx defaults + # rx defaults - # init - # radio params defaults FSK, inner_repeats, outer_delay, outer_repeats, power_level, frequency + def send(self, payload, radio_params=None): + pass #TODO + # payload is a pydict suitable for OpenThings + # radio_params is an overlay on top of radio tx defaults + # tx, pydict payload and radio params in + # OpenThings encode and encrypt, configure radio for FSK transmit, pass repeats - # send(payload, radio_params) - # payload is a pydict suitable for OpenThings - # radio_params is an overlay on top of radio tx defaults - # tx, pydict payload and radio params in - # OpenThings encode and encrypt, configure radio for FSK transmit, pass repeats - - # receive(radio_params) #-> (radio_measurements) or (radio_measurements, payload) - # radio_params is an overlay on top of radio rx defaults (e.g. poll rate, timeout, min payload, max payload) - # radio_measurements might include rssi reading, short payload report, etc - # rx, configure radio for FSK receive OpenThings decode and decrypt, - # pydict payload and metadata (RSSI etc) out + def receive(self, radio_params): # -> (radio_measurements, payload or None) + pass # TODO + # radio_params is an overlay on top of radio rx defaults (e.g. poll rate, timeout, min payload, max payload) + # radio_measurements might include rssi reading, short payload report, etc + # rx, configure radio for FSK receive OpenThings decode and decrypt, + # pydict payload and metadata (RSSI etc) out class TwoBitAirInterface(): - pass + def __init__(self): + pass # TODO + # radio params defaults OOK, inner_repeats, outer_delay, outer_repeats, power_level, frequency + # tx defaults + # rx defaults - # init - # radio params defaults OOK, inner_repeats, outer_delay, outer_repeats, power_level, frequency + def send(self, payload, radio_params=None): + pass #TODO + # payload is just a list of bytes, or a byte buffer + # radio_params is an overlay on top of radio tx defaults + # tx, pydict payload and radio params in + # TwoBit encode, configure radio for OOK transmit, pass repeats - # send(payload, radio_params) - # payload is just a list of bytes, or a byte buffer - # radio_params is an overlay on top of radio tx defaults - # tx, pydict payload and radio params in - # TwoBit encode, configure radio for OOK transmit, pass repeats - - # receive(radio_params) #-> (radio_measurements) or (radio_measurements, payload) - # radio_params is an overlay on top of radio rx defaults (e.g. poll rate, timeout, min payload, max payload) - # radio_measurements might include rssi reading, short payload report, etc - # rx, configure radio for OOK receive, TwoBit decode - # pydict payload and metadata (RSSI etc) out + def receive(self, radio_params): # -> (radio_measurements, payload or None) + pass # TODO + # radio_params is an overlay on top of radio rx defaults (e.g. poll rate, timeout, min payload, max payload) + # radio_measurements might include rssi reading, short payload report, etc + # rx, configure radio for OOK receive, TwoBit decode + # pydict payload and metadata (RSSI etc) out # END