Example #1
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgMaskSatellite(sbp)
Example #2
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgBootloaderHandshakeDepA(sbp)
Example #3
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgStmUniqueIdResp(sbp)
Example #4
0
def assert_package(test_filename, pkg_name):
  """
  Runs unit tests for message bindings by reading a YAML unit test
  specification, parsing a raw packet for each test, and then
  asserting that SBP messages and parsed payloads have their intended
  values.

  Parameters
  ----------
  test_filename : str
    Filepath to unit test specifications
  pkg_name : str
    Name of package to test

  """
  with open(test_filename, 'r') as f:
    pkg = yaml.load(f.read())
    _assert_sane_package(pkg_name, pkg)
    for test_case in pkg['tests']:
      sbp = SBP.unpack(base64.standard_b64decode(test_case['raw_packet']))
      _assert_sbp(sbp, test_case['sbp'])
      _assert_msg(dispatch(sbp), test_case['msg'])
      _assert_msg_roundtrip(dispatch(sbp), test_case['raw_packet'])
      _assert_msg_roundtrip_json(dispatch(sbp), test_case['raw_json'])
      _assert_materialization(test_case['msg'], sbp, test_case['raw_json'])
Example #5
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgM25FlashWriteStatus(sbp)
Example #6
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgFlashReadReq(sbp)
Example #7
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgStmFlashUnlockSector(sbp)
Example #8
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgResetFilters(sbp)
Example #9
0
    def from_json(s):
        """Given a JSON-encoded string s, build a message object.

    """
        d = json.loads(s)
        sbp = SBP.from_json_dict(d)
        return MsgBaselineHeading(sbp)
Example #10
0
  def from_json(s):
    """Given a JSON-encoded string s, build a message object.

    """
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return MsgSettingsReadByIndexResp(sbp)
Example #11
0
    def from_json(s):
        """Given a JSON-encoded string s, build a message object.

    """
        d = json.loads(s)
        sbp = SBP.from_json_dict(d)
        return MsgEphemerisDepA(sbp)
Example #12
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSbasRaw(sbp, **d)
Example #13
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgTweet(sbp, **d)
Example #14
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgAcqSvProfile(sbp, **d)
Example #15
0
 def pull_it(data):
   handler.framer.write(SBP.from_json(data).pack())
Example #16
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgCwStart(sbp, **d)
Example #17
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgInsStatus(sbp, **d)
Example #18
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgInsUpdates(sbp, **d)
Example #19
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSettingsReadByIndexDone(sbp, **d)
Example #20
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSettingsReadResp(sbp, **d)
Example #21
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgIarState(sbp, **d)
Example #22
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgUartStateDepa(sbp, **d)
Example #23
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgThreadState(sbp, **d)
Example #24
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgInitBase(sbp, **d)
Example #25
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgResetFilters(sbp, **d)
Example #26
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgFileioRemove(sbp, **d)
Example #27
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgSetTime(sbp, **d)
Example #28
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSettingsSave(sbp, **d)
Example #29
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgBasePosECEF(sbp, **d)
Example #30
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSettingsRegister(sbp, **d)
Example #31
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgFileioReadDirResp(sbp, **d)
Example #32
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgCwResults(sbp, **d)
Example #33
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgFileioRemove(sbp, **d)
Example #34
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgFileioWriteResp(sbp, **d)
Example #35
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgSettingsSave(sbp, **d)
Example #36
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgBootloaderJumpToApp(sbp, **d)
Example #37
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgAcqResultDepA(sbp, **d)
Example #38
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgNapDeviceDnaResp(sbp, **d)
Example #39
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgOdometry(sbp, **d)
Example #40
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgBootloaderHandshakeReq(sbp, **d)
Example #41
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgPrintDep(sbp, **d)
Example #42
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgFileioConfigResp(sbp, **d)
Example #43
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgFileioReadDirResp(sbp, **d)
Example #44
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgDeviceMonitor(sbp, **d)
Example #45
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgFileioWriteResp(sbp, **d)
Example #46
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgAlmanac(sbp, **d)
Example #47
0
def test_udp_logger():
    msg = SBP(1, 2, 3, 'abc', 4)
    handler = udp_handler(msg.pack())
    ip, port = udp_server(handler)
    with UdpLogger(ip, port) as udp:
        udp(msg)
Example #48
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgMaskSatellite(sbp, **d)
Example #49
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgMagRaw(sbp, **d)
Example #50
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgStartup(sbp, **d)
Example #51
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgTrackingStateDetailedDep(sbp, **d)
Example #52
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgTrackingIq(sbp, **d)
Example #53
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgSsrOrbitClockDepA(sbp, **d)
Example #54
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgCsacTelemetryLabels(sbp, **d)
Example #55
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgMeasurementState(sbp, **d)
Example #56
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgSsrPhaseBiases(sbp, **d)
Example #57
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgObs(sbp, **d)
Example #58
0
 def from_json_dict(d):
     sbp = SBP.from_json_dict(d)
     return MsgExtEvent(sbp, **d)
Example #59
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgEphemerisDepA(sbp, **d)
Example #60
0
 def from_json_dict(d):
   sbp = SBP.from_json_dict(d)
   return MsgHeartbeat(sbp, **d)