当前位置: 首页>>代码示例>>Python>>正文


Python sbp.SBP类代码示例

本文整理汇总了Python中sbp.SBP的典型用法代码示例。如果您正苦于以下问题:Python SBP类的具体用法?Python SBP怎么用?Python SBP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SBP类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: from_json

  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 MsgEphemerisOld(sbp)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:tracking.py

示例2: from_json

  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 MsgBaselineNED(sbp)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:navigation.py

示例3: from_json

  def from_json(data):
    """Given a JSON-encoded message, build an object.

    """
    d = json.loads(data)
    sbp = SBP.from_json_dict(d)
    return MsgIarState(sbp)
开发者ID:yxftju,项目名称:libsbp,代码行数:7,代码来源:piksi.py

示例4: from_json

  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 MsgFileioReadDir(sbp)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:file_io.py

示例5: from_json

  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)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:flash.py

示例6: from_json

  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 MsgSettingsReadByIndex(sbp)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:settings.py

示例7: assert_package

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'])
开发者ID:cbeighley,项目名称:libsbp,代码行数:25,代码来源:utils.py

示例8: from_json

  def from_json(data):
    """Given a JSON-encoded message, build an object.

    """
    d = json.loads(data)
    sbp = SBP.from_json_dict(d)
    return MsgBootloaderHandshake(sbp)
开发者ID:yxftju,项目名称:libsbp,代码行数:7,代码来源:bootload.py

示例9: from_json

  def from_json(data):
    """Given a JSON-encoded message, build an object.

    """
    d = json.loads(data)
    sbp = SBP.from_json_dict(d)
    return MsgM25FlashWriteStatus(sbp)
开发者ID:yxftju,项目名称:libsbp,代码行数:7,代码来源:flash.py

示例10: from_json

  def from_json(data):
    """Given a JSON-encoded message, build an object.

    """
    d = json.loads(data)
    sbp = SBP.from_json_dict(d)
    return MsgSettingsReadByIndex(sbp)
开发者ID:yxftju,项目名称:libsbp,代码行数:7,代码来源:settings.py

示例11: from_json

  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 MsgBootloaderHandshake(sbp)
开发者ID:cbeighley,项目名称:libsbp,代码行数:7,代码来源:bootload.py


注:本文中的sbp.SBP类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。