GrowNode
grownode.h File Reference

Macros

#define GN_NODE_LEAVES_MAX_SIZE   64
 

Typedefs

typedef gn_leaf_param_validator_result_t(* gn_validator_callback_t) (gn_leaf_param_handle_t param, void **value)
 
typedef struct gn_config_init_param_tgn_config_init_param_handle_t
 

Functions

gn_node_handle_t gn_node_create (gn_config_handle_t config, const char *name)
 create a new node with specified configuration and name More...
 
gn_err_t gn_node_destroy (gn_node_handle_t node)
 removes the node from the config More...
 
gn_err_t gn_node_start (gn_node_handle_t node)
 starts the node by starting the leaves tasks More...
 
size_t gn_node_get_size (gn_node_handle_t config)
 number of leaves into the node More...
 
gn_config_handle_t gn_init (gn_config_init_param_t *config_init)
 performs the initialization workflow More...
 
gn_err_t gn_firmware_update ()
 send a message to the display More...
 
gn_err_t gn_reset ()
 reset the flash content and restart the board immediately More...
 
gn_err_t gn_reboot ()
 reboot the board More...
 
gn_leaf_handle_t gn_leaf_create (gn_node_handle_t node_config, const char *name, gn_leaf_config_callback callback, size_t task_size)
 creates the leaf More...
 
gn_leaf_descriptor_handle_t gn_leaf_get_descriptor (gn_leaf_handle_t leaf_config)
 
QueueHandle_t gn_leaf_get_event_queue (gn_leaf_handle_t leaf_config)
 gets the leaf queue handle More...
 
gn_err_t gn_leaf_event_subscribe (gn_leaf_handle_t leaf_config, gn_event_id_t event_id)
 subscribe the leaf to the event id. More...
 
gn_err_t gn_leaf_event_unsubscribe (gn_leaf_handle_t leaf_config, gn_event_id_t event_id)
 unsubscribe the leaf to the event id. More...
 
gn_leaf_param_handle_t gn_leaf_param_create (gn_leaf_handle_t leaf_config, const char *name, const gn_val_type_t type, const gn_val_t val, gn_leaf_param_access_type_t access, gn_leaf_param_storage_t storage, gn_validator_callback_t validator)
 
gn_err_t gn_leaf_param_add_to_leaf (const gn_leaf_handle_t leaf, const gn_leaf_param_handle_t new_param)
 add a parameter to the leaf. More...
 
gn_leaf_param_handle_t gn_leaf_param_get_param_handle (const gn_leaf_handle_t leaf, const char *param_name)
 returns the specific parameter associated to the leaf More...
 
gn_err_t gn_leaf_param_get_value (const gn_leaf_param_handle_t param, void *val)
 gets the value pointed by the parameter More...
 
gn_err_t gn_leaf_param_get_string (const gn_leaf_handle_t leaf_config, const char *name, char *val, size_t max_lenght)
 gets the parameter value More...
 
gn_err_t gn_leaf_param_write_string (const gn_leaf_handle_t leaf, const char *name, char *val)
 updates the parameter with new value More...
 
gn_err_t gn_leaf_param_init_string (const gn_leaf_handle_t leaf, const char *name, const char *val)
 init the parameter with new value and stores in NVS flash, overwriting previous values More...
 
gn_err_t gn_leaf_param_get_bool (const gn_leaf_handle_t leaf_config, const char *name, bool *val)
 
gn_err_t gn_leaf_param_write_bool (const gn_leaf_handle_t leaf, const char *name, bool val)
 updates the parameter with new value More...
 
gn_err_t gn_leaf_param_init_bool (const gn_leaf_handle_t leaf, const char *name, bool val)
 init the parameter with new value and stores in NVS flash, overwriting previous values More...
 
gn_err_t gn_leaf_param_get_double (const gn_leaf_handle_t leaf_config, const char *name, double *val)
 
gn_err_t gn_leaf_param_write_double (const gn_leaf_handle_t leaf, const char *name, double val)
 updates the parameter with new value More...
 
