def get_pod(): path = "data/bbe.json" log_path = "data/bbe.log" pod = None try: pod = Pod.Load(path) except: pass if pod is None: pod = Pod() pod.path = path pod.log_file_path = log_path pod.id_lot = 44147 pod.id_t = 1100256 pod.radio_address = 0x1f0e89f0 pod.Save() return pod
else: return packet path = "data/bbe.json" log_path = "data/bbe.log" pod = None try: pod = Pod.Load(path) except: pass if pod is None: pod = Pod() pod.path = path pod.log_file_path = log_path pod.id_lot = 44147 pod.id_t = 1100256 pod.radio_address = 0x1f0e89f0 pod.Save() mock_radio = MockPacketRadio(send_callback=skip_ack, allow_connect=True, allow_listen=True) radio = PdmRadio(pod.radio_address, packet_radio=mock_radio, msg_sequence=pod.radio_message_sequence, pkt_sequence=pod.radio_packet_sequence) request = request_status() response = radio.send_message_get_message(request)
from podcomm.crc import crc16, crc8 from tests.mock_radio import MockPacketRadio from podcomm.pod import Pod import time pod = None try: pod = pod.Load("/home/ba/newpod2.json", "/home/ba/newpod2.json.log") except: pass if pod is None: pod = Pod() pod.path = "/home/ba/newpod2.json" pod.log_file_path = "/home/ba/newpod2.json.log" req_address = 0x1f000015 radio = PdmRadio(0xffffffff) msg = request_assign_address(req_address) rsp = radio.send_message_get_message(msg, ack_address_override=req_address, tx_power=TxPower.Lowest) response_parse(rsp, pod) pod.Save("/home/ba/newpod1.json") radio.message_sequence = 1 msg = request_setup_pod(pod.id_lot, pod.id_t, pod.radio_address, 2019, 4, 3, 21, 35) rsp = radio.send_message_get_message(msg,