mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-28 07:20:29 +00:00
936a2f64b2
* FuriHal: add more supported radio stacks * Bt: correct ble stack enum value * Bt: update cli testing commands implementation * Scripts: always emitting ob data to update manifest; added ob_custradio.data for non-light radio stacks * Scripts: added stack type whitelist & disclaimer message * ble: remove scanner * ble: remove HCI and advances ble stacks support * bt: correctly close RPC session before bt reinit * Scripts: update bundler: estimating flash layout & refusing to build dangerous packages; app frame: not adding redundant log handlers * Docs: additional details on bundling updates; fixed updater error codes * Docs: wording fixes for OTA.md Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: SG <who.just.the.doctor@gmail.com>
86 lines
1.7 KiB
C
86 lines
1.7 KiB
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#include <furi_hal_version.h>
|
|
|
|
#define GAP_MAC_ADDR_SIZE (6)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
GapEventTypeConnected,
|
|
GapEventTypeDisconnected,
|
|
GapEventTypeStartAdvertising,
|
|
GapEventTypeStopAdvertising,
|
|
GapEventTypePinCodeShow,
|
|
GapEventTypePinCodeVerify,
|
|
GapEventTypeUpdateMTU,
|
|
} GapEventType;
|
|
|
|
typedef union {
|
|
uint32_t pin_code;
|
|
uint16_t max_packet_size;
|
|
} GapEventData;
|
|
|
|
typedef struct {
|
|
GapEventType type;
|
|
GapEventData data;
|
|
} GapEvent;
|
|
|
|
typedef bool (*GapEventCallback)(GapEvent event, void* context);
|
|
|
|
typedef enum {
|
|
GapStateUninitialized,
|
|
GapStateIdle,
|
|
GapStateStartingAdv,
|
|
GapStateAdvFast,
|
|
GapStateAdvLowPower,
|
|
GapStateConnected,
|
|
} GapState;
|
|
|
|
typedef enum {
|
|
GapPairingNone,
|
|
GapPairingPinCodeShow,
|
|
GapPairingPinCodeVerifyYesNo,
|
|
} GapPairing;
|
|
|
|
typedef struct {
|
|
uint16_t conn_interval;
|
|
uint16_t slave_latency;
|
|
uint16_t supervisor_timeout;
|
|
} GapConnectionParams;
|
|
|
|
typedef struct {
|
|
uint16_t conn_int_min;
|
|
uint16_t conn_int_max;
|
|
uint16_t slave_latency;
|
|
uint16_t supervisor_timeout;
|
|
} GapConnectionParamsRequest;
|
|
|
|
typedef struct {
|
|
uint16_t adv_service_uuid;
|
|
uint16_t appearance_char;
|
|
bool bonding_mode;
|
|
GapPairing pairing_method;
|
|
uint8_t mac_address[GAP_MAC_ADDR_SIZE];
|
|
char adv_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH];
|
|
GapConnectionParamsRequest conn_param;
|
|
} GapConfig;
|
|
|
|
bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context);
|
|
|
|
void gap_start_advertising();
|
|
|
|
void gap_stop_advertising();
|
|
|
|
GapState gap_get_state();
|
|
|
|
void gap_thread_stop();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|