gn_err_t gn_leaf_param_init_double (const gn_leaf_handle_t leaf, const char *name, double val)
 init the parameter with new value and stores in NVS flash, overwriting previous values More...
 
gn_err_t gn_leaf_param_write (const gn_leaf_handle_t leaf, const void *val)
 
gn_err_t gn_log (char *log_tag, gn_log_level_t level, const char *message,...)
 write ESP log, send log in the event queue and publish in network More...
 
gn_node_status_t gn_get_status (gn_config_handle_t config)
 retrieves the configuration status More...
 
const char * gn_get_status_description (gn_config_handle_t config)
 retrieves the configuration status description More...
 
esp_event_loop_handle_t gn_get_event_loop (gn_config_handle_t config)
 retrieves the event loop starting from the config handle More...
 
esp_event_loop_handle_t gn_leaf_get_event_loop (gn_config_handle_t config)
 retrieves the event loop starting from the leaf config handle More...
 
gn_err_t gn_node_get_name (gn_node_handle_t node_config, char *name)
 gets the name of the node referenced by the handle More...
 
gn_err_t gn_leaf_get_name (gn_leaf_handle_t leaf_config, char *name)
 gets the name of the leaf referenced by the handle More...
 
esp_event_loop_handle_t gn_node_get_event_loop (gn_node_handle_t node)
 retrieves the event loop from the node More...
 
gn_leaf_handle_t gn_leaf_get_config_handle (gn_node_handle_t node, const char *name)
 
gn_node_handle_t gn_leaf_get_node (gn_leaf_handle_t leaf_config)
 
gn_err_t gn_send_leaf_param_change_message (const char *leaf_name, const char *param_name, const void *message, size_t message_len)
 send a request to change a parameter name More...
 
gn_err_t gn_send_node_leaf_param_status (const gn_node_handle_t _node_config)
 send parameter status per each parameter More...
 
gn_err_t gn_leaf_param_set_bool (const gn_leaf_handle_t leaf_config, const char *name, bool val)
 generate a request to update the parameter to the leaf. More...
 
gn_err_t gn_leaf_param_set_double (const gn_leaf_handle_t leaf_config, const char *name, double val)
 generate a request to update the parameter to the leaf. More...
 
gn_err_t gn_leaf_param_set_string (const gn_leaf_handle_t leaf_config, const char *name, char *val)
 generate a request to update the parameter to the leaf. More...
 
gn_display_container_t gn_display_setup_leaf (gn_leaf_handle_t leaf_config)
 
BaseType_t gn_display_leaf_refresh_start ()
 
BaseType_t gn_display_leaf_refresh_end ()
 
gn_server_status_t gn_mqtt_get_status ()
 
gn_err_t gn_storage_set (const char *key, const void *value, size_t required_size)
 stores the key into the NVS flash More...
 
gn_err_t gn_storage_get (const char *key, void **value)
 retrieves the key from the NVS flash More...
 

Macro Definition Documentation

◆ GN_NODE_LEAVES_MAX_SIZE

#define GN_NODE_LEAVES_MAX_SIZE   64

Typedef Documentation

◆ gn_config_init_param_handle_t

◆ gn_validator_callback_t

typedef gn_leaf_param_validator_result_t(* gn_validator_callback_t) (gn_leaf_param_handle_t param, void **value)

Function Documentation

◆ gn_display_leaf_refresh_end()

BaseType_t gn_display_leaf_refresh_end ( )

◆ gn_display_leaf_refresh_start()

BaseType_t gn_display_leaf_refresh_start ( )

◆ gn_display_setup_leaf()

gn_display_container_t gn_display_setup_leaf ( gn_leaf_handle_t  leaf_config)

◆ gn_firmware_update()

gn_err_t gn_firmware_update ( )

send a message to the display

implemented by sending an internal GN_DISPLAY_LOG_EVENT event NOTE: data will be truncated depending on display size

Parameters
messagethe message to send (null terminated)
Returns
GN_RET_OK if event is dispatched
GN_RET_ERR if the event dispatch encounters a problem
GN_RET_ERR_INVALID_ARG if message is NULL or zero length

starts the OTA firmware upgrade

it starts the OTA tasks so it returns immediately

