sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgEComCmdApi.h File Reference

REST API related commands. More...

#include <sbgCommon.h>
#include <sbgECom.h>
#include <protocol/sbgEComProtocol.h>

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)
 

Detailed Description

REST API related commands.

Author
SBG Systems
Date
October 14, 2020
License

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 Documentation

◆ 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.

Function Documentation

◆ sbgEComCmdApiReplyConstruct()

void sbgEComCmdApiReplyConstruct ( SbgEComCmdApiReply pReply)

REST API reply constructor.

Parameters
[in]pReplyREST API reply.

◆ sbgEComCmdApiReplyDestroy()

void sbgEComCmdApiReplyDestroy ( SbgEComCmdApiReply pReply)

REST API reply destructor.

Parameters
[in]pReplyREST API reply.

◆ sbgEComCmdApiReplySuccessful()

bool sbgEComCmdApiReplySuccessful ( const SbgEComCmdApiReply pReply)

Check if a reply indicates successful command execution.

Parameters
[in]pReplyREST API reply.
Returns
True if the reply indicates successful command execution.

◆ sbgEComCmdApiGet()

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.

Parameters
[in]pHandleECom handle.
[in]pPathURI path component.
[in]pQueryQuery string, may be NULL.
[out]pReplyReply.
Returns
SBG_NO_ERROR if successful.

◆ sbgEComCmdApiPost()

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.

Parameters
[in]pHandleECom handle.
[in]pPathURI path component.
[in]pQueryQuery string, may be NULL.
[in]pBodyBody, may be NULL.
[out]pReplyReply.
Returns
SBG_NO_ERROR if successful.