-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a181bf
commit f43955f
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- GHOST Frame Types | ||
local GHST_FRAMETYPE_MSP_REQ = 0x21 | ||
local GHST_FRAMETYPE_MSP_WRITE = 0x22 | ||
local GHST_FRAMETYPE_MSP_RESP = 0x28 | ||
|
||
ghstMspType = 0 | ||
|
||
protocol.mspSend = function(payload) | ||
return protocol.push(ghstMspType, payload) | ||
end | ||
|
||
protocol.mspRead = function(cmd) | ||
ghstMspType = GHST_FRAMETYPE_MSP_REQ | ||
return mspSendRequest(cmd, {}) | ||
end | ||
|
||
protocol.mspWrite = function(cmd, payload) | ||
ghstMspType = GHST_FRAMETYPE_MSP_WRITE | ||
return mspSendRequest(cmd, payload) | ||
end | ||
|
||
protocol.mspPoll = function() | ||
local type, data = ghostTelemetryPop() | ||
if type == GHST_FRAMETYPE_MSP_RESP then | ||
return mspReceivedReply(data) | ||
end | ||
return nil | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters