Skip to content
Snippets Groups Projects
Commit a0b2edd0 authored by schneider's avatar schneider
Browse files

feat(hid): Add ble_hid_enable config option

parent 1db3a131
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,8 @@ Option name Type Description
------------------ ---------- -----------
``ble_mac`` Boolean MAC address used for BLE. Format: ``ca:4d:10:xx:xx:xx``.
------------------ ---------- -----------
``ble_hid_enable`` Boolean Enable the Human Interface Device (HID) characteristics on BLE.
------------------ ---------- -----------
``ble_log_enable`` Boolean Activate HCI level logging of BLE data. Creates a new btsnoop compatible log file named ``ble.log`` in the ``logs`` folder after each boot if BLE is activated. Keeps the last 10 files.
------------------ ---------- -----------
``right_scroll`` Boolean Use both right buttons to scroll up and down. Lower left button is SELECT.
......
......@@ -42,11 +42,13 @@
#include "profiles/gap_api.h"
#include "cccd.h"
#include "ess.h"
#include "hid.h"
#include "ble_api.h"
#include "epicardium.h"
#include "api/interrupt-sender.h"
#include "modules/log.h"
#include "modules/config.h"
#define SCAN_REPORTS_NUM 16
......@@ -973,8 +975,6 @@ static void BleHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg)
}
}
void hid_init(void);
/*************************************************************************************************/
/*!
* \brief Start the application.
......@@ -1003,7 +1003,9 @@ void BleStart(void)
SvcBattCbackRegister(BasReadCback, NULL);
SvcBattAddGroup();
if(config_get_boolean_with_default("ble_hid_enable", false)) {
hid_init();
}
/* Reset the device */
DmDevReset();
}
......
......@@ -12,3 +12,5 @@
#define HIDAPP_KEYBOARD_REPORT_ID 1
#define HIDAPP_MOUSE_REPORT_ID 2
#define HIDAPP_CONSUMER_REPORT_ID 3
void hid_init(void);
......@@ -196,6 +196,10 @@ void hidAppInfoCback(dmConnId_t connId, uint8_t type, uint8_t value)
void HidProcMsg(wsfMsgHdr_t *pMsg)
{
if (!queue) {
/* Not initialized (yet). */
return;
}
if (pMsg->event == ATTS_HANDLE_VALUE_CNF) {
if (pMsg->status == ATT_SUCCESS) {
hidAppCb.txFlags |= HIDAPP_TX_FLAGS_READY;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment