Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/targets/f6/ble_glue/serial_service.h')
-rw-r--r--firmware/targets/f6/ble_glue/serial_service.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/firmware/targets/f6/ble_glue/serial_service.h b/firmware/targets/f6/ble_glue/serial_service.h
new file mode 100644
index 00000000..a1e5bc1c
--- /dev/null
+++ b/firmware/targets/f6/ble_glue/serial_service.h
@@ -0,0 +1,47 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#define SERIAL_SVC_DATA_LEN_MAX (486)
+#define SERIAL_SVC_CHAR_VALUE_LEN_MAX (243)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ SerialServiceEventTypeDataReceived,
+ SerialServiceEventTypeDataSent,
+} SerialServiceEventType;
+
+typedef struct {
+ uint8_t* buffer;
+ uint16_t size;
+} SerialServiceData;
+
+typedef struct {
+ SerialServiceEventType event;
+ SerialServiceData data;
+} SerialServiceEvent;
+
+typedef uint16_t (*SerialServiceEventCallback)(SerialServiceEvent event, void* context);
+
+void serial_svc_start();
+
+void serial_svc_set_callbacks(
+ uint16_t buff_size,
+ SerialServiceEventCallback callback,
+ void* context);
+
+void serial_svc_notify_buffer_is_empty();
+
+void serial_svc_stop();
+
+bool serial_svc_is_started();
+
+bool serial_svc_update_tx(uint8_t* data, uint16_t data_len);
+
+#ifdef __cplusplus
+}
+#endif