mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-19 09:13:11 +00:00
e3e64e5e83
* ble: refactored bt gatt characteristics setup * ble: naming fixes, small optimizations * ble: expanded bitfields; fixed pvs warnings * ble: fixed pvs warnings for real * ble: using FlipperGattCharacteristicDataPropsFixed for char[] props * ble: removed flipper_gatt_characteristic_props_const_char * ble: gatt: naming changes * ble: gatt: fixed device_info service constant attrs sizes * ble: gatt: copy descriptors to char instances; reworked hid chars to be callback-based; moved max size getter to callback with NULL data; added comments * ble: gatt: removed hid_svc_report_data_callback * ble: hid svc: better double loop idx naming * ble: hid svc: simplified hid_svc_update_info * ble: gatt: removed magic values; fixed type for HidSvcGattCharacteristicInfo * ble: gatt: moved long uuids to separate files Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
29 lines
814 B
C
29 lines
814 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define HID_SVC_REPORT_MAP_MAX_LEN (255)
|
|
#define HID_SVC_REPORT_MAX_LEN (255)
|
|
#define HID_SVC_REPORT_REF_LEN (2)
|
|
#define HID_SVC_INFO_LEN (4)
|
|
#define HID_SVC_CONTROL_POINT_LEN (1)
|
|
|
|
#define HID_SVC_INPUT_REPORT_COUNT (3)
|
|
#define HID_SVC_OUTPUT_REPORT_COUNT (0)
|
|
#define HID_SVC_FEATURE_REPORT_COUNT (0)
|
|
#define HID_SVC_REPORT_COUNT \
|
|
(HID_SVC_INPUT_REPORT_COUNT + HID_SVC_OUTPUT_REPORT_COUNT + HID_SVC_FEATURE_REPORT_COUNT)
|
|
|
|
void hid_svc_start();
|
|
|
|
void hid_svc_stop();
|
|
|
|
bool hid_svc_is_started();
|
|
|
|
bool hid_svc_update_report_map(const uint8_t* data, uint16_t len);
|
|
|
|
bool hid_svc_update_input_report(uint8_t input_report_num, uint8_t* data, uint16_t len);
|
|
|
|
// Expects data to be of length HID_SVC_INFO_LEN (4 bytes)
|
|
bool hid_svc_update_info(uint8_t* data);
|