MCPcopy Create free account
hub / github.com/FastLED/FastLED / send_rpc

Method send_rpc

ci/autoresearch_agent.py:137–157  ·  view source on GitHub ↗

Send JSON-RPC command and wait for response. Args: function: RPC function name (e.g., "configure", "runTest") args: Function arguments as list (default: []) Returns: JSON response dict from device Raises: TimeoutError: If no

(self, function: str, args: list[Any] | None = None)

Source from the content-addressed store, hash-verified

135 self.timeout = timeout
136
137 def send_rpc(self, function: str, args: list[Any] | None = None) -> dict[str, Any]:
138 """Send JSON-RPC command and wait for response.
139
140 Args:
141 function: RPC function name (e.g., "configure", "runTest")
142 args: Function arguments as list (default: [])
143
144 Returns:
145 JSON response dict from device
146
147 Raises:
148 TimeoutError: If no response received within timeout
149 """
150 cmd = {"method": function, "params": args or []}
151 cmd_str = json.dumps(cmd, separators=(",", ":"))
152
153 # Send command (no manual buffer clearing needed with SerialMonitor)
154 self._monitor.write(cmd_str + "\n")
155
156 # Wait for REMOTE: prefixed response
157 return self._wait_for_response()
158
159 def _wait_for_response(self) -> dict[str, Any]:
160 """Wait for and parse JSON-RPC response.

Callers 13

configureMethod · 0.95
set_lane_sizesMethod · 0.95
set_led_countMethod · 0.95
set_patternMethod · 0.95
set_short_strip_sizeMethod · 0.95
set_long_strip_sizeMethod · 0.95
set_strip_size_valuesMethod · 0.95
set_lane_rangeMethod · 0.95
get_stateMethod · 0.95
get_driversMethod · 0.95
pingMethod · 0.95

Calls 2

_wait_for_responseMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected