Skip to content

Commit

Permalink
Add fport support
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorcomander committed Jun 7, 2018
1 parent 676c4b4 commit e0cb231
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@

VERSION = 0.10
VERSION = 0.11

.PHONY: all
all: clean prepare luatmp lua
Expand Down
5 changes: 3 additions & 2 deletions src/common/KissProtocolSPort.lua
Expand Up @@ -11,7 +11,8 @@
SPORT_KISS_VERSION = bit32.lshift(1,5)
SPORT_KISS_STARTFLAG = bit32.lshift(1,4)
LOCAL_SENSOR_ID = 0x0D
REMOTE_SENSOR_ID = 0x1B
REMOTE_SENSOR_ID_1 = 0x1B
REMOTE_SENSOR_ID_2 = 0x00
REQUEST_FRAME_ID = 0x30
REPLY_FRAME_ID = 0x32

Expand Down Expand Up @@ -203,7 +204,7 @@ local function kissPollReply()
while true do
local sensorId, frameId, dataId, value = sportTelemetryPop()

if sensorId == REMOTE_SENSOR_ID and frameId == REPLY_FRAME_ID then
if (sensorId == REMOTE_SENSOR_ID_1 or sensorId == REMOTE_SENSOR_ID_2) and frameId == REPLY_FRAME_ID then

local payload = {}
payload[1] = bit32.band(dataId,0xFF)
Expand Down

0 comments on commit e0cb231

Please sign in to comment.