本文整理汇总了Python中sbp.msg.SBP类的典型用法代码示例。如果您正苦于以下问题:Python SBP类的具体用法?Python SBP怎么用?Python SBP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SBP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 MsgSettingsReadByIndexResp(sbp)
示例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 MsgEphemerisDepA(sbp)
示例3: 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 MsgMaskSatellite(sbp)
示例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 MsgBootloaderHandshakeDepA(sbp)
示例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 MsgStmUniqueIdResp(sbp)
示例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 MsgBaselineHeading(sbp)
示例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'])
示例8: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgFileioConfigResp(sbp, **d)
示例9: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgSettingsSave(sbp, **d)
示例10: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgTrackingStateDetailedDep(sbp, **d)
示例11: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgPrintDep(sbp, **d)
示例12: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgOdometry(sbp, **d)
示例13: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgAcqSvProfile(sbp, **d)
示例14: pull_it
def pull_it(data):
handler.framer.write(SBP.from_json(data).pack())
示例15: from_json_dict
def from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgBasePosECEF(sbp, **d)