An embedded server sending sensor information over the network to a remote client side process parsing the data

Dependencies:   EthernetInterface NTPClient TimeInterface WebSocketClient mbed-rtos mbed ST_Events-old

data_logger.h

Committer:
thedude35
Date:
2017-07-21
Revision:
2:5c9125d3ddae
Child:
3:221997836268

File content as of revision 2:5c9125d3ddae:

#include "mbed.h"
#include "EthernetInterface.h"
#include "NTPClient.h"
#include "TimeInterface.h"
#include "rtos.h"
#include "Timer.h"
#include "mbed_events.h"
#define SERVER_PORT 7
#define RATE 10000

int data = 711;                  //Example test data to be sent across the network
int i = 0;
char appbuffer[105];              //Application buffer
int len = 105;                    //Length of the buffer
float cycle_time;
int p_press = 0;
int id_press = 0;

//int samples[];

void cycle_time_isr_rise(void);
//ISR on the rising edge of the digital input starting the cycle timer and stopping the periodic reporting thread

void cycle_time_isr_fall(void);
//ISR on the falling edge of the digital input stopping the cycle timer and restarting the periodic reporting thread

void pressure_report(void);
//sends the XML markup payload with idle hydraulic line pressure data at a prescribed rate