Lizzy project
Dependencies: aconno_I2C Lis2dh12 adc52832_common aconno_SEGGER_RTT
Diff: aconno_ble/aconno_ble.h
- Revision:
- 0:fc77522f4d28
- Child:
- 1:198b9945994e
diff -r 000000000000 -r fc77522f4d28 aconno_ble/aconno_ble.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aconno_ble/aconno_ble.h Wed Mar 07 13:40:28 2018 +0000 @@ -0,0 +1,44 @@ +/* +* Made by Jurica Resetar @ aconno +* More info @ aconno.de +* jurica_resetar@yahoo.com +*/ + +#ifndef ACONNO_BLE_H +#define ACONNO_BLE_H + +#include "mbed.h" +#include "ble/BLE.h" +#include "GapAdvertisingData.h" + +#define MSD_SIZE_b (10) +#define ADV_INTERVAL_MS (100) +#define APPLICATION_ID (0xFFFF0059) //(0xCF170059) + +/* Global variables and constants */ + +struct __attribute__((packed, aligned(1))) advertising_packet{ + uint32_t header; + uint8_t type; + union{ + struct{ + int16_t gyroscope[3]; + int16_t accelerometer[3]; + int16_t magnetometer[3]; + }; + struct{ + float temperature; + float humidity; + float pressure; + float light; + uint8_t battery; + }; + }; +}; + +/* Function declarations */ +void bleInitComplete(BLE::InitializationCompleteCallbackContext *params); +void updatePayload(BLE *ble, advertising_packet *advertisementPacket); + + +#endif //ACONNO_BLE_H \ No newline at end of file