1
1
local MSP_GPS_CONFIG = 135
2
2
local MSP_VTX_CONFIG = 88
3
3
local MSP_OSD_CONFIG = 84
4
+ local MSP_BUILD_INFO = 5
5
+
6
+ local BUILD_OPTION_GPS = 16412
7
+ local BUILD_OPTION_OSD_SD = 16416
8
+ local BUILD_OPTION_VTX = 16421
4
9
5
10
local isGpsRead = false
6
11
local isVtxRead = false
@@ -15,10 +20,22 @@ local returnTable = {
15
20
t = " " ,
16
21
}
17
22
23
+ local function processBuildInfoReply (payload )
24
+ -- TODO: parse build options
25
+ end
26
+
18
27
local function processMspReply (cmd , payload , err )
19
28
isInFlight = false
20
29
local isOkay = not err
21
- if cmd == MSP_GPS_CONFIG then
30
+ if cmd == MSP_BUILD_INFO then
31
+ if not isOkay then
32
+ return
33
+ end
34
+ isGpsRead = true
35
+ isVtxRead = true
36
+ isOsdSDRead = true
37
+ processBuildInfoReply (payload )
38
+ elseif cmd == MSP_GPS_CONFIG then
22
39
isGpsRead = true
23
40
local providerSet = payload [1 ] ~= 0
24
41
features .gps = isOkay and providerSet
@@ -37,7 +54,10 @@ local function updateFeatures()
37
54
if lastRunTS + INTERVAL < getTime () then
38
55
lastRunTS = getTime ()
39
56
local cmd
40
- if not isGpsRead then
57
+ if apiVersion >= 1.47 then
58
+ cmd = MSP_BUILD_INFO
59
+ returnTable .t = " Checking options..."
60
+ elseif not isGpsRead then
41
61
cmd = MSP_GPS_CONFIG
42
62
returnTable .t = " Checking GPS..."
43
63
elseif not isVtxRead then
0 commit comments