sbgECom Library
4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
|
REST API related commands. More...
Go to the source code of this file.
Data Structures | |
struct | _SbgEComCmdApiReply |
Typedefs | |
typedef struct _SbgEComCmdApiReply | SbgEComCmdApiReply |
Functions | |
void | sbgEComCmdApiReplyConstruct (SbgEComCmdApiReply *pReply) |
void | sbgEComCmdApiReplyDestroy (SbgEComCmdApiReply *pReply) |
bool | sbgEComCmdApiReplySuccessful (const SbgEComCmdApiReply *pReply) |
SbgErrorCode | sbgEComCmdApiGet (SbgEComHandle *pHandle, const char *pPath, const char *pQuery, SbgEComCmdApiReply *pReply) |
SbgErrorCode | sbgEComCmdApiPost (SbgEComHandle *pHandle, const char *pPath, const char *pQuery, const char *pBody, SbgEComCmdApiReply *pReply) |
REST API related commands.
The MIT license
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
typedef struct _SbgEComCmdApiReply SbgEComCmdApiReply |
Reply to REST API commands.
The reply content is a null-terminated string, normally in JSON format.
The content directly refers to data inside the payload.
void sbgEComCmdApiReplyConstruct | ( | SbgEComCmdApiReply * | pReply | ) |
REST API reply constructor.
[in] | pReply | REST API reply. |
void sbgEComCmdApiReplyDestroy | ( | SbgEComCmdApiReply * | pReply | ) |
REST API reply destructor.
[in] | pReply | REST API reply. |
bool sbgEComCmdApiReplySuccessful | ( | const SbgEComCmdApiReply * | pReply | ) |
Check if a reply indicates successful command execution.
[in] | pReply | REST API reply. |
SbgErrorCode sbgEComCmdApiGet | ( | SbgEComHandle * | pHandle, |
const char * | pPath, | ||
const char * | pQuery, | ||
SbgEComCmdApiReply * | pReply | ||
) |
Send a GET command.
The reply must be destroyed before the next attempt to receive data, either logs or command replies.
[in] | pHandle | ECom handle. |
[in] | pPath | URI path component. |
[in] | pQuery | Query string, may be NULL. |
[out] | pReply | Reply. |
SbgErrorCode sbgEComCmdApiPost | ( | SbgEComHandle * | pHandle, |
const char * | pPath, | ||
const char * | pQuery, | ||
const char * | pBody, | ||
SbgEComCmdApiReply * | pReply | ||
) |
Send a POST command.
The reply must be destroyed before the next attempt to receive data, either logs or command replies.
[in] | pHandle | ECom handle. |
[in] | pPath | URI path component. |
[in] | pQuery | Query string, may be NULL. |
[in] | pBody | Body, may be NULL. |
[out] | pReply | Reply. |