Returns
GN_RET_OK

◆ gn_get_event_loop()

esp_event_loop_handle_t gn_get_event_loop ( gn_config_handle_t  config)

retrieves the event loop starting from the config handle

Parameters
configthe config handle
Returns
the event loop
NULL if config not valid

◆ gn_get_status()

gn_node_status_t gn_get_status ( gn_config_handle_t  config)
inline

retrieves the configuration status

Parameters
configthe configuration handle to check
Returns
GN_CONFIG_STATUS_ERROR if config is NULL
the configuration status

◆ gn_get_status_description()

const char* gn_get_status_description ( gn_config_handle_t  config)
inline

retrieves the configuration status description

Parameters
configthe configuration handle to check
Returns
GN_CONFIG_STATUS_ERROR if config is NULL
the configuration status

◆ gn_init()

gn_config_handle_t gn_init ( gn_config_init_param_t config_init)

performs the initialization workflow

  • creates the configuration handle
  • initializes hardware (flash, storage)
  • initializes event loop and handlers
  • initializes display if configured
  • initializes network if configured (starting provisioning is not set)
  • initializes server connection

this is a process that will continue even after the function returns, eg for network/server connection

when everything is OK it sets the status of the config handle to GN_CONFIG_STATUS_ERROR

NOTE: if called several times, it returns always the same handle

Returns
an handle to the config data structure

◆ gn_leaf_create()

gn_leaf_handle_t gn_leaf_create ( gn_node_handle_t  node_config,
const char *  name,
gn_leaf_config_callback  callback,
size_t  task_size 
)

creates the leaf

initializes the leaf structure. the returned handle is not active and need to be started by the gn_node_start() function

See also
gn_node_start()
Parameters
node_configthe configuration handle to create the leaf to
namethe name of the leaf to be created
callbackthe callback to be called to configure the leaf
taskcallback function of the leaf task
task_sizethe size of the task to be memory allocated
Returns
an handle to the leaf config
NULL if the handle cannot be created

◆ gn_leaf_event_subscribe()

gn_err_t gn_leaf_event_subscribe ( gn_leaf_handle_t  leaf_config,
gn_event_id_t  event_id 
)

subscribe the leaf to the event id.

Returns
GN_RET_OK if successful

◆ gn_leaf_event_unsubscribe()

gn_err_t gn_leaf_event_unsubscribe ( gn_leaf_handle_t  leaf_config,
gn_event_id_t  event_id 
)

unsubscribe the leaf to the event id.

Returns
GN_RET_OK if successful

◆ gn_leaf_get_config_handle()

gn_leaf_handle_t gn_leaf_get_config_handle ( gn_node_handle_t  node,
const char *  name 
)

◆ gn_leaf_get_descriptor()

gn_leaf_descriptor_handle_t gn_leaf_get_descriptor ( gn_leaf_handle_t  leaf_config)

returns the descriptor handle for the corresponding leaf

◆ gn_leaf_get_event_loop()

esp_event_loop_handle_t gn_leaf_get_event_loop ( gn_leaf_handle_t  leaf_config)

retrieves the event loop starting from the leaf config handle

Parameters
leaf_configthe leaf config handle
Returns
the event loop
NULL if leaf config not valid

◆ gn_leaf_get_event_queue()

QueueHandle_t gn_leaf_get_event_queue ( gn_leaf_handle_t  leaf_config)

gets the leaf queue handle

Parameters
leaf_configthe leaf to be queried
Returns
the queue handle
NULL if leaf not found

◆ gn_leaf_get_name()

gn_err_t gn_leaf_get_name ( gn_leaf_handle_t  leaf_config,
char *  name 
)

gets the name of the leaf referenced by the handle

Parameters
leaf_configthe handle to be queried
namethe pointer where the name will be set. set lenght to GN_LEAF_NAME_SIZE
Returns
GN_RET_ERR_INVALID_ARG if the handle is not valid
GN_RET_OK if everything OK

◆ gn_leaf_get_node()

gn_node_handle_t gn_leaf_get_node ( gn_leaf_handle_t  leaf_config)

