33 from .
import otaheader_pb2
34 from .
import commonphyheader_pb2
47 fixedAntennaGain = None):
57 self.
_phyHeader = commonphyheader_pb2.CommonPHYHeader()
58 self.
_phyHeader.registrationId = registrationId;
62 if fixedAntennaGain
is not None:
63 self.
_phyHeader.fixedAntennaGain = fixedAntennaGain
65 for nemId,powerdBm
in transmitters:
66 transmitter = self.
_phyHeader.transmitters.add()
67 transmitter.nemId = nemId
68 transmitter.powerdBm = powerdBm
70 for frequencyHz, offsetMicroseconds, durationMicroseconds
in segments:
71 segment = self.
_phyHeader.frequencySegments.add()
72 segment.frequencyHz = frequencyHz
73 segment.offsetMicroseconds = offsetMicroseconds
74 segment.durationMicroseconds = durationMicroseconds
76 def generate(self,txTimeMicroseconds,sequence,uuid):
81 self.
_phyHeader.txTimeMicroseconds = txTimeMicroseconds;
83 phyHeader = self.
_phyHeader.SerializeToString()
85 self.
_otaHeader.payloadInfo.dataLength = len(phyHeader) + 2;
87 otaHeader = self.
_otaHeader.SerializeToString()
89 return "".join((struct.pack(
"!H",len(otaHeader)),
99 struct.pack(
"!H",len(phyHeader)),
def generate(self, txTimeMicroseconds, sequence, uuid)
def __init__(self, source, destination, registrationId, subId, bandwidthHz, transmitters, segments, fixedAntennaGain=None)