arduino-esp32/libraries/BLE/src/BLEHIDDevice.h
Me No Dev 5502879a5b
v2.0.0 Add support for ESP32S2 and update ESP-IDF to 4.4 (#4996)
This is very much still work in progress and much more will change before the final 2.0.0

Some APIs have changed. New libraries have been added. LittleFS included.

Co-authored-by: Seon Rozenblum <seonr@3sprockets.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Mike Dunston <m_dunston@comcast.net>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Seon Rozenblum <seonr@3sprockets.com>
Co-authored-by: microDev <70126934+microDev1@users.noreply.github.com>
Co-authored-by: tobozo <tobozo@users.noreply.github.com>
Co-authored-by: bobobo1618 <bobobo1618@users.noreply.github.com>
Co-authored-by: lorol <lorolouis@gmail.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Limor "Ladyada" Fried <limor@ladyada.net>
Co-authored-by: Sweety <switi.mhaiske@espressif.com>
Co-authored-by: Loick MAHIEUX <loick111@gmail.com>
Co-authored-by: Larry Bernstone <lbernstone@gmail.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
Co-authored-by: 快乐的我531 <2302004040@qq.com>
Co-authored-by: chegewara <imperiaonline4@gmail.com>
Co-authored-by: Clemens Kirchgatterer <clemens@1541.org>
Co-authored-by: Aron Rubin <aronrubin@gmail.com>
Co-authored-by: Pete Lewis <601236+lewispg228@users.noreply.github.com>
2021-04-05 14:23:58 +03:00

76 lines
2.1 KiB
C++

/*
* BLEHIDDevice.h
*
* Created on: Jan 03, 2018
* Author: chegewara
*/
#ifndef _BLEHIDDEVICE_H_
#define _BLEHIDDEVICE_H_
#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#include "BLECharacteristic.h"
#include "BLEService.h"
#include "BLEDescriptor.h"
#include "BLE2902.h"
#include "HIDTypes.h"
#define GENERIC_HID 0x03C0
#define HID_KEYBOARD 0x03C1
#define HID_MOUSE 0x03C2
#define HID_JOYSTICK 0x03C3
#define HID_GAMEPAD 0x03C4
#define HID_TABLET 0x03C5
#define HID_CARD_READER 0x03C6
#define HID_DIGITAL_PEN 0x03C7
#define HID_BARCODE 0x03C8
class BLEHIDDevice {
public:
BLEHIDDevice(BLEServer*);
virtual ~BLEHIDDevice();
void reportMap(uint8_t* map, uint16_t);
void startServices();
BLEService* deviceInfo();
BLEService* hidService();
BLEService* batteryService();
BLECharacteristic* manufacturer();
void manufacturer(std::string name);
//BLECharacteristic* pnp();
void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
//BLECharacteristic* hidInfo();
void hidInfo(uint8_t country, uint8_t flags);
//BLECharacteristic* batteryLevel();
void setBatteryLevel(uint8_t level);
//BLECharacteristic* reportMap();
BLECharacteristic* hidControl();
BLECharacteristic* inputReport(uint8_t reportID);
BLECharacteristic* outputReport(uint8_t reportID);
BLECharacteristic* featureReport(uint8_t reportID);
BLECharacteristic* protocolMode();
BLECharacteristic* bootInput();
BLECharacteristic* bootOutput();
private:
BLEService* m_deviceInfoService; //0x180a
BLEService* m_hidService; //0x1812
BLEService* m_batteryService = 0; //0x180f
BLECharacteristic* m_manufacturerCharacteristic; //0x2a29
BLECharacteristic* m_pnpCharacteristic; //0x2a50
BLECharacteristic* m_hidInfoCharacteristic; //0x2a4a
BLECharacteristic* m_reportMapCharacteristic; //0x2a4b
BLECharacteristic* m_hidControlCharacteristic; //0x2a4c
BLECharacteristic* m_protocolModeCharacteristic; //0x2a4e
BLECharacteristic* m_batteryLevelCharacteristic; //0x2a19
};
#endif // CONFIG_BLUEDROID_ENABLED
#endif /* _BLEHIDDEVICE_H_ */