◆ gn_leaf_param_add_to_leaf()

gn_err_t gn_leaf_param_add_to_leaf ( const gn_leaf_handle_t  leaf,
const gn_leaf_param_handle_t  param 
)

add a parameter to the leaf.

the parameter will then listen to server changes

Parameters
leafthe leaf handle
paramthe param to add to the leaf. the leaf will point at it upon method return
Returns
GN_RET_ERR_INVALID_ARG in case of parameter errors
GN_RET_OK upon success

◆ gn_leaf_param_create()

gn_leaf_param_handle_t gn_leaf_param_create ( gn_leaf_handle_t  leaf_config,
const char *  name,
const gn_val_type_t  type,
gn_val_t  val,
gn_leaf_param_access_type_t  access,
gn_leaf_param_storage_t  storage,
gn_validator_callback_t  validator 
)
@brief  creates a parameter on the leaf

NOTE: if parameter is stored, the value is overridden
Parameters
leaf_configthe leaf to be queried
namethe name of the parameter (null terminated char array)
typethe type of parameter
valthe value of parameter
accessaccess type of parameter
storagestorage type of parameter
validatorcallback to validate
Returns
the new parameter handle
NULL in case of errors

◆ gn_leaf_param_get_bool()

gn_err_t gn_leaf_param_get_bool ( const gn_leaf_handle_t  leaf_config,
const char *  name,
bool *  val 
)

◆ gn_leaf_param_get_double()

gn_err_t gn_leaf_param_get_double ( const gn_leaf_handle_t  leaf_config,
const char *  name,
double *  val 
)

◆ gn_leaf_param_get_param_handle()

gn_leaf_param_handle_t gn_leaf_param_get_param_handle ( const gn_leaf_handle_t  leaf_config,
const char *  param_name 
)

returns the specific parameter associated to the leaf

Parameters
leaf_configthe leaf handle to search within
param_namethe name of the parameter (null terminated)
Returns
NULL if leaf_config or the parameter is not found
the found parameter handle

◆ gn_leaf_param_get_string()

gn_err_t gn_leaf_param_get_string ( const gn_leaf_handle_t  leaf_config,
const char *  name,
char *  val,
size_t  max_lenght 
)

gets the parameter value

Parameters
leaf_configthe leaf to get the parameter from
namethe name of the parameter, null terminated
valpointer where the parameter is put
max_lenghtthe maximum lenght of the parameter value to be copied
@return GN_RET_OK if the parameter is set
@return GN_RET_ERR_INVALID_ARG if the parameter is not found

◆ gn_leaf_param_get_value()

gn_err_t gn_leaf_param_get_value ( const gn_leaf_param_handle_t  param,
void *  val 
)

gets the value pointed by the parameter

Parameters
paramthe parameter handle to look at
valthe value returned
@return GN_RET_OK if the parameter is set
@return GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_init_bool()

gn_err_t gn_leaf_param_init_bool ( const gn_leaf_handle_t  leaf_config,
const char *  name,
bool  val 
)

init the parameter with new value and stores in NVS flash, overwriting previous values

the leaf must be not initialized to have an effect. the parameter value will be copied to the corresponding handle.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_init_double()

gn_err_t gn_leaf_param_init_double ( const gn_leaf_handle_t  leaf_config,
const char *  name,
double  val 
)

init the parameter with new value and stores in NVS flash, overwriting previous values

the leaf must be not initialized to have an effect. the parameter value will be copied to the corresponding handle.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_init_string()

gn_err_t gn_leaf_param_init_string ( const gn_leaf_handle_t  leaf_config,
const char *  name,
const char *  val 
)

init the parameter with new value and stores in NVS flash, overwriting previous values

the leaf must be not initialized to have an effect. the parameter value will be copied to the corresponding handle.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_set_bool()

gn_err_t gn_leaf_param_set_bool ( const gn_leaf_handle_t  leaf_config,
const char *  name,
bool  val 
)

generate a request to update the parameter to the leaf.

It inform the leaf that a parameter should be changed. Think of it as it would be requested by the network. It is the basis of inter-leaves messaging.

