Commit 96cb2c1
committed
fix: correct GPS command family and enhance command tests
Fixed critical bug where :gT# was incorrectly hardcoded as GetInfo
family instead of GPS family. This protocol-level bug was discovered
through comprehensive documentation comparison with LX200CommandSet.md.
The LX200 protocol uses case-sensitive command families:
- :gT# (lowercase g) = GPS family: 'Set Mount Time from GPS'
Blocking call up to 2 minutes, returns 1 (success) or 0 (timeout)
- :GT# (uppercase G) = GetInfo family: 'Get tracking rate'
Instant query returning tracking frequency
Bug Impact:
- Misrouting could cause 2-minute hangs when expecting instant query
- Firmware command dispatch would route to wrong handler
- Integration with ASCOM/INDI/Stellarium could fail unexpectedly
Changes to lib/lx200/src/lx200.cpp:
- Removed incorrect special case forcing :gT# to GetInfo family
- Added clarifying comments about lowercase vs uppercase distinction
- Now correctly routes based on first character ('g' vs 'G')
Changes to tests/lib/lx200/src/test_commands.cpp:
- Split test_getinfo_commands to test only uppercase G commands
- Created test_gps_commands for lowercase g commands
* :gT# - Set mount time from GPS
* :gTnnn# - Set mount time with timeout parameter [OAT]
* :g+# - Turn on GPS power
* :g-# - Turn off GPS power
- Created test_library_commands for L family
* :LI# - Get object information
* :LMNNNN# - Select Messier object with parameter extraction
- Created test_extended_oat_commands for X family (OAT extensions)
* :XFR# - Factory reset
- Added comprehensive documentation for each test explaining:
* Command purpose and behavior
* References to LX200CommandSet.md appendices
* Critical distinctions (blocking vs instant, case sensitivity)
* OAT-specific extensions vs standard Meade commands
Test Results:
- All 248/248 tests passing (100%)
- Added 8 new test cases (+3.3% coverage)
- GPS family: 4 commands tested
- Library family: 2 commands tested (+ parameter extraction)
- Extended family: 1 command tested
- GetInfo family: corrected to test :GT# (uppercase) instead of :gT#
This fix addresses documentation comparison findings and ensures
proper command routing in the C++20 rewrite. Case sensitivity in
LX200 protocol is critical for correct telescope control behavior.1 parent eae9eff commit 96cb2c1
3 files changed
Lines changed: 115 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 97 | | |
| 98 | + | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
133 | 164 | | |
134 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
135 | 194 | | |
136 | 195 | | |
137 | 196 | | |
| |||
289 | 348 | | |
290 | 349 | | |
291 | 350 | | |
292 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
293 | 359 | | |
294 | | - | |
| 360 | + | |
295 | 361 | | |
296 | 362 | | |
297 | 363 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
301 | 403 | | |
302 | 404 | | |
303 | 405 | | |
| |||
0 commit comments