MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / field_string

Function field_string

examples/Protobuf Example/sensor_simulator.py:79–81  ·  view source on GitHub ↗
(field: int, value: str)

Source from the content-addressed store, hash-verified

77
78
79def field_string(field: int, value: str) -> bytes:
80 payload = value.encode("utf-8")
81 return tag(field, 2) + varint(len(payload)) + payload
82
83
84def field_submsg(field: int, payload: bytes) -> bytes:

Callers 1

make_sensor_frameFunction · 0.85

Calls 2

tagFunction · 0.85
varintFunction · 0.85

Tested by

no test coverage detected