Parameters
leaf_configthe leaf to ask
namethe parameter name to change
valthe value to change
@return GN_RET_ERR_LEAF_NOT_FOUND if the leaf is not found
@return GN_RET_ERR_INVALID_ARG in case of input parameter error
@return GN_RET_ERR_LEAF_PARAM_ACCESS_VIOLATION in case the parameter access is not write enable

◆ gn_leaf_param_set_double()

gn_err_t gn_leaf_param_set_double ( const gn_leaf_handle_t  leaf_config,
const char *  name,
double  val 
)

generate a request to update the parameter to the leaf.

It inform the leaf that a parameter should be changed. Think of it as it would be requested by the network. It is the basis of inter-leaves messaging.

Parameters
leaf_configthe leaf to ask
namethe parameter name to change
valthe value to change
@return GN_RET_ERR_LEAF_NOT_FOUND if the leaf is not found
@return GN_RET_ERR_INVALID_ARG in case of input parameter error
@return GN_RET_ERR_LEAF_PARAM_ACCESS_VIOLATION in case the parameter access is not write enable

◆ gn_leaf_param_set_string()

gn_err_t gn_leaf_param_set_string ( const gn_leaf_handle_t  leaf_config,
const char *  name,
char *  val 
)

generate a request to update the parameter to the leaf.

It inform the leaf that a parameter should be changed. Think of it as it would be requested by the network. It is the basis of inter-leaves messaging.

Parameters
leaf_configthe leaf to ask
namethe parameter name to change
valthe value to change
@return GN_RET_ERR_LEAF_NOT_FOUND if the leaf is not found
@return GN_RET_ERR_INVALID_ARG in case of input parameter error
@return GN_RET_ERR_LEAF_PARAM_ACCESS_VIOLATION in case the parameter access is not write enable

◆ gn_leaf_param_write()

gn_err_t gn_leaf_param_write ( const gn_leaf_param_handle_t  param_handle,
const void *  value 
)
@brief  updates the parameter with new value

this is calling the gn_leaf_parameter_write_XXX depending on the param handle type, so be careful in order to avoid memory leaks

@param leaf_config  the leaf handle to be queried
@param value        the pointer to value to set ( in case of string, null terminated)

@return GN_RET_OK if the parameter is set
@return GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_write_bool()

gn_err_t gn_leaf_param_write_bool ( const gn_leaf_handle_t  leaf_config,
const char *  name,
bool  val 
)

updates the parameter with new value

the parameter value will be copied to the corresponding handle. after the change the parameter change will be propagated to the event system through a GN_LEAF_PARAM_CHANGED_EVENT and to the server.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set (null terminated)
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_write_double()

gn_err_t gn_leaf_param_write_double ( const gn_leaf_handle_t  leaf_config,
const char *  name,
double  val 
)

updates the parameter with new value

the leaf must be already initialized to have an effect. the parameter value will be copied to the corresponding handle. after the change the parameter change will be propagated to the event system through a GN_LEAF_PARAM_CHANGED_EVENT and to the server.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors

◆ gn_leaf_param_write_string()

gn_err_t gn_leaf_param_write_string ( const gn_leaf_handle_t  leaf_config,
const char *  name,
char *  val 
)

updates the parameter with new value

the parameter value will be copied to the corresponding handle. after the change the parameter change will be propagated to the event system through a GN_LEAF_PARAM_CHANGED_EVENT and to the server.

Parameters
leaf_configthe leaf handle to be queried
namethe name of the parameter (null terminated)
valthe value to set (null terminated)
Returns
GN_RET_OK if the parameter is set
GN_RET_ERR_INVALID_ARG in case of input errors
GN_RET_ERR in case of messaging error

◆ gn_log()

gn_err_t gn_log ( char *  log_tag,
gn_log_level_t  level,
const char *  message,
  ... 
)

write ESP log, send log in the event queue and publish in network

Parameters
log_taglog level, will be the TAG in ESP logging framework
levelgrownode log level
messagethe null terminated message to log
@return GN_RET_OK if event is dispatched
@return GN_RET_ERR if the event dispatch encounters a problem
@return GN_RET_ERR_INVALID_ARG if message is NULL or zero length

