Compare commits

...

5 Commits

Author SHA1 Message Date
Alexandre Bard c2a8409b7c Fix SRC_URI 2022-08-03 15:06:56 +02:00
Alexandre Bard 496ad0cb8b lpa: Use wwan0 name instead of ttyACM 2022-08-02 12:32:12 +02:00
Alexandre Bard 932a090d2e lpa: patch toby driver 2022-08-02 12:32:12 +02:00
Alexandre Bard c1ea8a92b5 lpa: Remove dependencies to nmutils
These are only necessary for NRSW_LICENSING
2022-08-02 12:32:12 +02:00
Alexandre Bard 4c58068741 lpa: Add NRSW base recipe 2022-08-02 12:32:12 +02:00
4 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 31805f2263c2b3d5fc9198bcb90327715ee05b99 Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
Date: Tue, 14 Jun 2022 11:37:12 +0200
Subject: [PATCH] Fix segfault accessing a null pointer
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
---
sdk/LPA_SDK/src/driver/semedia_toby.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sdk/LPA_SDK/src/driver/semedia_toby.c b/sdk/LPA_SDK/src/driver/semedia_toby.c
index 6bf98ff..c7ef2f9 100644
--- a/sdk/LPA_SDK/src/driver/semedia_toby.c
+++ b/sdk/LPA_SDK/src/driver/semedia_toby.c
@@ -1009,9 +1009,12 @@ abort:
bool _seMediaTobyGetReaderInfo(const char *ptrReaderName, LPA_READER_MANUFACTURER *pManufacturer,
LPA_READER_TYPE *pType, bool *pForceChannelOne)
{
- *pManufacturer = LPA_READER_MANUFACTURER_UBLOX;
- *pType = LPA_READER_TYPE_UBLOX_TOBY_L2;
- *pForceChannelOne = false;
+ if (pManufacturer)
+ *pManufacturer = LPA_READER_MANUFACTURER_UBLOX;
+ if (pType)
+ *pType = LPA_READER_TYPE_UBLOX_TOBY_L2;
+ if (pForceChannelOne)
+ *pForceChannelOne = false;
return true;
}

View File

@ -0,0 +1,27 @@
From 250608dddbae09268fdfe726e823e186a94b89f0 Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
Date: Tue, 14 Jun 2022 15:44:26 +0200
Subject: [PATCH] semedia_toby: Fix serial reading
Several str* commands were used but the end of string marker was never
set, leading to overflows and other errors. Especially since the buffer
was never cleaned.
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
---
sdk/LPA_SDK/src/driver/semedia_toby.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sdk/LPA_SDK/src/driver/semedia_toby.c b/sdk/LPA_SDK/src/driver/semedia_toby.c
index c7ef2f9..167438b 100644
--- a/sdk/LPA_SDK/src/driver/semedia_toby.c
+++ b/sdk/LPA_SDK/src/driver/semedia_toby.c
@@ -961,6 +961,8 @@ bool _seMediaTobyRunAtCommand(const char *ptrReaderName,
lpaCoreLogAppend(SDK_LOG_LEVEL_ERROR, "_seMediaTobyRunAtCommand(): response too long!");
goto abort;
}
+ /* End of string marker */
+ *pResp = '\0';
}
}

View File

@ -0,0 +1,26 @@
From 74353e1b74fd96433613378d3216c54f0a7754e2 Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
Date: Tue, 14 Jun 2022 16:17:16 +0200
Subject: [PATCH] toby: Use wwan0 as device name
Since the name is anyway hardcoded, let's use the standard netmodule
name.
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
---
sdk/LPA_SDK/src/driver/semedia_toby.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/LPA_SDK/src/driver/semedia_toby.c b/sdk/LPA_SDK/src/driver/semedia_toby.c
index 167438b..674593b 100644
--- a/sdk/LPA_SDK/src/driver/semedia_toby.c
+++ b/sdk/LPA_SDK/src/driver/semedia_toby.c
@@ -89,7 +89,7 @@ static char responseBuffer[TOBY_RESPONSE_BUFFER_SIZE];
// Modem parameters
// Note: Modem name is here only used in _seMediaTobyListReader() for dummy list generation. So appear useless in future development
-#define GM_SERIAL_PORT_NAME "/dev/ttyACM0" // u-blox Toby
+#define GM_SERIAL_PORT_NAME "/dev/wwan0" // u-blox Toby
// For parameters definition see termios.h
// cflag parameters:

View File

@ -0,0 +1,33 @@
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
SRC_URI = "git://gitea@git.netmodule.intranet/NRSW/lpa.git;branch=sdk_1.6;protocol=ssh"
PV = "1.0+git${SRCPV}"
SRCREV = "454007f13a713943ae1caff6704d889fde06c1c2"
S = "${WORKDIR}/git"
DEPENDS = "curl openssl"
EXTRA_OEMAKE_append = "-j 1 SEMEDIA_TYPE=toby"
TARGET_CC_ARCH += "${LDFLAGS}"
inherit autotools-brokensep
do_install () {
install -d ${D}${libdir}
install -d ${D}${datadir}/lpa
install -m 755 ${B}/sdk/liblpa.so.1.0.0 ${D}${libdir}
ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so.1
ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so
install -d ${D}${bindir}
install -m 755 ${B}/lpa/lpa ${D}${bindir}/
install -m 644 ${B}/certs/CI-cert_NIST.crt ${D}${datadir}/lpa/
install -m 644 ${B}/certs/GSMA_CE_TEST_CI.crt ${D}${datadir}/lpa/
install -m 644 ${B}/certs/GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/
ln -sf GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/default.crt
}
FILES_${PN} += "${bindir}/* ${libdir}/*.so*"