arduino / arduino/ArduinoCore-avr

Setting the board serial number explicitly in USB HID API

Open
#389 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Current implementation of USB HID library generates the Serial No automatically by adding the descriptor size to the "HIDAA" string. This approach is ok as a default but in some use cases it is necessary to set a specific serial number to the board, which will not change when the USB HID descriptor is updated.
Besides, the serial number is utilized in the naming of the Arduino port so changing it dynamically may lead to the loss of connectivity to the board after the sketch upload.
Instead, a new method setSerial() is proposed, which can take any string stored in PROGMEM.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the USB HID library's serial-number generation and API entry points, comparing the current automatic "HIDAA" and descriptor-size behavior with the proposed setSerial() method. Check how PROGMEM strings are handled and verify that an explicitly set serial remains stable when the USB HID descriptor changes and after sketch upload.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.