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