Lizzy project
Dependencies: aconno_I2C Lis2dh12 adc52832_common aconno_SEGGER_RTT
aconno_ble/aconno_ble.h@5:9903738f2587, 2018-03-09 (annotated)
- Committer:
- dbartolovic
- Date:
- Fri Mar 09 18:09:57 2018 +0000
- Revision:
- 5:9903738f2587
- Parent:
- 4:49b1aeca55e4
- Child:
- 8:7ba4f82de9b6
Set acc mode to high resolution
Who changed what in which revision?
User | Revision | Line number | New 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]; |
dbartolovic | 5:9903738f2587 | 28 | uint16_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 |