SOUND4 IMPACT FM.CL Library [2.0.3]
Loading...
Searching...
No Matches
Client's JSon config interfacing

Communicate with the instance. More...

Classes

struct  impactfm_CClientInstance

Functions

struct impactfm_CClientInstance * impactfm_NewClient (struct impactfm_CInstance *instance)
void impactfm_DeleteClient (struct impactfm_CClientInstance *client)
const char * impactfm_ProcessJson (struct impactfm_CClientInstance *client, const char *json_str, int *need_save)
void impactfm_FreeJsonAnswer (const char *json_str)
int impactfm_SaveState (struct impactfm_CInstance *instance)

Detailed Description

Allow low-level JSON configuration. see also JSON syntax

Function Documentation

◆ impactfm_DeleteClient()

void impactfm_DeleteClient ( struct impactfm_CClientInstance * client)

Deletes a client

Parameters
clientthe client instance

◆ impactfm_FreeJsonAnswer()

void impactfm_FreeJsonAnswer ( const char * json_str)

Free a JSON answer returned by impactfm_ProcessJson

Parameters
json_strthe JSON request

◆ impactfm_NewClient()

struct impactfm_CClientInstance * impactfm_NewClient ( struct impactfm_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

◆ impactfm_ProcessJson()

const char * impactfm_ProcessJson ( struct impactfm_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 impactfm_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 impactfm_FreeJsonAnswer)

◆ impactfm_SaveState()

int impactfm_SaveState ( struct impactfm_CInstance * instance)

Save the current state

Needed when impactfm_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