Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
Loading...
Searching...
No Matches
devices.h File Reference
#include <string.h>
#include <math.h>
#include <curl/curl.h>
#include <cjson/cJSON.h>
#include <log.h>
#include "Ubidots/authenticate.h"
#include "http.h"
#include "utils.h"
Include dependency graph for devices.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ubidots_Devices_TypeDef
 TODO turn this into a single device then have a list of devices struct. More...
 

Macros

#define UBIDOTS_MAX_NUMBER_DEVICES   300
 Maximum number of devices in buffer. More...
 
#define UBIDOTS_MAX_INFO_LENGTH   100
 Maximum name length for devices. More...
 

Functions

CURLcode Ubidots_ListDevices (Ubidots_Devices_TypeDef *devices)
 List all ubidots devices. More...
 
int8_t Ubidots_DevicesToCSV (Ubidots_Devices_TypeDef *devices)
 Write devices to csv file for caching. More...
 

Macro Definition Documentation

◆ UBIDOTS_MAX_INFO_LENGTH

#define UBIDOTS_MAX_INFO_LENGTH   100

Maximum name length for devices.

◆ UBIDOTS_MAX_NUMBER_DEVICES

#define UBIDOTS_MAX_NUMBER_DEVICES   300

Maximum number of devices in buffer.

Function Documentation

◆ Ubidots_DevicesToCSV()

int8_t Ubidots_DevicesToCSV ( Ubidots_Devices_TypeDef devices)

Write devices to csv file for caching.

Writes out device list from ubidots to a .csv file.

Device list containing names, ids and coordinates (if available) are written to a .csv file. The devices count is used to terminate this loop. Errors (1) are returned if directories cannot be created.

Parameters
devicesDevices struct to write to file.
Returns
Error codes. 0 = OK ... 1 = ERROR

◆ Ubidots_ListDevices()

CURLcode Ubidots_ListDevices ( Ubidots_Devices_TypeDef devices)

List all ubidots devices.

Method to get a list of all devices on Ubidots.

Page size should be set high enough to get all devices (default 500).

CURLcode Ubidots_ListDevices(Ubidots_Devices_TypeDef *devices)
List all ubidots devices.
Definition: devices.c:19
TODO turn this into a single device then have a list of devices struct.
Definition: devices.h:21
See also
https://docs.ubidots.com/reference/get-all-devices @info Device names need to be less than 100 characters.
Parameters
devicesUbidots devices struct to populate.
Returns
Status code respresenting response status.