This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom HID over GATT device

Hi I've been testing HID example ("nRF51 SDK v9.0.0\examples\ble_peripheral\ble_app_hids_keyboard\pca10028\s110\arm5_no_packs") for a while.Now,I want to test Custom HID over GATT base on the keyboard example using the pca10028 DK.reference to this webpage " nRF51422 HID example modification.

I just do as follow: 1.replace the report_map_data

#define INPUT_REPORT_MAX_LEN             8             /**< Maximum length of the Input Report characteristic. */

static uint8_t report_map_data[] =
{
	0x06, 0x00, 0xFF,		// Usage Page = 0xFF00 (Vendor Defined Page 1)
	0x09, 0x01, 			// Usage (Vendor Usage 1)
	0xA1, 0x01, 			// Collection (Application)
	0x19, 0x01, 			//		Usage Minimum 
	0x29, INPUT_REPORT_MAX_LEN, 			//		Usage Maximum 
	0x15, 0x00, 			//		Logical Minimum (data bytes in the report may have minimum value = 0x00)
	0x26, 0xFF, 0x00,		//		Logical Maximum (data bytes in the report may have maximum value = 0x00FF = unsigned 255)
	0x75, 0x08, 			//		Report Size: 8-bit field size
	0x95, INPUT_REPORT_MAX_LEN, 			//		Report Count: Make sixty-four 8-bit fields (the next time the parser hits an "Input", "Output", or "Feature" item)
	0x81, 0x00, 			//		Input (Data, Array, Abs): Instantiates input packet fields based on the above report size, count, logical min/max, and usage.
	0x19, 0x01, 			//		Usage Minimum 
	0x29, OUTPUT_REPORT_MAX_LEN,			 // 	 Usage Maximum
	0x91, 0x00, 			//		Output (Data, Array, Abs): Instantiates output packet fields.  Uses same report size and count as "Input" fields, since nothing new/different was specified to the parser since the "Input" item.
	0xC0					// End Collection
};

2.Connect the PCA10028 DK to PC's BLE.then using Bus Hound to monitor. but when I push the button,there is not data received in Bus Hound(use the original example ,Bus Hound can received Hid data). image description

image description

Is there any code I need to modify?

Regards

  • Basic debugging techniques: UART (or RTT) debug logging from nRF5x FW to PC console over (emulated) COM port and Radio analyzer/BLE sniffer. What at these things saying? Is your FW alive? What events and function calls/error return codes are done on top of BLE stack in your code? What is running over the radio? I'm afraid whatever you wrote to the code you will need to debug (at least for the beginning until you isolate piece of code which does something unexpected and Nordic support team can debug with you).

  • I use BreakPoint debugging techniques.it seems the FW work normal,no error happen,but Bus Hound just can't receive data.

  • So the question is specifically about Bus Hound? Then I'm sorry to interfere, I have no clue what it is and how it should work, I was assuming it's just another terminal app... Hope you will find someone interested in such obscure things here to help you.

  • Hi,endnode.Thank you. Sorry for my poor english and expression.actually,my question is simply.

    a. Is there a PC utility to debug HOGP(HID Over GATT).

    b. is there a custom HOGP example?

  • I don't really understand what do you mean by "custom HID over GATT". There is only one HID over GATT defined by BT SIG as far as I know and if you change UUIDs or protocol on top of GATT Characteristics then it's not HID any more and no "HID compliant" device will understand it on the other side. Am I missing something? However if you just use HID over GATT as example and you modify it to serve your own - completely proprietary - application/use case then I can understand the question. It's also nice that you've extracted two simple and understandable questions, unfortunately I cannot help you (from my perspective debugging is simply done by logging of GATT flow on both sides - nRF5x and the other peer if possible - plus looking to 2.4GHz RF analyzer/BLE sniffer for the rest). Hopefully someone else on this forum can.

Related