MCPcopy Create free account
hub / github.com/facebook/time / readResult

Method readResult

sa53/protocol/protocol.go:244–263  ·  view source on GitHub ↗

readResult is the firmware-side reader. Fills a buffer until the last two bytes are "\r\n". Kept distinct from ReadResponse because the firmware upgrade flow has been validated against this exact behavior on real hardware; do not redirect callers without re-validating.

()

Source from the content-addressed store, hash-verified

242// upgrade flow has been validated against this exact behavior on real
243// hardware; do not redirect callers without re-validating.
244func (m *Mac) readResult() (string, error) {
245 var r int
246 buff := make([]byte, 4101)
247 for {
248 n, err := m.Read(buff[r:])
249 if err != nil {
250 return "", err
251 }
252
253 if n == 0 {
254 break
255 }
256 r += n
257
258 if bytes.Equal(buff[r-2:r], []byte("\r\n")) {
259 break
260 }
261 }
262 return string(buff[:r-2]), nil
263}
264
265// WaitBoot waiting for boot logo to show
266func (m *Mac) WaitBoot() error {

Callers 3

WaitBootMethod · 0.95
cmdResultMethod · 0.95
XModemDoneMethod · 0.95

Calls 1

ReadMethod · 0.95

Tested by

no test coverage detected