Skip to content

Commit c9182e1

Browse files
lmtan91Shiny380
andauthored
Add support for rubix data decoding (#27)
* Add support for rubix data decoding - Rewrite C++ decoder in rubix-data-encoding project - Add unittest rubix_test.go for decoder - Rewrite all JS/c++ decode unit tests - Integrate the rubix decoder with moduel - Fix typo Signed-off-by: Tan Le <lmtan91@gmail.com> * add arm build files * Implement app_test.go mockup to test handleSerialPayload - Add app_test.go in pkg. - Mockup handleSerialPayload to test rubix decoding Signed-off-by: Tan Le <lmtan91@gmail.com> * support new payloads to add points Signed-off-by: Tan Le <lmtan91@gmail.com> * Implement CheckPayloadLengthRubix Signed-off-by: Tan Le <lmtan91@gmail.com> * Implement rubix decoding - Don't count RSSI and SNR as payload in CheckPayloadLengthRubix Signed-off-by: Tan Le <lmtan91@gmail.com> * rubix decoding - length position at 7th Signed-off-by: Tan Le <lmtan91@gmail.com> * update for recent refactor * Integrate rubix decoding with latest point update refactor Signed-off-by: Tan Le <lmtan91@gmail.com> --------- Signed-off-by: Tan Le <lmtan91@gmail.com> Co-authored-by: Shiny380 <daniel.mckinnell43@gmail.com>
1 parent 49d5f14 commit c9182e1

File tree

7 files changed

+948
-4
lines changed

7 files changed

+948
-4
lines changed

build.bash

100644100755
File mode changed.

decoder/devices_and_points.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package decoder
22

33
import (
44
"errors"
5+
56
"github.com/NubeIO/module-core-loraraw/schema"
67
"github.com/NubeIO/nubeio-rubix-lib-models-go/model"
8+
79
"strings"
810
)
911

@@ -80,6 +82,13 @@ var LoRaDeviceDescriptions = [...]LoRaDeviceDescription{
8082
Decode: DecodeZHT,
8183
GetPointNames: GetZHTPointNames,
8284
},
85+
{
86+
DeviceName: "Rubix",
87+
Model: schema.DeviceModelRubix,
88+
CheckLength: CheckPayloadLengthRubix,
89+
Decode: DecodeRubix,
90+
GetPointNames: GetRubixPointNames,
91+
},
8392
}
8493

8594
func GetDeviceDescription(device *model.Device) *LoRaDeviceDescription {

0 commit comments

Comments
 (0)