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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers common.h Source File

common.h

00001 #ifndef COMMON_H
00002 #define COMMON_H
00003 
00004 #include <stdint.h>
00005 #include <stddef.h>
00006 #include "mbed.h"
00007 #include "C027.h"
00008 #include "MbedSmartRest.h"
00009 #include "rtos.h"
00010 
00011 #define CREDENTIALS_FILE "001_CREDENTIALS"
00012 #define CREDENTIALS_BUFFER 256
00013 
00014 #define A0  P0_23
00015 #define A1  P0_24
00016 #define A2  P0_25
00017 #define A3  P0_26
00018 #define A4  P0_30
00019 #define A5  P1_31
00020 
00021 #define D0  P4_29
00022 #define D1  P4_28
00023 #define D2  P2_13
00024 #define D3  P2_0
00025 #define D4  P2_12
00026 #define D5  P2_1
00027 #define D6  P2_2
00028 #define D7  P2_11
00029 
00030 #define D8  P2_4
00031 #define D9  P2_3
00032 #define D10 P1_21
00033 #define D11 P1_24
00034 #define D12 P1_23
00035 #define D13 P1_20
00036     
00037 #define SDA P0_0
00038 #define SCL P0_1
00039 
00040 
00041 /** signal quality type */
00042 typedef struct
00043 {
00044     int8_t rssi;  // RSSI in dBm
00045     uint8_t ber; // BER in %
00046 } sigq_t;
00047 
00048 typedef struct
00049 {
00050     char username[128];
00051     char password[128];
00052 } credentials_t;
00053 
00054 extern C027 c027;
00055 //extern UbloxUSBGSMModem modem;
00056 extern MbedSmartRest client;
00057 
00058 const char * imei();
00059 const char * imsi();
00060 const char * cellId();
00061 const char * iccid();
00062 sigq_t * signalQuality();
00063 void credentials_set(credentials_t *dst, const char *tenant, const char *username, const char *password);
00064 bool credentials_read(credentials_t *dst);
00065 void credentials_write(credentials_t *src);
00066 void credentials_reset();
00067 int program(void);
00068 
00069 #endif