|
KiCad PCB EDA Suite
|
#include <api_client.h>
Public Member Functions | |
| KICAD_API_CLIENT (int aTimeoutMs=1000, bool aBlock=true) | |
| ~KICAD_API_CLIENT () | |
| bool | Connect (const wxString &aSocketUrl) |
| void | Disconnect () |
| bool | IsConnected () const |
| bool | Send (const google::protobuf::Message &aRequest, kiapi::common::ApiResponse &aResponse, const std::string &aClientName="kicad") |
| Send a protobuf request to the KiCad API server and wait for a response. | |
| const wxString & | GetLastError () const |
Private Attributes | |
| nng_socket | m_socket |
| bool | m_isOpen |
| bool | m_isConnected |
| wxString | m_lastError |
| bool | m_block |
Definition at line 34 of file api_client.h.
|
explicit |
Definition at line 29 of file api_client.cpp.
References m_block, m_isConnected, m_isOpen, m_lastError, and m_socket.
| KICAD_API_CLIENT::~KICAD_API_CLIENT | ( | ) |
Definition at line 50 of file api_client.cpp.
| bool KICAD_API_CLIENT::Connect | ( | const wxString & | aSocketUrl | ) |
Definition at line 57 of file api_client.cpp.
References m_isConnected, m_isOpen, m_lastError, and m_socket.
Referenced by CROSS_PROBE_CLIENT::AnnounceToPrimary(), and sendRequest().
| void KICAD_API_CLIENT::Disconnect | ( | ) |
Definition at line 78 of file api_client.cpp.
References m_isConnected, m_isOpen, and m_socket.
|
inline |
Definition at line 56 of file api_client.h.
References m_lastError.
|
inline |
Definition at line 43 of file api_client.h.
References m_isConnected, and m_isOpen.
Referenced by Send().
| bool KICAD_API_CLIENT::Send | ( | const google::protobuf::Message & | aRequest, |
| kiapi::common::ApiResponse & | aResponse, | ||
| const std::string & | aClientName = "kicad" ) |
Send a protobuf request to the KiCad API server and wait for a response.
| aRequest | is the command-specific protobuf message. |
| aResponse | receives the ApiResponse envelope. |
| aClientName | is an optional client identifier for the request header. |
Definition at line 98 of file api_client.cpp.
References IsConnected(), m_block, m_lastError, and m_socket.
Referenced by sendRequest().
|
private |
Definition at line 63 of file api_client.h.
Referenced by KICAD_API_CLIENT(), and Send().
|
private |
Definition at line 61 of file api_client.h.
Referenced by Connect(), Disconnect(), IsConnected(), and KICAD_API_CLIENT().
|
private |
Definition at line 60 of file api_client.h.
Referenced by Connect(), Disconnect(), IsConnected(), KICAD_API_CLIENT(), and ~KICAD_API_CLIENT().
|
private |
Definition at line 62 of file api_client.h.
Referenced by Connect(), GetLastError(), KICAD_API_CLIENT(), and Send().
|
private |
Definition at line 59 of file api_client.h.
Referenced by Connect(), Disconnect(), KICAD_API_CLIENT(), Send(), and ~KICAD_API_CLIENT().