You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
861 B

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "ble_dfu.h"
// #include "nrf_bootloader_info.h"
#include "nrf_power.h"
/**
* @brief
*/
typedef void (*on_service_init_t)(void);
typedef enum {
kzble_event_none,
kzble_event_connected,
kzble_event_disconnected,
} zble_event_type_t;
typedef struct {
zble_event_type_t eventType;
} zble_event_t;
typedef struct {
const char* deviceName;
on_service_init_t on_service_init;
} zble_module_cfg_t;
typedef void (*zble_event_listener_t)(zble_event_t* event);
void zble_module_init(zble_module_cfg_t* cfg);
void zble_module_reglistener(zble_event_listener_t event_listener);
void zble_module_start_adv();
void zble_module_stop_adv();
bool zble_module_is_connected();
uint32_t zble_module_has_disconnected_ms();
bool zble_module_disconnect();
int32_t zble_module_get_mtu_size();