本文整理汇总了Python中Encoder.unpack_response_with_string方法的典型用法代码示例。如果您正苦于以下问题:Python Encoder.unpack_response_with_string方法的具体用法?Python Encoder.unpack_response_with_string怎么用?Python Encoder.unpack_response_with_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder.unpack_response_with_string方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_next_filename
# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import unpack_response_with_string [as 别名]
def get_next_filename(self, reset):
"""
Get the next filename from the machine
@param boolean reset: If true, reset the file index to zero and return the first
available filename.
"""
if reset == True:
flag = 1
else:
flag = 0
payload = struct.pack(
'<Bb',
host_query_command_dict['GET_NEXT_FILENAME'],
flag,
)
response = self.writer.send_query_payload(payload)
[response_code, sd_response_code, filename] = Encoder.unpack_response_with_string('<BB', response)
if sd_response_code != sd_error_dict['SUCCESS']:
raise SDCardError(sd_response_code)
return filename
示例2: get_build_name
# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import unpack_response_with_string [as 别名]
def get_build_name(self):
"""
Get the build name of the file printing on the machine, if any.
@param str filename: The filename of the current print
"""
payload = struct.pack(
'<B',
host_query_command_dict['GET_BUILD_NAME']
)
response = self.writer.send_query_payload(payload)
[response_code, filename] = Encoder.unpack_response_with_string('<B', response)
return filename