Commented the API

This commit is contained in:
Th3maz1ng 2023-05-14 22:13:26 +02:00
parent df4ab1f790
commit cf7c52c1eb

View File

@ -3,6 +3,12 @@
#include "lvgl.h"
/**
* @brief The type of the callback to register, which will be called every time the
* find my phone button is clicked on the UI.
* The findMyPhone boolean parameter will be set to true if we want to make the phone ring or false otherwise.
*
*/
typedef void (*SendFindMyPhoneBLECommandCb_t)(bool findMyPhone);
typedef struct FindMyPhoneButton
@ -23,14 +29,43 @@ typedef struct FindMyPhoneScreen
bool ble_connection_state;
} FindMyPhoneScreen_t;
/**
* @brief Initializes the find my phone screen object structure.
*
* @param findMyPhoneScreen a pointer to the find my phone screen object structure.
*/
void find_my_phone_screen_init(FindMyPhoneScreen_t * const findMyPhoneScreen);
/**
* @brief Registers a callback called every time the find my phone button is clicked.
* Depending on the action to perform, the boolean parameter will be set accordingly.
*
* @param findMyPhoneScreen a pointer to the find my phone screen object structure.
* @param sendFindMyPhoneBLECommandCb the callback of type SendFindMyPhoneBLECommandCb_t to register.
*/
void find_my_phone_screen_register_BLE_command_send_cb(FindMyPhoneScreen_t * const findMyPhoneScreen, SendFindMyPhoneBLECommandCb_t sendFindMyPhoneBLECommandCb);
/**
* @brief Tells the find my phone screen app if a BLE connection is currently established between the watch a phone.
* This will disable the feature if no connection currently exists.
*
* @param findMyPhoneScreen a pointer to the find my phone screen object structure.
* @param connected a boolean value which should be set to true if a connection is established and to false otherwise.
*/
void find_my_phone_screen_notify_BLE_connection_state(FindMyPhoneScreen_t * const findMyPhoneScreen, bool connected);
/**
* @brief Builds the find my phone screen graphically.
*
* @param findMyPhoneScreen a pointer to the find my phone screen object structure.
*/
void find_my_phone_screen_create(FindMyPhoneScreen_t * const findMyPhoneScreen);
/**
* @brief Frees all resources used by the findMyPhoneScreen object, to be called when discarding the find my phone screen.
*
* @param findMyPhoneScreen a pointer to the find my phone screen object structure.
*/
void find_my_phone_screen_destroy(FindMyPhoneScreen_t * const findMyPhoneScreen);
#endif //FIND_MY_PHONE_SCREEN_H