g2c  2.0.0.0
Functions
Public function

Functions

void g2c_cfg_setup (g2c_cfg_t *cfg)
 Config Object Initialization function. More...
 
G2C_RETVAL g2c_init (g2c_t *ctx, g2c_cfg_t *cfg)
 Initialization function. More...
 
void g2c_module_power (g2c_t *ctx, uint8_t power_state, uint8_t bootloader)
 Power module. More...
 
void g2c_reset (g2c_t *ctx)
 Reset module. More...
 
void g2c_generic_write (g2c_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t g2c_generic_read (g2c_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void g2c_send_command (g2c_t *ctx, char *command)
 Function for send command. More...
 
void g2c_send_operator_cfg (g2c_t *ctx, char *op_username, char *op_password)
 Operater ( Network ) configuration. More...
 
void g2c_send_broker_cfg (g2c_t *ctx, char *brc_key, char *brc_password)
 Broker configuration. More...
 
void g2c_send_data_ref (g2c_t *ctx, char *reference_buf, char *data_buf)
 Send data reference. More...
 
g2c_error_t g2c_actuator_sw_parser (char *rsp, char *act_ref, g2c_actuator_sw_t *sw_state)
 Switch parser function. More...
 
g2c_error_t g2c_actuator_cnt_parser (char *rsp, char *act_ref, g2c_actuator_cnt_t *num_data)
 Counter parser function. More...
 
g2c_error_t g2c_actuator_str_parser (char *rsp, char *act_ref, g2c_actuator_str_t *str_data)
 String parser function. More...
 

Detailed Description

Function Documentation

◆ g2c_actuator_cnt_parser()

g2c_error_t g2c_actuator_cnt_parser ( char *  rsp,
char *  act_ref,
g2c_actuator_cnt_t num_data 
)

Counter parser function.

Parameters
g2cClick object.
act_refActuator reference.
num_dataNumber of data.
Returns
error data

◆ g2c_actuator_str_parser()

g2c_error_t g2c_actuator_str_parser ( char *  rsp,
char *  act_ref,
g2c_actuator_str_t str_data 
)

String parser function.

Parameters
g2cClick object.
act_refActuator reference.
str_dataString to send.
Returns
error data

◆ g2c_actuator_sw_parser()

g2c_error_t g2c_actuator_sw_parser ( char *  rsp,
char *  act_ref,
g2c_actuator_sw_t sw_state 
)

Switch parser function.

Parameters
g2cClick object.
act_refActuator reference.
sw_stateSwitch state of pin.
Returns
error data

◆ g2c_cfg_setup()

void g2c_cfg_setup ( g2c_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ g2c_generic_read()

int32_t g2c_generic_read ( g2c_t ctx,
char *  data_buf,
uint16_t  max_len 
)

Generic read function.

Parameters
g2cClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ g2c_generic_write()

void g2c_generic_write ( g2c_t ctx,
char *  data_buf,
uint16_t  len 
)

Generic write function.

Parameters
g2cClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ g2c_init()

G2C_RETVAL g2c_init ( g2c_t ctx,
g2c_cfg_t cfg 
)

Initialization function.

Parameters
g2cClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ g2c_module_power()

void g2c_module_power ( g2c_t ctx,
uint8_t  power_state,
uint8_t  bootloader 
)

Power module.

Parameters
g2cClick object.
power_stateState of pin.
bootloaderBootloader ( 0 or 1 ).

◆ g2c_reset()

void g2c_reset ( g2c_t ctx)

Reset module.

Parameters
g2cClick object.

◆ g2c_send_broker_cfg()

void g2c_send_broker_cfg ( g2c_t ctx,
char *  brc_key,
char *  brc_password 
)

Broker configuration.

Parameters
g2cClick object.
brc_keyDevice key.
brc_passwordDevice password.

◆ g2c_send_command()

void g2c_send_command ( g2c_t ctx,
char *  command 
)

Function for send command.

Parameters
g2cClick object.
commandCommand to send.

◆ g2c_send_data_ref()

void g2c_send_data_ref ( g2c_t ctx,
char *  reference_buf,
char *  data_buf 
)

Send data reference.

Parameters
g2cClick object.
reference_bufReference.
data_buf

◆ g2c_send_operator_cfg()

void g2c_send_operator_cfg ( g2c_t ctx,
char *  op_username,
char *  op_password 
)

Operater ( Network ) configuration.

Parameters
g2cClick object.
op_usernameNetwork username.
op_passwordNetwork password.