def reset_length(self, buf, length):
"""
Writes an IPA header with the length param. Used externally when
protocols over provision memory initially and then reset the length.
Args:
buf (memoryview): the IPA message
length (int): length of the protocl message encapsulated by IPA
Returns:
None
"""
if self._osmo_extn is not None: # Ctrl extn is 0x00
struct.pack_into('!HBB', buf, 0, length + 1,
self._stream_id, self._osmo_extn)
else:
struct.pack_into('!HB', buf, 0, length, self._stream_id)
评论列表
文章目录