◆ gn_mqtt_get_status()

gn_server_status_t gn_mqtt_get_status ( )

◆ gn_node_create()

gn_node_handle_t gn_node_create ( gn_config_handle_t  config,
const char *  name 
)

create a new node with specified configuration and name

Parameters
configthe config handle to use
namename of the node. MUST BE null terminated
Returns
the node handle created.

◆ gn_node_destroy()

gn_err_t gn_node_destroy ( gn_node_handle_t  node)

removes the node from the config

Parameters
nodethe node to be removed
Returns
GN_RET_OK if operation had succeded

◆ gn_node_get_event_loop()

esp_event_loop_handle_t gn_node_get_event_loop ( gn_node_handle_t  node)

retrieves the event loop from the node

Parameters
nodethe node handle
Returns
the event loop
NULL if leaf config not valid

◆ gn_node_get_name()

gn_err_t gn_node_get_name ( gn_node_handle_t  node_config,
char *  name 
)

gets the name of the node referenced by the handle

Parameters
node_configthe handle to be queried
namethe pointer where the name will be set. set lenght to GN_LEAF_NAME_SIZE
Returns
GN_RET_ERR_INVALID_ARG if the handle is not valid
GN_RET_OK if everything OK

◆ gn_node_get_size()

size_t gn_node_get_size ( gn_node_handle_t  node_config)

number of leaves into the node

Parameters
node_configthe node to be inspected
Returns
number of leaves into the node, -1 in case node_config is NULL

◆ gn_node_start()

gn_err_t gn_node_start ( gn_node_handle_t  node)

starts the node by starting the leaves tasks

At the end of the process, it sets the node status to GN_CONFIG_STATUS_STARTED and sends a GN_NODE_STARTED_EVENT event

Parameters
nodethe node to be started
Returns
GN_RET_OK if operation had succeded, GN_RET_ERR_NODE_NOT_STARTED in case of issues

◆ gn_reboot()

gn_err_t gn_reboot ( )

reboot the board

Returns
GN_RET_OK

◆ gn_reset()

gn_err_t gn_reset ( )

reset the flash content and restart the board immediately

Returns
GN_RET_OK

◆ gn_send_leaf_param_change_message()

gn_err_t gn_send_leaf_param_change_message ( const char *  leaf_name,
const char *  param_name,
const void *  message,
size_t  message_len 
)

send a request to change a parameter name

It sends a GN_LEAF_PARAM_CHANGE_REQUEST_EVENT to the leaf parameter, if the parameter is modifiable

Parameters
leaf_namethe leaf name (null terminated) to send the request to
param_namethe parameter name to change (null terminated)
messagea pointer to the payload
message_lensize of the payload
Returns
GN_RET_ERR_LEAF_NOT_FOUND if the leaf is not found
GN_RET_ERR_INVALID_ARG in case of input parameter error
GN_RET_ERR_LEAF_PARAM_ACCESS_VIOLATION in case the parameter access is not write enable

◆ gn_send_node_leaf_param_status()

gn_err_t gn_send_node_leaf_param_status ( const gn_node_handle_t  _node_config)

send parameter status per each parameter

Parameters
_node_configthe config
Returns
GN_RET_OK upon success

◆ gn_storage_get()

gn_err_t gn_storage_get ( const char *  key,
void **  value 
)

retrieves the key from the NVS flash

internally, this is implemented by retrieving raw bytes to the flash storage

Parameters
keyname (null terminated)
valuepointer where the pointer of the data acquired will be stored
Returns
GN_RET_ERR_INVALID_ARG if input params are not valid
GN_RET_OK if key is stored successfully

◆ gn_storage_set()

gn_err_t gn_storage_set ( const char *  key,
const void *  value,
size_t  required_size 
)

stores the key into the NVS flash

internally, this is implemented by copying raw bytes to the flash storage

Parameters
keyname (null terminated)
valuepointer to data
required_sizebytes to write
Returns
GN_RET_ERR_INVALID_ARG if input params are not valid
GN_RET_OK if key is stored successfully