HID Device (Mouse)

This section describes implemented profiles and services, user interactions, and testing methods for the HID mouse application.

Implemented profiles and services

The HID Device application implements a GATT server and the following profile and services.

  • HID over GATT Profile v1.0

  • Human Interface Device Service v1.0

  • Battery Service v1.0

  • Device Information Service v1.1

The application behaves as a GAP peripheral node. It enters GAP General Discoverable Mode and waits for a GAP central node to connect. Security on the services and bonding is enabled on this device.

When the GATT client configures notification, the application starts sending HID reports every two seconds with the movement of the MOUSE_STEP. The demo moves the cursor in a square pattern between AXIS_MIN and AXIS_MAX. The report contains 3 bytes, one for button status, one for X axis, and one for Y axis. The report descriptor matches the example in chapter E.10 from the USB Device Class Definition for Human Interface Devices (USB HID Specification), Version 1.11.

Parent topic:HID Device (Mouse)

Supported platforms

The following platforms support the HID Device application:

  • KW45B41Z-EVK

  • K32W148-EVK

  • FRDM-MCXW71

  • KW47-EVK

  • MCXW72-EVK

  • FRDM-MCXW72

Parent topic:HID Device (Mouse)

User interface

After flashing the board, the device enters Idle mode with all LEDs flashing. To start advertising, press the ADVSW button. In GAP Discoverable mode, CONNLED is flashing. When the central node connects to the peripheral, CONNLED turns solid. To disconnect the node, hold the ADVSW pressed for 2-3 seconds. The node then re-enters GAP Discoverable Mode.

Table 1 details below the hardware references.

Platform

ADVSW

CONNLED

KW45B41Z-EVK / K32W148-EVK

SW2

LED2

FRDM-MCXW71

SW2

Blue LED

KW47-EVK / MCXW72-EVK

SW2

LED2

FRDM-MCXW72

SW4

Blue LED

Parent topic:HID Device (Mouse)

Usage

The HID mouse can be connected to any Bluetooth Smart Ready products available on the market that supports HID devices or to another supported platform running the HID Host example (setup steps detailed in the HID Host section).

To make the HID mouse visible, press the ADVSW button to start sending advertisements, which causes CONNLED to start flashing. See the figure Enter PIN prompt on Android platform below.
Enter PIN prompt on Android platform
The sensor name “NXP_HID” shows on the device when its scanning is active. A solid CONNLED indicates a successful connection between the 2 devices. When prompted to enter the pin, type the 999999 passkey.

When configured, the HID mouse starts sending HID report, which is configured as explained above, with notifications every 100 milliseconds. The mouse cursor shows a square pattern movement on the screen as shown in the figure HID Mouse detected by Android platform below.

HID Mouse detected by Android platform

Parent topic:HID Device (Mouse)

Parent topic:Bluetooth LE stack and demo applications