|
# page `index` {#indexpage}
|
|
# group `request` {#group__request}
|
|
|
|
|
|
Motorcortex C++ is a communication library to develop C++ client applications for the Motorcortex Core. Motorcortex ++ provides an implementation of the low-level API defined in motorcortex.proto.
|
|
Request/Reply communication is used to send commands to a motorcortex server.
|
|
|
|
|
|
In addition there is an implementation of higher-level API to control a robotic arm. This API allows for switching between control modes, creating and executing motion programs.
|
|
## Summary
|
|
|
|
|
|
## Prerequisites
|
|
Members | Descriptions
|
|
|
|
--------------------------------|---------------------------------------------
|
|
|
|
`public `[`Request`](#group__request_1ga0bf696d0a423087fbe17c221307636fd)`() = delete` |
|
|
|
|
`public explicit `[`Request`](#group__request_1ga44c87d666fa137904e56bc5d1944d434)`(const ParameterTree & parameter_tree)` |
|
|
|
|
`public `[`~Request`](#group__request_1gac16054e325ff15f7d640dddef1c20567)`()` |
|
|
|
|
`public std::string `[`url`](#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0)`() const` |
|
|
|
|
`public ConnectionReply `[`connect`](#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470)`(std::string url,size_t timeout_ms)` |
|
|
|
|
`public ConnectionReply `[`connect`](#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566)`(std::string url,const ConnectionOptions & connection_options)` |
|
|
|
|
`public void `[`close`](#group__request_1ga27321c84e73a5cb48f279858c8c01191)`()` |
|
|
|
|
`public StatusReply `[`login`](#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6)`(std::string login,std::string password) const` |
|
|
|
|
`public ParameterTreeReply `[`getParameterTree`](#group__request_1ga78655693735ceedfc18d2d87d6a0d79b)`(size_t timeout_msec) const` |
|
|
|
|
`public StatusReply `[`setParameter`](#group__request_1gaafe3905a109847c73bcdbd7a82dac92b)`(SetParameter value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1gaf8c7e702165817675f352e5b364a3d5d)`(const std::string & path,const T & value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga9bfa52fa512e4bb457693fd18e07315b)`(const std::string & path,const std::initializer_list< T > & value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga5d80f31b02f2580c2876abc749125499)`(const std::string & path,const std::vector< T > & value) const` |
|
|
|
|
`public GetParameterReply `[`getParameter`](#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9)`(const std::string & path) const` |
|
|
|
|
`public SubscriptionReply `[`createGroup`](#group__request_1gaf43939dd894f40759279cdae2db1fc4b)`(std::vector< std::string > path_list,const std::string & group_alias,size_t frequency_divider) const` |
|
|
|
|
`public StatusReply `[`removeGroup`](#group__request_1ga2265e5c93d801c6d458936c0c225d002)`(const std::string & group_alias) const` |
|
|
|
|
`public WorkerHandle `[`getWorker`](#group__request_1ga80a298c33217ce25fd1eed07dd837010)`() const` |
|
|
|
|
`public static McxStatus `[`send`](#group__request_1ga8880f52e569f160c255d0d0cc534b12f)`(WorkerHandle & worker)` |
|
|
|
|
`class `[`mcx_cpp::Request`](#classmcx__cpp_1_1Request) |
|
|
|
|
`struct `[`mcx_cpp::ConnectionOptions`](#structmcx__cpp_1_1ConnectionOptions) |
|
|
|
|
|
|
*mbed TLS*[https://tls.mbed.org/](https://tls.mbed.org/) (optional, only required for encrypted communication)
|
|
## Members
|
|
|
|
|
|
[Download](https://tls.mbed.org/download) the latest stable version (last tested version = 2.16.4), or clone from the [mbedtls git repository](https://github.com/ARMmbed/mbedtls)
|
|
#### `public `[`Request`](#group__request_1ga0bf696d0a423087fbe17c221307636fd)`() = delete` {#group__request_1ga0bf696d0a423087fbe17c221307636fd}
|
|
|
|
|
|
**When cloning from the [mbedtls git repository](https://github.com/ARMmbed/mbedtls) make sure to switch to the master branch after cloning (the default branch is development)**mkdir build
|
|
#### `public explicit `[`Request`](#group__request_1ga44c87d666fa137904e56bc5d1944d434)`(const ParameterTree & parameter_tree)` {#group__request_1ga44c87d666fa137904e56bc5d1944d434}
|
|
cd build
|
|
|
|
cmake .. -DUSE_SHARED_MBEDTLS_LIBRARY=1
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
*nng - nanomsg-next-gen*[https://github.com/nanomsg/nng](https://github.com/nanomsg/nng)mkdir build
|
|
#### `public `[`~Request`](#group__request_1gac16054e325ff15f7d640dddef1c20567)`()` {#group__request_1gac16054e325ff15f7d640dddef1c20567}
|
|
cd build
|
|
|
|
cmake .. -DBUILD_SHARED_LIBS=1 #optional: -DNNG_ENABLE_TLS=1
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
## Installation
|
|
#### `public std::string `[`url`](#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0)`() const` {#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0}
|
|
|
|
|
|
These steps here are the minimum steps to get a default Debug build. Using CMake you can do many other things, including setting additional variables, setting up for static builds, or generation project or solution files for different development environments. Please check the CMake website for all the various options that CMake supports.
|
|
#### `public ConnectionReply `[`connect`](#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470)`(std::string url,size_t timeout_ms)` {#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470}
|
|
|
|
|
|
## Linux
|
|
#### `public ConnectionReply `[`connect`](#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566)`(std::string url,const ConnectionOptions & connection_options)` {#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566}
|
|
|
|
|
|
mkdir build
|
|
#### `public void `[`close`](#group__request_1ga27321c84e73a5cb48f279858c8c01191)`()` {#group__request_1ga27321c84e73a5cb48f279858c8c01191}
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
sudo ldconfig
|
|
|
|
|
|
|
|
## MacOS
|
|
#### `public StatusReply `[`login`](#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6)`(std::string login,std::string password) const` {#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6}
|
|
|
|
|
|
## Windows
|
|
#### `public ParameterTreeReply `[`getParameterTree`](#group__request_1ga78655693735ceedfc18d2d87d6a0d79b)`(size_t timeout_msec) const` {#group__request_1ga78655693735ceedfc18d2d87d6a0d79b}
|
|
|
|
|
|
## Getting started
|
|
#### `public StatusReply `[`setParameter`](#group__request_1gaafe3905a109847c73bcdbd7a82dac92b)`(SetParameter value) const` {#group__request_1gaafe3905a109847c73bcdbd7a82dac92b}
|
|
|
|
|
|
See `test/api/basic_api_test.cpp` for an example how to use the library. |
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1gaf8c7e702165817675f352e5b364a3d5d)`(const std::string & path,const T & value) const` {#group__request_1gaf8c7e702165817675f352e5b364a3d5d}
|
|
|
|
|
|
|
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga9bfa52fa512e4bb457693fd18e07315b)`(const std::string & path,const std::initializer_list< T > & value) const` {#group__request_1ga9bfa52fa512e4bb457693fd18e07315b}
|
|
|
|
|
|
|
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga5d80f31b02f2580c2876abc749125499)`(const std::string & path,const std::vector< T > & value) const` {#group__request_1ga5d80f31b02f2580c2876abc749125499}
|
|
|
|
|
|
|
|
#### `public GetParameterReply `[`getParameter`](#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9)`(const std::string & path) const` {#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9}
|
|
|
|
|
|
|
|
#### `public SubscriptionReply `[`createGroup`](#group__request_1gaf43939dd894f40759279cdae2db1fc4b)`(std::vector< std::string > path_list,const std::string & group_alias,size_t frequency_divider) const` {#group__request_1gaf43939dd894f40759279cdae2db1fc4b}
|
|
|
|
|
|
|
|
#### `public StatusReply `[`removeGroup`](#group__request_1ga2265e5c93d801c6d458936c0c225d002)`(const std::string & group_alias) const` {#group__request_1ga2265e5c93d801c6d458936c0c225d002}
|
|
|
|
|
|
|
|
#### `public WorkerHandle `[`getWorker`](#group__request_1ga80a298c33217ce25fd1eed07dd837010)`() const` {#group__request_1ga80a298c33217ce25fd1eed07dd837010}
|
|
|
|
|
|
|
|
#### `public static McxStatus `[`send`](#group__request_1ga8880f52e569f160c255d0d0cc534b12f)`(WorkerHandle & worker)` {#group__request_1ga8880f52e569f160c255d0d0cc534b12f}
|
|
|
|
|
|
|
|
# class `mcx_cpp::Request` {#classmcx__cpp_1_1Request}
|
|
|
|
|
|
|
|
## Summary
|
|
|
|
|
|
|
|
Members | Descriptions
|
|
|
|
--------------------------------|---------------------------------------------
|
|
|
|
`public `[`Request`](#group__request_1ga0bf696d0a423087fbe17c221307636fd)`() = delete` |
|
|
|
|
`public explicit `[`Request`](#group__request_1ga44c87d666fa137904e56bc5d1944d434)`(const `[`ParameterTree`](api_.md undefined#classmcx__cpp_1_1ParameterTree)` & parameter_tree)` |
|
|
|
|
`public `[`~Request`](#group__request_1gac16054e325ff15f7d640dddef1c20567)`()` |
|
|
|
|
`public std::string `[`url`](#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0)`() const` |
|
|
|
|
`public ConnectionReply `[`connect`](#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470)`(std::string url,size_t timeout_ms)` |
|
|
|
|
`public ConnectionReply `[`connect`](#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566)`(std::string url,const `[`ConnectionOptions`](#structmcx__cpp_1_1ConnectionOptions)` & connection_options)` |
|
|
|
|
`public void `[`close`](#group__request_1ga27321c84e73a5cb48f279858c8c01191)`()` |
|
|
|
|
`public StatusReply `[`login`](#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6)`(std::string login,std::string password) const` |
|
|
|
|
`public ParameterTreeReply `[`getParameterTree`](#group__request_1ga78655693735ceedfc18d2d87d6a0d79b)`(size_t timeout_msec) const` |
|
|
|
|
`public StatusReply `[`setParameter`](#group__request_1gaafe3905a109847c73bcdbd7a82dac92b)`(`[`SetParameter`](api_.md undefined#classmcx__cpp_1_1SetParameter)` value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1gaf8c7e702165817675f352e5b364a3d5d)`(const std::string & path,const T & value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga9bfa52fa512e4bb457693fd18e07315b)`(const std::string & path,const std::initializer_list< T > & value) const` |
|
|
|
|
`public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga5d80f31b02f2580c2876abc749125499)`(const std::string & path,const std::vector< T > & value) const` |
|
|
|
|
`public GetParameterReply `[`getParameter`](#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9)`(const std::string & path) const` |
|
|
|
|
`public SubscriptionReply `[`createGroup`](#group__request_1gaf43939dd894f40759279cdae2db1fc4b)`(std::vector< std::string > path_list,const std::string & group_alias,size_t frequency_divider) const` |
|
|
|
|
`public StatusReply `[`removeGroup`](#group__request_1ga2265e5c93d801c6d458936c0c225d002)`(const std::string & group_alias) const` |
|
|
|
|
`public `[`WorkerHandle`](api_.md undefined#classmcx__cpp_1_1WorkerHandle)` `[`getWorker`](#group__request_1ga80a298c33217ce25fd1eed07dd837010)`() const` |
|
|
|
|
|
|
|
|
## Members
|
|
|
|
|
|
|
|
#### `public `[`Request`](#group__request_1ga0bf696d0a423087fbe17c221307636fd)`() = delete` {#group__request_1ga0bf696d0a423087fbe17c221307636fd}
|
|
|
|
|
|
|
|
#### `public explicit `[`Request`](#group__request_1ga44c87d666fa137904e56bc5d1944d434)`(const `[`ParameterTree`](api_.md undefined#classmcx__cpp_1_1ParameterTree)` & parameter_tree)` {#group__request_1ga44c87d666fa137904e56bc5d1944d434}
|
|
|
|
|
|
|
|
#### `public `[`~Request`](#group__request_1gac16054e325ff15f7d640dddef1c20567)`()` {#group__request_1gac16054e325ff15f7d640dddef1c20567}
|
|
|
|
|
|
|
|
#### `public std::string `[`url`](#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0)`() const` {#group__request_1gacfcdd3adb2b1211f4e44290ba169e3e0}
|
|
|
|
|
|
|
|
#### `public ConnectionReply `[`connect`](#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470)`(std::string url,size_t timeout_ms)` {#group__request_1ga98d0b1fa72a00894bb1f2e0d92ae9470}
|
|
|
|
|
|
|
|
#### `public ConnectionReply `[`connect`](#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566)`(std::string url,const `[`ConnectionOptions`](#structmcx__cpp_1_1ConnectionOptions)` & connection_options)` {#group__request_1gaf7c3e05e562f529a60632e2e5cf1e566}
|
|
|
|
|
|
|
|
#### `public void `[`close`](#group__request_1ga27321c84e73a5cb48f279858c8c01191)`()` {#group__request_1ga27321c84e73a5cb48f279858c8c01191}
|
|
|
|
|
|
|
|
#### `public StatusReply `[`login`](#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6)`(std::string login,std::string password) const` {#group__request_1ga563ffd90d911f4501b0cfd38a5d67cb6}
|
|
|
|
|
|
|
|
#### `public ParameterTreeReply `[`getParameterTree`](#group__request_1ga78655693735ceedfc18d2d87d6a0d79b)`(size_t timeout_msec) const` {#group__request_1ga78655693735ceedfc18d2d87d6a0d79b}
|
|
|
|
|
|
|
|
#### `public StatusReply `[`setParameter`](#group__request_1gaafe3905a109847c73bcdbd7a82dac92b)`(`[`SetParameter`](api_.md undefined#classmcx__cpp_1_1SetParameter)` value) const` {#group__request_1gaafe3905a109847c73bcdbd7a82dac92b}
|
|
|
|
|
|
|
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1gaf8c7e702165817675f352e5b364a3d5d)`(const std::string & path,const T & value) const` {#group__request_1gaf8c7e702165817675f352e5b364a3d5d}
|
|
|
|
|
|
|
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga9bfa52fa512e4bb457693fd18e07315b)`(const std::string & path,const std::initializer_list< T > & value) const` {#group__request_1ga9bfa52fa512e4bb457693fd18e07315b}
|
|
|
|
|
|
|
|
#### `public template<>` <br/>`inline StatusReply `[`setParameter`](#group__request_1ga5d80f31b02f2580c2876abc749125499)`(const std::string & path,const std::vector< T > & value) const` {#group__request_1ga5d80f31b02f2580c2876abc749125499}
|
|
|
|
|
|
|
|
#### `public GetParameterReply `[`getParameter`](#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9)`(const std::string & path) const` {#group__request_1ga4fe8fa3391225c2790479d38ee6e8ec9}
|
|
|
|
|
|
|
|
#### `public SubscriptionReply `[`createGroup`](#group__request_1gaf43939dd894f40759279cdae2db1fc4b)`(std::vector< std::string > path_list,const std::string & group_alias,size_t frequency_divider) const` {#group__request_1gaf43939dd894f40759279cdae2db1fc4b}
|
|
|
|
|
|
|
|
#### `public StatusReply `[`removeGroup`](#group__request_1ga2265e5c93d801c6d458936c0c225d002)`(const std::string & group_alias) const` {#group__request_1ga2265e5c93d801c6d458936c0c225d002}
|
|
|
|
|
|
|
|
#### `public `[`WorkerHandle`](api_.md undefined#classmcx__cpp_1_1WorkerHandle)` `[`getWorker`](#group__request_1ga80a298c33217ce25fd1eed07dd837010)`() const` {#group__request_1ga80a298c33217ce25fd1eed07dd837010}
|
|
|
|
|
|
|
|
# struct `mcx_cpp::ConnectionOptions` {#structmcx__cpp_1_1ConnectionOptions}
|
|
|
|
|
|
|
|
## Summary
|
|
|
|
|
|
|
|
Members | Descriptions
|
|
|
|
--------------------------------|---------------------------------------------
|
|
|
|
`public std::string `[`certificate`](#group__request_1gac73902a245f268594fe43a2874ce2c41) |
|
|
|
|
`public size_t `[`timeout_msec`](#group__request_1ga590e32e59dca8a417bb0dd6e9273845b) |
|
|
|
|
|
|
|
|
## Members
|
|
|
|
|
|
|
|
#### `public std::string `[`certificate`](#group__request_1gac73902a245f268594fe43a2874ce2c41) {#group__request_1gac73902a245f268594fe43a2874ce2c41}
|
|
|
|
|
|
|
|
#### `public size_t `[`timeout_msec`](#group__request_1ga590e32e59dca8a417bb0dd6e9273845b) {#group__request_1ga590e32e59dca8a417bb0dd6e9273845b} |