IZAR Flight Controller 1.0.0
IZAR Flight Controller running with an ESP32.
|
#include "esp_err.h"
#include "esp_gatts_api.h"
#include "sensors_reading/mpu6050/mpu6050_c.h"
#include "sensors_reading/sensors_reading.h"
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | LO_UINT16(a) |
#define | HI_UINT16(a) |
#define | GATTS_SERVICE_UUID 0x00FF |
#define | GATTS_CHAR_UUID_ROCKET_STATUS 0xFF01 |
#define | GATTS_CHAR_UUID_ROCKET_ALTITUDE 0xFF02 |
#define | GATTS_CHAR_UUID_ROCKET_SPEED 0xFF03 |
#define | GATTS_CHAR_UUID_ROCKET_PRESSURE 0xFF04 |
#define | GATTS_CHAR_UUID_ROCKET_TEMPERATURE 0xFF05 |
#define | GATTS_CHAR_UUID_ROCKET_ACC_X 0xFF06 |
#define | GATTS_CHAR_UUID_ROCKET_ACC_Y 0xFF07 |
#define | GATTS_CHAR_UUID_ROCKET_ACC_Z 0xFF08 |
#define | GATTS_CHAR_UUID_ROCKET_ROT_X 0xFF09 |
#define | GATTS_CHAR_UUID_ROCKET_ROT_Y 0xFF10 |
#define | GATTS_CHAR_UUID_ROCKET_ROT_Z 0xFF11 |
#define | GATTS_NUM_HANDLE 25 |
#define | TAG_BLE "BLE" |
Functions | |
esp_err_t | ble_init (void) |
Initializes BLE application with all the needed drivers and components. | |
void | ble_gatts_event_handler (esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param) |
Callback function for GATT services. | |
void | create_and_add_service (void) |
Create a and add service object. | |
void | crete_characteristics (void) |
Create the characteristic. | |
esp_err_t | ble_notify_float (float value, uint16_t char_handler) |
Notify a float value. | |
esp_err_t | ble_notify_uint8 (uint8_t value, uint16_t char_handler) |
Notify a uint8_t value. | |
esp_err_t | update_rocket_status (int value) |
Notify rocket status over BLE. | |
esp_err_t | update_rocket_altitude (float value) |
Notify altitude over BLE. | |
esp_err_t | update_rocket_speed (float value) |
Notify speed over BLE. | |
esp_err_t | update_rocket_pressure (int32_t value) |
Notify pressure over BLE. | |
esp_err_t | update_rocket_temperature (float value) |
Notify temperature over BLE. | |
esp_err_t | update_rocket_acc_x (float value) |
Notify new X-axis linear acceleration. | |
esp_err_t | update_rocket_acc_y (float value) |
Notify new Y-axis linear acceleration. | |
esp_err_t | update_rocket_acc_z (float value) |
Notify new Z-axis linear acceleration. | |
esp_err_t | update_rocket_rot_x (float value) |
Notify new X-axis angular acceleration. | |
esp_err_t | update_rocket_rot_y (float value) |
Notify new Y-axis angular acceleration. | |
esp_err_t | update_rocket_rot_z (float value) |
Notify new Z-axis angular acceleration. |
Variables | |
ROCKET_STATUS_T | rocket_status |
mpu6050_acceleration_t | rocket_accel |
mpu6050_rotation_t | rocket_rot |
float | rocket_temperature |
float | rocket_altitude |
int32_t | rocket_pressure |
#define GATTS_CHAR_UUID_ROCKET_ACC_X 0xFF06 |
#define GATTS_CHAR_UUID_ROCKET_ACC_Y 0xFF07 |
#define GATTS_CHAR_UUID_ROCKET_ACC_Z 0xFF08 |
#define GATTS_CHAR_UUID_ROCKET_ALTITUDE 0xFF02 |
#define GATTS_CHAR_UUID_ROCKET_PRESSURE 0xFF04 |
#define GATTS_CHAR_UUID_ROCKET_ROT_X 0xFF09 |
#define GATTS_CHAR_UUID_ROCKET_ROT_Y 0xFF10 |
#define GATTS_CHAR_UUID_ROCKET_ROT_Z 0xFF11 |
#define GATTS_CHAR_UUID_ROCKET_SPEED 0xFF03 |
#define GATTS_CHAR_UUID_ROCKET_STATUS 0xFF01 |
#define GATTS_CHAR_UUID_ROCKET_TEMPERATURE 0xFF05 |
#define GATTS_NUM_HANDLE 25 |
#define GATTS_SERVICE_UUID 0x00FF |
#define HI_UINT16 | ( | a | ) |
#define LO_UINT16 | ( | a | ) |
#define TAG_BLE "BLE" |
void ble_gatts_event_handler | ( | esp_gatts_cb_event_t | event, |
esp_gatt_if_t | gatts_if, | ||
esp_ble_gatts_cb_param_t * | param ) |
Callback function for GATT services.
event | |
gatts_if | |
param |
esp_err_t ble_init | ( | void | ) |
Initializes BLE application with all the needed drivers and components.
< Starting number of error codes
< NVS partition doesn't contain any empty pages. This may happen if NVS partition was truncated. Erase the whole partition and call nvs_flash_init again.
< Starting number of error codes
< NVS partition contains data in new format and cannot be recognized by this version of code
< esp_err_t value indicating success (no error)
< esp_err_t value indicating success (no error)
< esp_err_t value indicating success (no error)
esp_err_t ble_notify_float | ( | float | value, |
uint16_t | char_handler ) |
Notify a float value.
value | |
char_handler |
< Generic esp_err_t code indicating failure
esp_err_t ble_notify_uint8 | ( | uint8_t | value, |
uint16_t | char_handler ) |
Notify a uint8_t value.
value | |
char_handler |
< Generic esp_err_t code indicating failure
void create_and_add_service | ( | void | ) |
Create a and add service object.
< esp_err_t value indicating success (no error)
< esp_err_t value indicating success (no error)
void crete_characteristics | ( | void | ) |
Create the characteristic.
esp_err_t update_rocket_acc_x | ( | float | value | ) |
Notify new X-axis linear acceleration.
value | new X-axis linear acceleration value. |
esp_err_t update_rocket_acc_y | ( | float | value | ) |
Notify new Y-axis linear acceleration.
value | new Y-axis linear acceleration value. |
esp_err_t update_rocket_acc_z | ( | float | value | ) |
Notify new Z-axis linear acceleration.
value | new Z-axis linear acceleration value. |
esp_err_t update_rocket_altitude | ( | float | value | ) |
Notify altitude over BLE.
value | new altitude value. |
esp_err_t update_rocket_pressure | ( | int32_t | value | ) |
Notify pressure over BLE.
value | new pressure value. |
esp_err_t update_rocket_rot_x | ( | float | value | ) |
Notify new X-axis angular acceleration.
value | new X-axis angular acceleration value. |
esp_err_t update_rocket_rot_y | ( | float | value | ) |
Notify new Y-axis angular acceleration.
value | new Y-axis angular acceleration value. |
esp_err_t update_rocket_rot_z | ( | float | value | ) |
Notify new Z-axis angular acceleration.
value | new Z-axis angular acceleration value. |
esp_err_t update_rocket_speed | ( | float | value | ) |
Notify speed over BLE.
value | new rocket speed value. |
esp_err_t update_rocket_status | ( | int | value | ) |
Notify rocket status over BLE.
value | new rocket status. |
esp_err_t update_rocket_temperature | ( | float | value | ) |
Notify temperature over BLE.
value | new temperature value. |
|
extern |
float rocket_altitude |
|
extern |
|
extern |
|
extern |
|
extern |