File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,26 @@ class BTHID : public BluetoothService {
51
51
52
52
/* *@}*/
53
53
54
+ /* *
55
+ * Get HIDReportParser.
56
+ * @param id ID of parser.
57
+ * @return Returns the corresponding HIDReportParser. Returns NULL if id is not valid.
58
+ */
54
59
HIDReportParser *GetReportParser (uint8_t id) {
60
+ if (id >= NUM_PARSERS)
61
+ return NULL ;
55
62
return pRptParser[id];
56
63
};
57
64
65
+ /* *
66
+ * Set HIDReportParser to be used.
67
+ * @param id Id of parser.
68
+ * @param prs Pointer to HIDReportParser.
69
+ * @return Returns true if the HIDReportParser is set. False otherwise.
70
+ */
58
71
bool SetReportParser (uint8_t id, HIDReportParser *prs) {
72
+ if (id >= NUM_PARSERS)
73
+ return false ;
59
74
pRptParser[id] = prs;
60
75
return true ;
61
76
};
You can’t perform that action at this time.
0 commit comments