BSB Developer Docs
Loading...
Searching...
No Matches
ble_i.h
1#pragma once
2
3#include "ble.h"
4#include "ble_log.h"
8
9#include <intercom/intercom.h>
10#include <furi.h>
11
12#if !defined(BSB_MCU_SI917)
14#else
15#include "worker/ble_worker.h"
16#endif
17
18typedef enum {
19 BleEventTypeFrameReceived = (1 << 0),
20 BleEventTypeFrameLost = (1 << 1),
21 BleEventTypeIntercomInit = (1 << 2),
22 BleEventTypeIntercomDeinit = (1 << 3),
23} BleEventType;
24
25typedef void (
26 *BleServicePostProcessCallback)(BleServiceObject* service, bool result, void* extra_context);
27
28struct Ble {
29 BleServiceStatus status;
30 FuriMutex* ble_lock;
31 FuriSemaphore* mailbox_lock;
33 BleCommandEngine* engine;
34
35 FuriMessageQueue* service_queue;
36 FuriEventLoop* event_loop;
37 Intercom* intercom;
38 IntercomChannel* intercom_ch;
39 FuriString* error;
40
41 BleServiceObject* services[BleServiceIndexCount];
42 uint8_t remote_device_address[BLE_REMOTE_DEVICE_ADDRESS_STRING_SIZE];
43#if !defined(BSB_MCU_SI917)
44 BleStreaming* streaming;
45 FuriPubSub* on_status_change;
46#else
47 BleWorker* worker;
48#endif
49 BleServicePostProcessCallback service_post_process_callback;
50};
51
52void ble_set_service_post_process_callback(Ble* ble, BleServicePostProcessCallback callback);
Public ble api.
BleServiceStatus
Enumeration of ble service statuses.
Definition ble.h:26
#define BLE_REMOTE_DEVICE_ADDRESS_STRING_SIZE
Ble device address string size.
Definition ble.h:23
System command engine.
Public api for ble services.
Collection of predefined service configs.
API for streaming device state and screen over ble.
Responsible for all operations with ble and exists only on 917.
Chip-to-chip intercommunication via U(S)ART service.
Definition ble_command_engine.c:23
Definition ble_i.h:28
Definition ble_service_i.h:15
Definition ble_streaming.c:36
Definition ble_worker_i.h:14
Frame header with fields which help control frame exchange.
Definition ble_intercom_types.h:40
Definition intercom_i.h:37
Definition intercom_i.h:44