API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

int8_t TSMART_CUMULOCITY_CELLULAR_2G_Init (void)
 Initializes cellular 2G interface. More...
 
int8_t TSMART_CUMULOCITY_CELLULAR_2G_Start (tsmart_cumulocity_cellular_2g_config_t *TSMART_CUMULOCITY_CELLULLAR_2G_config)
 Starts cellular 2g interface. More...
 
int8_t TSMART_CUMULOCITY_CELLULAR_2G_Stop (void)
 Stops cellular 2G interface. More...
 
int8_t TSMART_CUMULOCITY_CELLULAR_2G_NetworkAttachment (tsmart_cumulocity_cellular_2g_network_t *TSMART_CUMULOCITY_CELLULAR_2G_network)
 Attaches to the 2G network. More...
 
int8_t TSMART_CUMULOCITY_CELLULAR_2G_NetworkDeAtachment (void)
 Network detachment. More...
 
tsmart_cumulocity_cellular_2g_notif_t TSMART_CUMULOCITY_CELLULAR_2G_Notifications (void)
 Waits for 2G notification. More...
 
int8_t TSMART_CUMULOCITY_WIFI_Init (void)
 Initializes WIFI interface. More...
 
int8_t TSMART_CUMULOCITY_WIFI_Start (void)
 Starts the wifi interface. More...
 
void TSMART_CUMULOCITY_WIFI_Stop (void)
 Stops the wifi interface. More...
 
int8_t TSMART_CUMULOCITY_WIFI_ConnectToAP (tsmart_cumulocity_wifi_wlan_t *TSMART_CUMULOCITY_WIFI_wlan)
 Connects to an access point. More...
 
int8_t TSMART_CUMULOCITY_WIFI_DisconnectfromAP (void)
 Disconnects form the access point. More...
 
int8_t TSMART_CUMULOCITY_ReadIP (tsmart_cumulocity_ipv4_format_t *TSMART_CUMULOCITY_ipv4_format)
 Reads the current IP address. More...
 
void TSMART_CUMULOCITY_Base64Encoder (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer, uint8_t *TSMART_CUMULOCITY_output)
 Base64 encoder. More...
 
