SOUND4 x1.CLOUD Library [1.5.6]
Loading...
Searching...
No Matches
Classes | Functions
Client's JSon config interfacing

Communicate with the instance. More...

Classes

struct  cloudx1_CClientInstance
 

Functions

struct cloudx1_CClientInstancecloudx1_NewClient (struct cloudx1_CInstance *instance)
 
void cloudx1_DeleteClient (struct cloudx1_CClientInstance *client)
 
const char * cloudx1_ProcessJson (struct cloudx1_CClientInstance *client, const char *json_str, int *need_save)
 
void cloudx1_FreeJsonAnswer (const char *json_str)
 
int cloudx1_SaveState (struct cloudx1_CInstance *instance)
 

Detailed Description

Allow low-level JSON configuration. see also JSON syntax

Function Documentation

◆ cloudx1_DeleteClient()

void cloudx1_DeleteClient ( struct cloudx1_CClientInstance client)

Deletes a client

Parameters
clientthe client instance

◆ cloudx1_FreeJsonAnswer()

void cloudx1_FreeJsonAnswer ( const char *  json_str)

Free a JSON answer returned by cloudx1_ProcessJson

Parameters
json_strthe JSON request

◆ cloudx1_NewClient()

struct cloudx1_CClientInstance * cloudx1_NewClient ( struct cloudx1_CInstance instance)

Creates a new client

Remarks
not needed if using a port for JSON socket in Update Management
Parameters
instancethe processing instance
Returns
A new client instance

◆ cloudx1_ProcessJson()

const char * cloudx1_ProcessJson ( struct cloudx1_CClientInstance client,
const char *  json_str,
int *  need_save 
)

Process a JSON request

For syntax, see JSON syntax

Note
In all library, all char* are UTF-8 encoded
Attention
the return value needs to be freed with cloudx1_FreeJsonAnswer
Parameters
clientthe client instance
json_strthe JSON request
need_saveon return will be 1 is saving is required (maybe delayed)
Returns
a JSON answer (to be freed with cloudx1_FreeJsonAnswer)

◆ cloudx1_SaveState()

int cloudx1_SaveState ( struct cloudx1_CInstance instance)

Save the current state

Needed when cloudx1_ProcessJson returned with need_save to 1. However it can be postponed as much as wanted.

Remarks
Works only when update thread is running
Parameters
instancethe processing instance
Returns
0 if success, <0 on error