Lizzy project

Dependencies:   aconno_I2C Lis2dh12 adc52832_common aconno_SEGGER_RTT

Committer:
jurica238814
Date:
Thu Mar 08 10:29:22 2018 +0000
Revision:
2:41a1cdac47a7
Parent:
1:198b9945994e
Child:
4:49b1aeca55e4
Multiplication factor added.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jurica238814 0:fc77522f4d28 1 /*
jurica238814 0:fc77522f4d28 2 * Made by Jurica Resetar @ aconno
jurica238814 0:fc77522f4d28 3 * More info @ aconno.de
jurica238814 0:fc77522f4d28 4 * jurica_resetar@yahoo.com
jurica238814 0:fc77522f4d28 5 */
jurica238814 0:fc77522f4d28 6
jurica238814 0:fc77522f4d28 7 #ifndef ACONNO_BLE_H
jurica238814 0:fc77522f4d28 8 #define ACONNO_BLE_H
jurica238814 0:fc77522f4d28 9
jurica238814 0:fc77522f4d28 10 #include "mbed.h"
jurica238814 0:fc77522f4d28 11 #include "ble/BLE.h"
jurica238814 0:fc77522f4d28 12 #include "GapAdvertisingData.h"
jurica238814 0:fc77522f4d28 13
jurica238814 0:fc77522f4d28 14 #define MSD_SIZE_b (10)
jurica238814 0:fc77522f4d28 15 #define ADV_INTERVAL_MS (100)
dbartolovic 1:198b9945994e 16 #define APPLICATION_ID (0xCF170059) //(0xCF170059)
jurica238814 0:fc77522f4d28 17
jurica238814 0:fc77522f4d28 18 /* Global variables and constants */
jurica238814 0:fc77522f4d28 19
jurica238814 0:fc77522f4d28 20 struct __attribute__((packed, aligned(1))) advertising_packet{
jurica238814 0:fc77522f4d28 21 uint32_t header;
jurica238814 0:fc77522f4d28 22 uint8_t type;
jurica238814 0:fc77522f4d28 23 union{
jurica238814 0:fc77522f4d28 24 struct{
jurica238814 0:fc77522f4d28 25 int16_t gyroscope[3];
jurica238814 0:fc77522f4d28 26 int16_t accelerometer[3];
jurica238814 0:fc77522f4d28 27 int16_t magnetometer[3];
jurica238814 2:41a1cdac47a7 28 int16_t acc_lsb_value;
jurica238814 0:fc77522f4d28 29 };
jurica238814 0:fc77522f4d28 30 struct{
jurica238814 0:fc77522f4d28 31 float temperature;
jurica238814 0:fc77522f4d28 32 float humidity;
jurica238814 0:fc77522f4d28 33 float pressure;
jurica238814 0:fc77522f4d28 34 float light;
jurica238814 0:fc77522f4d28 35 uint8_t battery;
jurica238814 0:fc77522f4d28 36 };
jurica238814 0:fc77522f4d28 37 };
jurica238814 0:fc77522f4d28 38 };
jurica238814 0:fc77522f4d28 39
jurica238814 0:fc77522f4d28 40 /* Function declarations */
jurica238814 0:fc77522f4d28 41 void bleInitComplete(BLE::InitializationCompleteCallbackContext *params);
jurica238814 0:fc77522f4d28 42 void updatePayload(BLE *ble, advertising_packet *advertisementPacket);
jurica238814 0:fc77522f4d28 43
jurica238814 0:fc77522f4d28 44
jurica238814 0:fc77522f4d28 45 #endif //ACONNO_BLE_H