int8_t TSMART_CUMULOCITY_RegiserDevice (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, tsmart_cumulocity_device_t *TSMART_CUMULOCITY_device, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Registers a device. More...
 
int8_t TSMART_CUMULOCITY_RegisterMesurment (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_sensor_t *TSMART_CUMULOCITY_sensor, uint8_t TSMART_CUMULOCITY_n_sensors, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Registers measurements. More...
 
int8_t TSMART_CUMULOCITY_RegisterOperation (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_op_t *TSMART_CUMULOCITY_op, uint8_t TSMART_CUMULOCITY_n_ops, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Registers an operation. More...
 
int8_t TSMART_CUMULOCITY_UnregisterDevice (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Unregisters a device. More...
 
int8_t TSMART_CUMULOCITY_SendMeasurement (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, uint8_t *TSMART_CUMULOCITY_type, tsmart_cumulocity_sensor_t *TSMART_CUMULOCITY_sensor, uint8_t TSMART_CUMULOCITY_n_sensor, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Sends measurement. More...
 
int8_t TSMART_CUMULOCITY_RiseAlarm (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_alarm_t *TSMART_CUMULOCITY_alarm, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Rises an Alarm. More...
 
int8_t TSMART_CUMULOCITY_UpdateAlarm (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_alarm_t *TSMART_CUMULOCITY_alarm, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Updates an Alarm. More...
 
int8_t TSMART_CUMULOCITY_CreateEvent (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_event_t *TSMART_CUMULOCITY_event, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Creates an event. More...
 
int8_t TSMART_CUMULOCITY_DeleteEvent (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_event_id, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Deletes an event. More...
 
int8_t TSMART_CUMULOCITY_CreateOperation (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulocity_op_t *TSMART_CUMULOCITY_op, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Creates an operation. More...
 
int8_t TSMART_CUMULOCITY_GetOperation (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulotity_status_op_t TSMART_CUMULOCITY_status_op, uint8_t TSMART_CUMULOCY_n_ops, tsmart_cumulocity_op_t *TSMART_CUMULOCITY_op, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Gets the last operation available. More...
 
int8_t TSMART_CUMULOCITY_GetRawOperation (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_device_id, tsmart_cumulotity_status_op_t TSMART_CUMULOCITY_status_op, uint32_t *TSMART_CUMULOCITY_op_id, uint8_t *TSMART_CUMULOCITY_op_raw_buffer, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Gets the last operation available. More...
 
int8_t TSMART_CUMULOCITY_UpdateStatusOperation (tsmart_cumulocity_account_t *TSMART_CUMULOCITY_account, uint32_t TSMART_CUMULOCITY_op_id, tsmart_cumulotity_status_op_t TSMART_CUMULOCITY_status_op, uint8_t *TSMART_CUMULOCITY_failure_message, tsmart_cumulocity_buffer_t *TSMART_CUMULOCITY_buffer)
 Updates a status operation. More...
 

Detailed Description

Function Documentation

void TSMART_CUMULOCITY_Base64Encoder ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer,
uint8_t *  TSMART_CUMULOCITY_output 
)

Base64 encoder.

This function encoders a string using a base64 method.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_bufferCumulocity buffer.
TSMART_CUMULOCITY_output64Base string(output parameter).
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_CELLULAR_2G_Init ( void  )

Initializes cellular 2G interface.

Initializes the hardware configuration of the cellular 2g module and the associated OS mechanisms.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Not possible to get software resources (queues, mutext and so on).
Examples:
cumulocity_2g.c.
int8_t TSMART_CUMULOCITY_CELLULAR_2G_NetworkAttachment ( tsmart_cumulocity_cellular_2g_network_t TSMART_CUMULOCITY_CELLULAR_2G_network)

Attaches to the 2G network.

Parameters
TSMART_CUMULOCITY_CELLULAR_2G_networkCellular 2g network structure
Returns
  • TSMART_PASS - OK
  • TSMART_CUMULOCITY_FAULT_CODE1 - Bearer configuration failure
  • TSMART_CUMULOCITY_FAULT_CODE2 - Start bearer failure
  • TSMART_CUMULOCITY_FAULT_CODE3 - 2g network registration failure
Examples:
cumulocity_2g.c.
int8_t TSMART_CUMULOCITY_CELLULAR_2G_NetworkDeAtachment ( void  )

Network detachment.

This function disconnects the cellular 2g form the 2G network.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Stop bearer failure, it was impossible to do a network detachment.
Examples:
cumulocity_2g.c.
tsmart_cumulocity_cellular_2g_notif_t TSMART_CUMULOCITY_CELLULAR_2G_Notifications ( void  )

Waits for 2G notification.

This functions is waiting for 2G network fails notifications. It returns the following values:

  • TSMART_CUMULOCITY_CELLULAR_2G_NETWORK_FAILURE - GPRS network failure, it's necessary to attach to the GPRS network again (uses the TSMART_CUMULOCITY_CELLULAR_2G_NetworkAttachment() function). The IP address will change.

  • TSMART_CUMULOCITY_CELLULAR_2G_STOP - An exception has happend, it's necessary to do a reset of the cellular 2G interface.
Returns
  • TSMART_CUMULOCITY_CELLULAR_2G_NETWORK_FAILURE - Network failure.
  • TSMART_CUMULOCITY_CELLULAR_2G_STOP - Stop interface.
Examples:
cumulocity_2g.c.
int8_t TSMART_CUMULOCITY_CELLULAR_2G_Start ( tsmart_cumulocity_cellular_2g_config_t TSMART_CUMULOCITY_CELLULLAR_2G_config)

Starts cellular 2g interface.

This function starts the cellular 2g interface for CUMULOCITY middleware. It turns on and sets the cellular 2g device.

Parameters
TSMART_CUMULOCITY_CELLULLAR_2G_configCelullar 2G configuration structure
Returns
  • TSMART_PASS - OK
  • TSMART_CUMULOCITY_FAULT_CODE1 - Turn on failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Configuration failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Start TCP/IP stack failure.
  • TSMART_CUMULOCITY_FAULT_CODE4 - TCP/IP statck configuration failure.
Examples:
cumulocity_2g.c.
int8_t TSMART_CUMULOCITY_CELLULAR_2G_Stop ( void  )

Stops cellular 2G interface.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - It's not possible to stop.
Examples:
cumulocity_2g.c.
int8_t TSMART_CUMULOCITY_CreateEvent ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_event_t TSMART_CUMULOCITY_event,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Creates an event.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_eventEvent structure.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Event created.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_CreateOperation ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_op_t TSMART_CUMULOCITY_op,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Creates an operation.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_opOperation strucuture.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Operation created.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_DeleteEvent ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_event_id,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Deletes an event.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_event_idDevice identifier.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Event deleted.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
int8_t TSMART_CUMULOCITY_GetOperation ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulotity_status_op_t  TSMART_CUMULOCITY_status_op,
uint8_t  TSMART_CUMULOCY_n_ops,
tsmart_cumulocity_op_t TSMART_CUMULOCITY_op,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Gets the last operation available.

This function is only be able to get commands that are created in cumulocity with the following pattern:

"<Model_operation_name>": { "param_1": 45, "param_2": "hello world!" ... ... "param_n": 6 }

Working with TSmarT platforms you only need to fill the tsmart_cumulocity_op_t structure when you create your operations.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_status_opSelected status operation.
TSMART_CUMULOCY_n_opsNumber of operation to be checked.
TSMART_CUMULOCITY_opOperation structure.
TSMART_CUMULOCITY_bufferCumulocity buffer
Returns
  • Index matching operation.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_GetRawOperation ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulotity_status_op_t  TSMART_CUMULOCITY_status_op,
uint32_t *  TSMART_CUMULOCITY_op_id,
uint8_t *  TSMART_CUMULOCITY_op_raw_buffer,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Gets the last operation available.

This function gets the last operation available matched with the selected status. The fragment of the operation will be saved in the TSMART_CUMULOCITY_op_raw_buffer avoiding the limitation of the kind of fragment that TSMART_CUMULOCITY_GetOperation() have. The user will have to parse the message to get the different values of the fragment and it will be necessary to know the structure of the fragment received.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_status_opSelected status operation.
TSMART_CUMULOCITY_op_idOperation identifier(output parameter).
TSMART_CUMULOCITY_op_raw_bufferRaw operation buffer(output paramter).
TSMART_CUMULOCITY_bufferCumulocity buffer
Returns
  • TSMART_PASS - Operation gotten.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_ReadIP ( tsmart_cumulocity_ipv4_format_t TSMART_CUMULOCITY_ipv4_format)

Reads the current IP address.

Parameters
TSMART_CUMULOCITY_ipv4_formatipv4 strucuture (output parameter).
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Read IP failure.
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_RegiserDevice ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
tsmart_cumulocity_device_t TSMART_CUMULOCITY_device,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Registers a device.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_deviceDevice parameters structure. The ID field will be set(ouput paramters).
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Device registered.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_RegisterMesurment ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_sensor_t TSMART_CUMULOCITY_sensor,
uint8_t  TSMART_CUMULOCITY_n_sensors,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Registers measurements.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_sensorSensor structure.
TSMART_CUMULOCITY_n_sensorsNumber of sensors to be registered.
TSMART_CUMULOCITY_bufferCumulocity registered
Returns
  • TSMART_PASS - Sensors registered.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE4 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_RegisterOperation ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_op_t TSMART_CUMULOCITY_op,
uint8_t  TSMART_CUMULOCITY_n_ops,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Registers an operation.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_opOperation structure.
TSMART_CUMULOCITY_n_opsNumber of operations to be registered.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Operation registered.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE4 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_RiseAlarm ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_alarm_t TSMART_CUMULOCITY_alarm,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Rises an Alarm.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_alarmAlarm structure.
TSMART_CUMULOCITY_bufferCumuloctity buffer.
Returns
  • TSMART_PASS - Alarm rised.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_SendMeasurement ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
uint8_t *  TSMART_CUMULOCITY_type,
tsmart_cumulocity_sensor_t TSMART_CUMULOCITY_sensor,
uint8_t  TSMART_CUMULOCITY_n_sensor,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Sends measurement.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_typeType measures.
TSMART_CUMULOCITY_sensorSensor structure.
TSMART_CUMULOCITY_n_sensorNumber of sensors to send.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Mesurement sent.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_UnregisterDevice ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Unregisters a device.

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Device unregistered.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_UpdateAlarm ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_device_id,
tsmart_cumulocity_alarm_t TSMART_CUMULOCITY_alarm,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Updates an Alarm.

This function updates an alarm previously created. It can only be updated the following fields:

  • text
  • status
  • severity
  • source
Note
The time and the type field can't be updated.
Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_device_idDevice identifier.
TSMART_CUMULOCITY_alarmAlarm structure.
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Alarm updated.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_UpdateStatusOperation ( tsmart_cumulocity_account_t TSMART_CUMULOCITY_account,
uint32_t  TSMART_CUMULOCITY_op_id,
tsmart_cumulotity_status_op_t  TSMART_CUMULOCITY_status_op,
uint8_t *  TSMART_CUMULOCITY_failure_message,
tsmart_cumulocity_buffer_t TSMART_CUMULOCITY_buffer 
)

Updates a status operation.

When the operation execution fails, it's possible to add a failure message. But only when the status is set to "TSMART_CUMULOCTITY_FAILED".

Parameters
TSMART_CUMULOCITY_accountAccount structure.
TSMART_CUMULOCITY_op_idOperation identifier.
TSMART_CUMULOCITY_status_opOperation status.
TSMART_CUMULOCITY_failure_messageFailure message, only available for TSMART_CUMULOCTITY_FAILED status. In other case set to NULL
TSMART_CUMULOCITY_bufferCumulocity buffer.
Returns
  • TSMART_PASS - Operation status updated.
  • TSMART_CUMULOCITY_FAULT_CODE1 - Cumulocity connection failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Sending failure.
  • TSMART_CUMULOCITY_FAULT_CODE3 - Closing client failure.
  • TSMART_CUMULOCITY_FAULT_CODE5 - Parsing failure (wrong or there wasn't anwser).
Examples:
cumulocity_2g.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_WIFI_ConnectToAP ( tsmart_cumulocity_wifi_wlan_t TSMART_CUMULOCITY_WIFI_wlan)

Connects to an access point.

Parameters
TSMART_CUMULOCITY_WIFI_wlanWLAN parameters estructure
Returns
  • TSMART_PASS - OK
  • TSMART_CUMULOCITY_FAULT_CODE1 - Set IP failure.
  • TSMART_CUMULOCITY_FAULT_CODE2 - Connection failure.
Examples:
cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_WIFI_DisconnectfromAP ( void  )

Disconnects form the access point.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Disconnection failure.
int8_t TSMART_CUMULOCITY_WIFI_Init ( void  )

Initializes WIFI interface.

Initializes the hardware configuration of the WIFI module and the associated OS mechanisms.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Not possible to get software resources (queues, mutext and so on).
Examples:
cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
int8_t TSMART_CUMULOCITY_WIFI_Start ( void  )

Starts the wifi interface.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Event mask failure.
Examples:
cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.
void TSMART_CUMULOCITY_WIFI_Stop ( void  )

Stops the wifi interface.

The wifi interface will be set to default values. And it will be turned off.

Examples:
cumulocity_nfc_wifi_xbee.c, and cumulocity_wifi.c.