cmdResult is the firmware-side write+read helper. Distinct from Cmd so the firmware upgrade flow keeps its validated behavior (no drain, fixed-buffer reader).
(cmd string)
| 280 | // firmware upgrade flow keeps its validated behavior (no drain, fixed-buffer |
| 281 | // reader). |
| 282 | func (m *Mac) cmdResult(cmd string) (string, error) { |
| 283 | _, err := m.port.Write([]byte(cmd)) |
| 284 | if err != nil { |
| 285 | return "", err |
| 286 | } |
| 287 | return m.readResult() |
| 288 | } |
| 289 | |
| 290 | // Reset is to reset the MAC |
| 291 | func (m *Mac) Reset() error { |
no test coverage detected