C SIGFOX CALLBACK  0.0.1
A Sigfox Callback program writtent in C
Macros
sqls.h File Reference

SQL commands to create, select and drop the tables. More...

Go to the source code of this file.

Macros

#define SQL_COL_ID_RAWS   "id_raws"
 ID raws column name.
 
#define SQL_COL_TIMESTAMP   "timestamp"
 Timestamp column name.
 
#define SQL_COL_ID_MODEM   "id_modem"
 ID modem column name.
 
#define SQL_COL_SNR   "snr"
 Signal column name.
 
#define SQL_COL_STATION   "station"
 Station column name.
 
#define SQL_COL_ACK   "ack"
 Acknowledge column name.
 
#define SQL_COL_DATA_STR   "data_str"
 Data string column name.
 
#define SQL_COL_DATA_HEX   "data_hex"
 Hexadecimal data column name.
 
#define SQL_COL_DUPLICATE   "duplicate"
 Duplicate column name.
 
#define SQL_COL_AVG_SIGNAL   "avg_signal"
 Average signal column name.
 
#define SQL_COL_RSSI   "rssi"
 RSSI column name.
 
#define SQL_COL_LATITUDE   "latitude"
 Latitude column name.
 
#define SQL_COL_LONGITUDE   "longitude"
 Longitude column name.
 
#define SQL_COL_SEQ_NUMBER   "seq_number"
 Sequence number column name.
 
#define SQL_COL_LONG_POLLING   "long_polling"
 Long pollling.
 
#define SQL_COL_ATTRIBUTION   "attribution"
 Attribution column name.
 
#define SQL_COL_TIMESTAMP_ATTRIBUTION   "timestamp_attribution"
 Timestamp attribution column name.
 
#define SQL_IDX_ID_RAWS   0
 ID raws column index.
 
#define SQL_IDX_TIMESTAMP   1
 Timestamp column index.
 
#define SQL_IDX_ID_MODEM   2
 ID modem column index.
 
#define SQL_IDX_SNR   3
 Signal column index.
 
#define SQL_IDX_STATION   4
 Station column index.
 
#define SQL_IDX_ACK   5
 Acknowledge column index.
 
#define SQL_IDX_DATA_STR   6
 Data string column index.
 
#define SQL_IDX_DATA_HEX   7
 Hexadecimal data column index.
 
#define SQL_IDX_DUPLICATE   8
 Duplicate column index.
 
#define SQL_IDX_AVG_SIGNAL   9
 Average signal column index.
 
#define SQL_IDX_RSSI   10
 RSSI column index.
 
#define SQL_IDX_LATITUDE   11
 Latitude column index.
 
#define SQL_IDX_LONGITUDE   12
 Longitude column index.
 
#define SQL_IDX_SEQ_NUMBER   13
 Sequence number column index.
 
#define CREATE_SIGFOX_TABLES
 SQL command to create the 'raws' and 'devices' tables in the database.
 
#define DROP_SIGFOX_TABLES
 SQL command to drop 'raws' and 'devices' tables. More...
 
#define SELECT_RAWS
 SQL command to select all the colums in the 'raws' table. More...
 
#define SELECT_DEVICES   "SELECT * FROM `devices`;"
 SQL command to select all the colums in the 'devices' table.
 
#define DELETE_RAWS   "DELETE FROM raws;"
 SQL command to delete every record from the table raws.
 
#define INSERT_DEVICES   "INSERT INTO `devices` VALUES (?, ?, ?);"
 SQL command to insert data from a sigfox_device_t to the database.
 
#define INSERT_RAWS   "INSERT INTO `raws` VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"
 SQL command to insert data from a sigfox_raws_t to the database.
 

Detailed Description

SQL commands to create, select and drop the tables.

Author
hbuyse
Date
24/06/2016

Macro Definition Documentation

#define DROP_SIGFOX_TABLES
Value:
"-- DELETION OF THE SIGFOX TABLES\n" \
"\n" \
"-- Delete the tables if they exists\n" \
"DROP TABLE IF EXISTS `raws`;\n" \
"DROP TABLE IF EXISTS `devices`;"

SQL command to drop 'raws' and 'devices' tables.

#define SELECT_RAWS
Value:
"SELECT timestamp, id_modem, snr, station, ack, data_str, data_hex, duplicate, avg_signal," \
"rssi, latitude, longitude, seq_number FROM `raws`"

SQL command to select all the colums in the 'raws' table.