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

Functions

int8_t TSMART_CARRIOTS_CELLULAR_2G_Init (void)
 Initializes cellular 2G interface. More...
 
int8_t TSMART_CARRIOTS_CELLULAR_2G_Start (tsmart_carriots_cellular_2g_config_t *TSMART_CARRIOTS_CELLULLAR_2G_config)
 Starts cellular 2g interface. More...
 
int8_t TSMART_CARRIOTS_CELLULAR_2G_Stop (void)
 Stops cellular 2G interface. More...
 
int8_t TSMART_CARRIOTS_CELLULAR_2G_NetworkAttachment (tsmart_carriots_cellular_2g_network_t *TSMART_CARRIOTS_CELLULAR_2G_network)
 Attaches to the 2G network. More...
 
int8_t TSMART_CARRIOTS_CELLULAR_2G_NetworkDeAtachment (void)
 Network detachment. More...
 
int8_t TSMART_CARRIOTS_WIFI_Init (void)
 Initializes WIFI interface. More...
 
int8_t TSMART_CARRIOTS_WIFI_Start (void)
 Starts the wifi interface. More...
 
void TSMART_CARRIOTS_WIFI_Stop (void)
 Stops the wifi interface. More...
 
uint8_t TSMART_CARRIOTS_WIFI_ConnectToAP (tsmart_carriots_wifi_wlan_t *TSMART_CARRIOTS_WIFI_wlan)
 Connects to an access point. More...
 
int8_t TSMART_CARRIOTS_WIFI_DisconnectfromAP (void)
 Disconnects from the access point. More...
 
