nikita teggi / Mbed 2 deprecated merged_code2_3rd_nov_2017

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers struct.h Source File

struct.h

00001 #ifndef STRUCT_H_
00002 #define STRUCT_H_
00003 
00004 #include "bp.h"
00005 #include "glc.h"
00006 #include "ecg_dec.h"
00007 //#include "test_type.h"
00008 
00009 
00010 typedef struct __attribute__((__packed__))
00011 {
00012     uint8_t               date;
00013     uint8_t               month;
00014     uint8_t               year;
00015     uint8_t               hour;
00016     uint8_t               mins;
00017     uint8_t               sec;
00018 }DateTime_info;
00019 
00020 typedef struct __attribute__((__packed__))
00021 {
00022     uint16_t             num_sample_ppg_dummy;
00023     uint16_t             num_sample_ecg_OTtyp;
00024 }NumSamples_info;
00025 
00026 
00027 typedef struct __attribute__((__packed__))
00028 {
00029     uint16_t             cal_sbp_dummy;
00030     uint16_t             cal_dbp_OTtyp;
00031 }CalData_info;
00032 
00033 /*typedef enum 
00034 { 
00035      ACK = (uint8_t)0x00,
00036     start_of_file,
00037     end_of_file,
00038     data_trfr,
00039     NACK=0xff,
00040 }bt_st;*/
00041 
00042 typedef enum
00043 { 
00044     BP_Test =   (uint8_t )0x00,   // removed Semi Colon and replaced with comma
00045     BG_Test ,
00046     ECG_Test, 
00047 }test_type_info;
00048 
00049 
00050 typedef struct __attribute__((__packed__))
00051 {
00052   uint32_t               length;
00053   uint8_t                device_id;
00054   uint32_t              patient_id;
00055   DateTime_info         date_time;
00056   test_type_info        test_type;
00057   uint16_t               sampling_freq;
00058   NumSamples_info       num_samples;
00059   CalData_info          cal_data;
00060 }BLEMsg_info;
00061 
00062 /*typedef enum 
00063 { 
00064      sos= (uint8_t)0xc0,
00065      eos= (uint8_t)0xc0,
00066 }file_st;*/
00067 
00068 
00069 
00070 typedef struct __attribute__((__packed__))
00071 {
00072 
00073 uint8_t start_of_string;
00074  uint32_t length_file;
00075   uint8_t proto;
00076  BLEMsg_info  bt_msg;
00077  uint8_t end_of_string;
00078  uint8_t chk_sum;
00079 
00080 }Point;
00081 
00082 
00083 uint8_t bt_send( uint8_t send_tx);
00084 uint8_t bt_receive(uint8_t send_rx);
00085 void send_structure();
00086 void send_initial_string();
00087 void send_last_string();
00088 void send_data_str1();
00089 void send_data_str2(uint8_t check_sum);
00090 //uint8_t checksum(uint32_t  *v1);
00091 uint8_t checksum_init();;
00092 uint8_t checksum_last();
00093 //uint8_t checksum_struct();
00094 
00095 uint8_t checksum_struct(const uint8_t data[], uint16_t numBytes) ;
00096 uint8_t checksum_rawdata(const uint8_t data[], uint32_t numBytes) ;
00097 #endif