Started to write the module used to interact/communicate with the gadget bridge Android app.
The API will contain functions to send data to the app as well as a parser used to decode and extract data sent from the app. It will internally use/access the NUS BLE service exposed by the ble_service.c file
This commit is contained in:
parent
0e1bed0452
commit
34ad38d34a
11
app/ble/gadget_bridge.c
Normal file
11
app/ble/gadget_bridge.c
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @file gadget_bridge.c
|
||||
* @author Anatole SCHRAMM-HENRY
|
||||
* @brief Source file implementing the API used to communicate/interact with the GadgetBridge Android application
|
||||
* over BLE.
|
||||
* @version 0.1
|
||||
* @date 2023-04-05
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
76
app/ble/gadget_bridge.h
Normal file
76
app/ble/gadget_bridge.h
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* @file gadget_bridge.h
|
||||
* @author Anatole SCHRAMM-HENRY
|
||||
* @brief Header file exposing the API used to communicate/interact with the GadgetBridge Android application
|
||||
* over BLE.
|
||||
* @version 0.1
|
||||
* @date 2023-04-04
|
||||
*
|
||||
* @copyright MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GADGET_BRIDGE_H
|
||||
#define GADGET_BRIDGE_H
|
||||
|
||||
#include "wm_type_def.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GADGET_BRIDGE_TOAST_TYPE_INFO = 0,
|
||||
GADGET_BRIDGE_TOAST_TYPE_WARN,
|
||||
GADGET_BRIDGE_TOAST_TYPE_ERROR,
|
||||
} GADGET_BRIDGE_TOAST_TYPE_e;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_PLAY = 0,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_PAUSE,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_PLAYPAUSE,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_NEXT,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_PREVIOUS,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_VOLUMEUP,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_VOLUMEDOWN,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_FORWARD,
|
||||
GADGET_BRIDGE_MUSIC_CONTROL_REWIND,
|
||||
} GADGET_BRIDGE_MUSIC_CONTROL_e;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GADGET_BRIDGE_CALL_ACTION_ACCEPT = 0,
|
||||
GADGET_BRIDGE_CALL_ACTION_END,
|
||||
GADGET_BRIDGE_CALL_ACTION_INCOMING,
|
||||
GADGET_BRIDGE_CALL_ACTION_OUTGOING,
|
||||
GADGET_BRIDGE_CALL_ACTION_REJECT,
|
||||
GADGET_BRIDGE_CALL_ACTION_START,
|
||||
GADGET_BRIDGE_CALL_ACTION_IGNORE,
|
||||
} GADGET_BRIDGE_CALL_ACTION_e;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GADGET_BRIDGE_NOTIFICATION_ACTION_DISMISS = 0,
|
||||
GADGET_BRIDGE_NOTIFICATION_ACTION_DISMISS_ALL,
|
||||
GADGET_BRIDGE_NOTIFICATION_ACTION_OPEN,
|
||||
GADGET_BRIDGE_NOTIFICATION_ACTION_MUTE,
|
||||
GADGET_BRIDGE_NOTIFICATION_ACTION_REPLY,
|
||||
} GADGET_BRIDGE_NOTIFICATION_ACTION_e;
|
||||
|
||||
bool gadget_bridge_send_toast(GADGET_BRIDGE_TOAST_TYPE_e toast_type, const char *message);
|
||||
|
||||
bool gadget_bridge_send_firmware_version(const char *fw1, const char *fw2);
|
||||
|
||||
bool gadget_bridge_send_battery_status(uint8_t battery_level_in_percent, float battery_level_in_mV, bool is_charging);
|
||||
|
||||
bool gadget_bridge_send_find_phone(bool find_phone);
|
||||
|
||||
bool gadget_bridge_send_music_control(GADGET_BRIDGE_MUSIC_CONTROL_e music_control);
|
||||
|
||||
bool gadget_bridge_handle_call(GADGET_BRIDGE_CALL_ACTION_e call_action);
|
||||
|
||||
bool gadget_bridge_handle_notification(GADGET_BRIDGE_NOTIFICATION_ACTION_e notification_action, uint64_t handle, const char *phone_number, const char *message);
|
||||
|
||||
bool gadget_bridge_send_activity_data(uint16_t heart_rate_in_bpm, uint32_t step_count);
|
||||
|
||||
bool gadget_bridge_send_http_request();
|
||||
|
||||
#endif //GADGET_BRIDGE_H
|
Loading…
Reference in New Issue
Block a user