SmartREST client reference implementation for the u-blox C027 mbed compatible device.

Dependencies:   C027 C027_Support mbed mbed-rtos MbedSmartRest LM75B MMA7660 C12832

Fork of MbedSmartRestTest by Vincent Wochnik

Committer:
vwochnik
Date:
Thu Jul 03 18:52:04 2014 +0000
Revision:
35:ee1c6289e617
Parent:
32:56804dd00193
official cumulocity library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vwochnik 12:beb64aa0da86 1 #ifndef COMMON_H
vwochnik 12:beb64aa0da86 2 #define COMMON_H
vwochnik 12:beb64aa0da86 3
vwochnik 6:642e7c233e83 4 #include <stdint.h>
vwochnik 6:642e7c233e83 5 #include <stddef.h>
vwochnik 6:642e7c233e83 6 #include "mbed.h"
vwochnik 6:642e7c233e83 7 #include "C027.h"
vwochnik 6:642e7c233e83 8 #include "MbedSmartRest.h"
vwochnik 27:bfd402593acc 9 #include "rtos.h"
vwochnik 6:642e7c233e83 10
vwochnik 32:56804dd00193 11 #define CREDENTIALS_FILE "001_CREDENTIALS"
vwochnik 32:56804dd00193 12 #define CREDENTIALS_BUFFER 256
vwochnik 32:56804dd00193 13
vwochnik 17:877a9a3148a4 14 #define A0 P0_23
vwochnik 17:877a9a3148a4 15 #define A1 P0_24
vwochnik 17:877a9a3148a4 16 #define A2 P0_25
vwochnik 17:877a9a3148a4 17 #define A3 P0_26
vwochnik 17:877a9a3148a4 18 #define A4 P0_30
vwochnik 17:877a9a3148a4 19 #define A5 P1_31
vwochnik 17:877a9a3148a4 20
vwochnik 17:877a9a3148a4 21 #define D0 P4_29
vwochnik 17:877a9a3148a4 22 #define D1 P4_28
vwochnik 17:877a9a3148a4 23 #define D2 P2_13
vwochnik 17:877a9a3148a4 24 #define D3 P2_0
vwochnik 17:877a9a3148a4 25 #define D4 P2_12
vwochnik 17:877a9a3148a4 26 #define D5 P2_1
vwochnik 17:877a9a3148a4 27 #define D6 P2_2
vwochnik 17:877a9a3148a4 28 #define D7 P2_11
vwochnik 17:877a9a3148a4 29
vwochnik 17:877a9a3148a4 30 #define D8 P2_4
vwochnik 17:877a9a3148a4 31 #define D9 P2_3
vwochnik 17:877a9a3148a4 32 #define D10 P1_21
vwochnik 17:877a9a3148a4 33 #define D11 P1_24
vwochnik 17:877a9a3148a4 34 #define D12 P1_23
vwochnik 17:877a9a3148a4 35 #define D13 P1_20
vwochnik 17:877a9a3148a4 36
vwochnik 17:877a9a3148a4 37 #define SDA P0_0
vwochnik 17:877a9a3148a4 38 #define SCL P0_1
vwochnik 17:877a9a3148a4 39
vwochnik 17:877a9a3148a4 40
vwochnik 6:642e7c233e83 41 /** signal quality type */
vwochnik 6:642e7c233e83 42 typedef struct
vwochnik 6:642e7c233e83 43 {
vwochnik 6:642e7c233e83 44 int8_t rssi; // RSSI in dBm
vwochnik 6:642e7c233e83 45 uint8_t ber; // BER in %
vwochnik 6:642e7c233e83 46 } sigq_t;
vwochnik 6:642e7c233e83 47
vwochnik 32:56804dd00193 48 typedef struct
vwochnik 32:56804dd00193 49 {
vwochnik 32:56804dd00193 50 char username[128];
vwochnik 32:56804dd00193 51 char password[128];
vwochnik 32:56804dd00193 52 } credentials_t;
vwochnik 32:56804dd00193 53
vwochnik 6:642e7c233e83 54 extern C027 c027;
vwochnik 6:642e7c233e83 55 //extern UbloxUSBGSMModem modem;
vwochnik 6:642e7c233e83 56 extern MbedSmartRest client;
vwochnik 6:642e7c233e83 57
vwochnik 6:642e7c233e83 58 const char * imei();
vwochnik 23:0a48eebaaba8 59 const char * imsi();
vwochnik 6:642e7c233e83 60 const char * cellId();
vwochnik 7:f77afd49c35d 61 const char * iccid();
vwochnik 6:642e7c233e83 62 sigq_t * signalQuality();
vwochnik 32:56804dd00193 63 void credentials_set(credentials_t *dst, const char *tenant, const char *username, const char *password);
vwochnik 32:56804dd00193 64 bool credentials_read(credentials_t *dst);
vwochnik 32:56804dd00193 65 void credentials_write(credentials_t *src);
vwochnik 32:56804dd00193 66 void credentials_reset();
vwochnik 12:beb64aa0da86 67 int program(void);
vwochnik 12:beb64aa0da86 68
vwochnik 12:beb64aa0da86 69 #endif