Connect to Serial Studio API server
(self)
| 39 | self._buffer = b"" |
| 40 | |
| 41 | def connect(self): |
| 42 | """Connect to Serial Studio API server""" |
| 43 | try: |
| 44 | self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| 45 | self.sock.connect((self.host, self.port)) |
| 46 | print(f"✓ Connected to Serial Studio at {self.host}:{self.port}") |
| 47 | except ConnectionRefusedError: |
| 48 | print(f"\n✗ Connection refused to {self.host}:{self.port}") |
| 49 | print("\nMake sure:") |
| 50 | print(" 1. Serial Studio is running") |
| 51 | print(" 2. API Server is enabled in Settings (⚙️)") |
| 52 | print(' Enable "Enable API Server (Port 7777)" switch') |
| 53 | print(" 3. No firewall is blocking port 7777\n") |
| 54 | raise |
| 55 | |
| 56 | def send_request(self, method, params=None): |
| 57 | """Send MCP JSON-RPC 2.0 request""" |
no outgoing calls
no test coverage detected