Commit 718e238
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 mvp#575. Tested on macOS and Linux.1 parent be4d83e commit 718e238
3 files changed
+329
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| |||
| 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