Commit f866aa1
committed
Replace cJSON with mkjson and fix JSON output issues
- Replace cJSON library (3,443 lines) with lightweight mkjson (357 lines)
- Fix mkjson bug: change %Ld to %lld for proper 64-bit integer handling
- Add missing JSON fields: device descriptions, USB3 link states, serial numbers
- Fix USB3 detection by checking hub->super_speed flag instead of port status bits
- Fix buffer allocations with proper size calculations
- Handle all alternate settings in interfaces array
- Replace unsafe string operations (strcpy/strcat) with snprintf
- Change 'speed_bits' field to 'speed_bps' for consistency
- Document JSON output option (-j) in README
Addresses feedback from PR #575. Tested on macOS and Linux.1 parent 3a39f48 commit f866aa1
3 files changed
+329
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
0 commit comments