int16_t TSMART_CARRIOTS_CreateDevice (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_device_t *TSMART_CARRIOTS_device, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Creates a device. More...
 
int16_t TSMART_CARRIOTS_UpdateDevice (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_device_t *TSMART_CARRIOTS_device, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Updates a device. More...
 
int16_t TSMART_CARRIOTS_DeleteDevice (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_device_name, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Deletes a device. More...
 
int16_t TSMART_CARRIOTS_CreateDataStream (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_data_t *TSMART_CARRIOTS_data, uint8_t TSMART_CARRIOTS_n, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Creates a data stream packet associated to a device in Carriots. More...
 
int16_t TSMART_CARRIOTS_CreateStatusStream (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_status_t *TSMART_CARRIOTS_status, uint8_t TSMART_CARRIOTS_n, uint8_t *TSMART_CARRIOTS_response, uint8_t TSMART_CARRIOTS_update_rtc, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Creates a status stream packet. More...
 
int16_t TSMART_CARRIOTS_ListLastDataStream (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_getdata_t *TSMART_CARRIOTS_getdata, uint8_t TSMART_CARRIOTS_n, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 List the last DataStream sent. More...
 
int16_t TSMART_CARRIOTS_CreateTrigger (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_trigger_name, tsmart_carriots_trigger_t *TSMART_CARRIOTS_trigger, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Creates a trigger. More...
 
int16_t TSMART_CARRIOTS_UpdateTrigger (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_trigger_name, tsmart_carriots_trigger_t *TSMART_CARRIOTS_trigger, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Updates a Trigger. More...
 
int16_t TSMART_CARRIOTS_DeleteTrigger (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_trigger_name, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Deletes a trigger. More...
 
int8_t TSMART_CARRIOTS_ReadIP (tsmart_carriots_ipv4_format_t *TSMART_CARRIOTS_ipv4_format)
 Reads the current IP address. More...
 
int8_t TSMART_CARRIOTS_StartServer (uint16_t TSMART_CARRIOTS_server_port)
 Starts a server. More...
 
int8_t TSMART_CARRIOTS_Notifications (tsmart_carriots_notification_t *TSMART_CARRIOTS_notification, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Waits for notifications. More...
 
int16_t TSMART_CARRIOTS_CreateAlarm (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_alarm_name, tsmart_carriots_alarm_t *TSMART_CARRIOTS_alarm, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Creates an alarm. More...
 
int16_t TSMART_CARRIOTS_UpdateAlarm (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_alarm_name, tsmart_carriots_alarm_t *TSMART_CARRIOTS_alarm, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Updates an alarm. More...
 
int16_t TSMART_CARRIOTS_DeleteAlarm (tsmart_carriots_account_t *TSMART_CARRIOTS_account, uint8_t *TSMART_CARRIOTS_alarm_name, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Deletes an alarm. More...
 
int32_t TSMART_CARRIOTS_DownloadFile (tsmart_carriots_account_t *TSMART_CARRIOTS_account, tsmart_carriots_file_t *TSMART_CARRIOTS_file, tsmart_carriots_buffer_t *TSMART_CARRIOTS_buffer)
 Donwloads a file from Carriots. More...
 

Detailed Description

Function Documentation

int8_t TSMART_CARRIOTS_CELLULAR_2G_Init ( void  )

Initializes cellular 2G interface.

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

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Not possible to get software resources (queues, mutext...).
Examples:
carriots_2g.c.
int8_t TSMART_CARRIOTS_CELLULAR_2G_NetworkAttachment ( tsmart_carriots_cellular_2g_network_t TSMART_CARRIOTS_CELLULAR_2G_network)

Attaches to the 2G network.

Parameters
TSMART_CARRIOTS_CELLULAR_2G_networkCellular 2g network structure
Returns
    @arg TSMART_PASS                 - OK
    @arg TSMART_CARRIOTS_FAULT_CODE1 - Bearer configuration failure
@arg TSMART_CARRIOTS_FAULT_CODE2 - Start bearer failure
    @arg TSMART_CARRIOTS_FAULT_CODE3 - 2g network registration failure
Examples:
carriots_2g.c.
int8_t TSMART_CARRIOTS_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:
carriots_2g.c.
int8_t TSMART_CARRIOTS_CELLULAR_2G_Start ( tsmart_carriots_cellular_2g_config_t TSMART_CARRIOTS_CELLULLAR_2G_config)

Starts cellular 2g interface.

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

Parameters
TSMART_CARRIOTS_CELLULLAR_2G_configCelullar 2G configuration structure
Returns
  • TSMART_PASS - OK
  • TSMART_CARRIOTS_FAULT_CODE1 - Turn on failure.
  • TSMART_CARRIOTS_FAULT_CODE2 - Configuration failure.
  • TSMART_CARRIOTS_FAULT_CODE3 - Start TCP/IP stack failure.
  • TSMART_CARRIOTS_FAULT_CODE4 - TCP/IP statck configuration failure.
Examples:
carriots_2g.c.
int8_t TSMART_CARRIOTS_CELLULAR_2G_Stop ( void  )

Stops cellular 2G interface.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - It's not possible to stop.
Examples:
carriots_2g.c.
int16_t TSMART_CARRIOTS_CreateAlarm ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_alarm_name,
tsmart_carriots_alarm_t TSMART_CARRIOTS_alarm,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Creates an alarm.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_alarm_nameAlarm name to be created.
TSMART_CARRIOTS_alarmAlarm parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
Examples:
carriots_2g.c, and carriots_wifi.c.
int16_t TSMART_CARRIOTS_CreateDataStream ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_data_t TSMART_CARRIOTS_data,
uint8_t  TSMART_CARRIOTS_n,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Creates a data stream packet associated to a device in Carriots.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_dataData structure.
TSMART_CARRIOTS_nNumber of data to send.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 401 - Error message
  • 404 - Resource not found
  • 503 - Service unavailble
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
Examples:
carriots_2g.c, and carriots_wifi.c.
int16_t TSMART_CARRIOTS_CreateDevice ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_device_t TSMART_CARRIOTS_device,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Creates a device.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_deviceDevice parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 201 - Device created
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
Examples:
carriots_2g.c, and carriots_wifi.c.
int16_t TSMART_CARRIOTS_CreateStatusStream ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_status_t TSMART_CARRIOTS_status,
uint8_t  TSMART_CARRIOTS_n,
uint8_t *  TSMART_CARRIOTS_response,
uint8_t  TSMART_CARRIOTS_update_rtc,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Creates a status stream packet.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_statusStatus structure.
TSMART_CARRIOTS_nNumber of status to send.
TSMART_CARRIOTS_responseCarriots response. When a identifier matches a device's file name, Carriots will compare its version and will return a 0 if version match (0 means no update needed) or 1 if version does not match, which means that for that file versions are different. If a identifier doesn't correspond to a device's file, nothing will be returned (0 nor 1). All data is stored in Carriots DB and is accessible from listeners.
TSMART_CARRIOTS_update_rtcUses the status stream to get and Update the current date(1- Update, 0- Nothing to do). Users shall be initiliaze the RTC device.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 401 - Error message
  • 404 - Resource not found
  • 503 - Service unavailble
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Answer incomplete
  • TSMART_CARRIOTS_FAULT_CODE6 - Invalid answer from Carriots middleware
int16_t TSMART_CARRIOTS_CreateTrigger ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_trigger_name,
tsmart_carriots_trigger_t TSMART_CARRIOTS_trigger,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Creates a trigger.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_trigger_nameTrigger name.
TSMART_CARRIOTS_triggerTrigger parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 201 - Trigger created
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
Examples:
carriots_2g.c, and carriots_wifi.c.
int16_t TSMART_CARRIOTS_DeleteAlarm ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_alarm_name,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Deletes an alarm.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_alarm_nameAlarm name.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 404 - Resource not found
  • 503 - Service unavailble
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int16_t TSMART_CARRIOTS_DeleteDevice ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_device_name,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Deletes a device.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_device_nameDevice name.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int16_t TSMART_CARRIOTS_DeleteTrigger ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_trigger_name,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Deletes a trigger.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_trigger_nameTrigger name.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int32_t TSMART_CARRIOTS_DownloadFile ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_file_t TSMART_CARRIOTS_file,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Donwloads a file from Carriots.

This function downloads a file content in STM32 RAM or STM32 FLASH memory.

Note
This function is only available for cellular 2g interface
Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_fileFile structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • Number of bytes received - File received OK
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Flash memory failure.
int16_t TSMART_CARRIOTS_ListLastDataStream ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_getdata_t TSMART_CARRIOTS_getdata,
uint8_t  TSMART_CARRIOTS_n,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

List the last DataStream sent.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_getdataGet data structure.
TSMART_CARRIOTS_nNumber of data to get.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 400 - Request not valid
  • 503 - Service unavailble
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int8_t TSMART_CARRIOTS_Notifications ( tsmart_carriots_notification_t TSMART_CARRIOTS_notification,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Waits for notifications.

This function is blocked permanently until a notification happends. The available notifications can change depending on the interface in use. The common notification will be the trigger notification (available for all interfaces).

  • Cellular interface:
    • - Trigger notification: a trigger message(only POST method supported) is received
    • - 2G notification: code to take action about the interface, re-attach or reset can be requiered.
  • Wifi interface:
    • - Trigger notification: a trigger message(only POST method supported) is received
Parameters
TSMART_CARRIOTS_bufferCarriots buffer.
TSMART_CARRIOTS_notificationNotification structure.
Returns
  • TSMART_PASS - OK
Examples:
carriots_2g.c, and carriots_wifi.c.
int8_t TSMART_CARRIOTS_ReadIP ( tsmart_carriots_ipv4_format_t TSMART_CARRIOTS_ipv4_format)

Reads the current IP address.

Parameters
TSMART_CARRIOTS_ipv4_formatipv4 strucuture (output parameter).
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Read IP failure.
Examples:
carriots_2g.c, and carriots_wifi.c.
int8_t TSMART_CARRIOTS_StartServer ( uint16_t  TSMART_CARRIOTS_server_port)

Starts a server.

This function starts a server to receive notifications. Uses TSMART_CARRIOTS_Notifications() to get the information about the commands received.

Parameters
TSMART_CARRIOTS_server_portLocal server port
Returns
  • TSMART_PASS - OK
  • TSMART_CARRIOTS_FAULT_CODE1 - Server initialization failure for the cellular 2g interface or impossible get a socket for the ethernet/wifi interface.
  • TSMART_CARRIOTS_FAULT_CODE2 - Bind socket failure (only for wifi interface).
  • TSMART_CARRIOTS_FAULT_CODE3 - Listen socket failure (only for wifi interface).
Examples:
carriots_2g.c, and carriots_wifi.c.
int16_t TSMART_CARRIOTS_UpdateAlarm ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_alarm_name,
tsmart_carriots_alarm_t TSMART_CARRIOTS_alarm,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Updates an alarm.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_alarm_nameAlarm name to be Update.
TSMART_CARRIOTS_alarmAlarm parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int16_t TSMART_CARRIOTS_UpdateDevice ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
tsmart_carriots_device_t TSMART_CARRIOTS_device,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Updates a device.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_deviceDevice parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
int16_t TSMART_CARRIOTS_UpdateTrigger ( tsmart_carriots_account_t TSMART_CARRIOTS_account,
uint8_t *  TSMART_CARRIOTS_trigger_name,
tsmart_carriots_trigger_t TSMART_CARRIOTS_trigger,
tsmart_carriots_buffer_t TSMART_CARRIOTS_buffer 
)

Updates a Trigger.

Parameters
TSMART_CARRIOTS_accountAccount parameters structure.
TSMART_CARRIOTS_trigger_nameTrigger name.
TSMART_CARRIOTS_triggerTrigger parameters structure.
TSMART_CARRIOTS_bufferCarriots buffer.
Returns
  • 200 - OK
  • 400 - Request not valid
  • 404 - Resource not found
  • 503 - Service unavailable
  • TSMART_CARRIOTS_FAULT_CODE1 - Connection failure
  • TSMART_CARRIOTS_FAULT_CODE2 - Sending failure
  • TSMART_CARRIOTS_FAULT_CODE3 - Closing connection failure
  • TSMART_CARRIOTS_FAULT_CODE4 - Receiving failure
  • TSMART_CARRIOTS_FAULT_CODE5 - Invalid answer from Carriots middleware
Examples:
carriots_2g.c.
uint8_t TSMART_CARRIOTS_WIFI_ConnectToAP ( tsmart_carriots_wifi_wlan_t TSMART_CARRIOTS_WIFI_wlan)

Connects to an access point.

Parameters
TSMART_CARRIOTS_WIFI_wlanWireless network parameters estructure
Returns
  • TSMART_PASS - OK
  • TSMART_CARRIOTS_FAULT_CODE1 - Set IP failure.
  • TSMART_CARRIOTS_FAULT_CODE2 - Connection failure.
Examples:
carriots_wifi.c.
int8_t TSMART_CARRIOTS_WIFI_DisconnectfromAP ( void  )

Disconnects from the access point.

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

Initializes WIFI interface.

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

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

Starts the wifi interface.

Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Event mask failure.
Examples:
carriots_wifi.c.
void TSMART_CARRIOTS_WIFI_Stop ( void  )

Stops the wifi interface.

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

Examples:
carriots_wifi.c.