Jurica Resetar / Mbed OS aconnoBLETemplate
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BLEData.h Source File

BLEData.h

00001 /*
00002  * Made by Jurica @ aconno
00003  * All rights reserved
00004  *
00005  */
00006 
00007 #ifndef BLE_DATA_H
00008 #define BLE_DATA_H
00009 
00010 typedef struct __attribute__((packed, aligned(1))) _timestamp
00011 {
00012     uint64_t time : 48;
00013 } timestampFormat;
00014 
00015 typedef struct __attribute__((packed, aligned(1))) _headerFormat
00016 {
00017     uint16_t ID;
00018 } headerFormat;
00019 
00020 typedef struct __attribute__((packed, aligned(1))) _diagnoseFlagsFormat
00021 {
00022     uint8_t powerSupplyConnected : 1;
00023     uint8_t valveSwitchedOn : 1;
00024     uint8_t valveSwitchedOff : 1;
00025     uint8_t shortCircuitDetected : 1;
00026     uint8_t warningLife : 1;
00027     uint8_t failureLife : 1;
00028     uint8_t internSupplyVoltageLow : 1;
00029 } diagnoseFlagsFormat;
00030 
00031 typedef struct __attribute__((packed, aligned(1))) _systemState
00032 {
00033     unsigned int switchCounter;
00034     uint8_t operatingHours[3];
00035     int8_t electronicsTemp;
00036     int16_t coilTemp;
00037     __attribute__((packed)) int8_t powerSuppyVoltage;
00038     __attribute__((packed)) int8_t internPowerSupplyVoltage;
00039     __attribute__((packed)) int16_t lifeTime;
00040     __attribute__((packed)) uint16_t coilResistance;
00041     __attribute__((packed)) uint8_t magnetoCurrent;
00042 } systemStateFormat;
00043 
00044 typedef struct __attribute__((packed, aligned(1))) _advertisingFormat{
00045     __attribute__((packed, aligned(1))) headerFormat header;
00046     __attribute__((packed, aligned(1))) diagnoseFlagsFormat diagnoseFlags;
00047     __attribute__((packed, aligned(1))) timestampFormat timestamp;
00048     __attribute__((packed, aligned(1))) systemStateFormat systemState;
00049 } advertisingFormat;
00050 
00051 #endif // BLE_DATA_H