Skip to content

Commit 5b3633a

Browse files
authored
docs: add at driver warnings (estkme-group#385)
* docs: add at driver warnings * chore(CMake): disable APDU AT backend by default * refactor(driver/at): replace warning message macro with function * docs(at): refine warning messages for clarity and consistency * refactor(at): move warning message implementation to at_helpers.c * docs(at): update warning messages for clarity and compliance with ETSI TS 127 007
1 parent 53ca000 commit 5b3633a

7 files changed

Lines changed: 41 additions & 4 deletions

File tree

.github/scripts/build-ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cd "$BUILD"
1919

2020
case "${1:-}" in
2121
make)
22-
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON
22+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DLPAC_WITH_APDU_AT=ON
2323
make -j VERBOSE=1
2424
make DESTDIR="$PKGDIR" install
2525
copy-license "$PKGDIR/executables"

docs/backends/at.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
# AT APDU Backend
22

3-
The AT Backend is used to communicate with the eUICC via AT commands over a serial interface.
4-
It is commonly used with cellular modems that support AT commands for SIM card management.
3+
> [!CAUTION]
4+
>
5+
> **FOR DEMO PURPOSES ONLY.**
6+
>
7+
> Only requests that strictly follow the [ETSI TS 127 007] specification are supported. \
8+
> Requests outside the specification will be **REJECTED**.
9+
>
10+
> Some operations (e.g: download, delete, etc.), may fail due to insufficient response time. \
11+
> The Maximum Response Time is typically 300ms, which is insufficient for many eUICC operations.
12+
13+
The AT Backend is used to communicate with the eUICC via AT commands over a serial port. \
14+
It is commonly used with cellular modems that support AT commands for eUICC management.
15+
16+
Not all cellular modems support the required AT commands for eUICC management. \
17+
Please refer to your modem's documentation to verify compatibility.
18+
19+
[ETSI TS 127 007]: https://www.etsi.org/deliver/etsi_ts/127000_127099/127007/15.02.00_60/ts_127007v150200p.pdf
520

621
## Unix-like platform
722

driver/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
option(LPAC_WITH_APDU_PCSC "Build APDU PCSC Backend (requires PCSC libraries)" ON)
2-
option(LPAC_WITH_APDU_AT "Build APDU AT Backend" ON)
2+
option(LPAC_WITH_APDU_AT "Build APDU AT Backend" OFF)
33
option(LPAC_WITH_APDU_GBINDER "Build APDU Gbinder backend for libhybris devices (requires gbinder headers)" OFF)
44
option(LPAC_WITH_APDU_QMI "Build QMI backend for Qualcomm devices (requires libqmi)" OFF)
55
option(LPAC_WITH_APDU_QMI_QRTR "Build QMI-over-QRTR backend for Qualcomm devices (requires libqrtr and libqmi headers)" OFF)
@@ -68,6 +68,8 @@ if (LPAC_WITH_APDU_PCSC)
6868
endif ()
6969

7070
if (LPAC_WITH_APDU_AT)
71+
message(WARNING "LPAC_WITH_APDU_AT is NO LONGER MAINTAINED and maybe REMOVED in future releases.")
72+
7173
function(add_at_driver target_name extra_sources)
7274
add_library(${target_name} SHARED
7375
${CMAKE_CURRENT_SOURCE_DIR}/apdu/at_helpers.c

driver/apdu/at_etsi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ static void apdu_interface_logic_channel_close(struct euicc_ctx *ctx, const uint
137137
}
138138

139139
static int libapduinterface_init(struct euicc_apdu_interface *ifstruct) {
140+
at_warning_message();
141+
140142
set_deprecated_env_name(ENV_AT_DEBUG, "AT_DEBUG");
141143
set_deprecated_env_name(ENV_AT_DEVICE, "AT_DEVICE");
142144

driver/apdu/at_etsi_csim.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ static void apdu_interface_logic_channel_close(struct euicc_ctx *ctx, const uint
141141
}
142142

143143
static int libapduinterface_init(struct euicc_apdu_interface *ifstruct) {
144+
at_warning_message();
145+
144146
set_deprecated_env_name(ENV_AT_DEBUG, "AT_DEBUG");
145147
set_deprecated_env_name(ENV_AT_DEVICE, "AT_DEVICE");
146148

driver/apdu/at_helpers.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,22 @@
44
#include <string.h>
55

66
#include "at_helpers.h"
7+
78
#include <lpac/utils.h>
9+
#include <unistd.h>
10+
11+
inline void at_warning_message(void) {
12+
static char *message =
13+
"WARNING: AT driver is for demo purposes only.\n"
14+
"WARNING: AT driver strictly complies with \"ETSI TS 127 007\" specification.\n"
15+
"WARNING: Some operations (e.g: download, delete, etc.), may fail due to insufficient response time.\n";
16+
17+
if (isatty(fileno(stdin))) {
18+
fprintf(stderr, "\033[0;31m%s\033[0m", message);
19+
} else {
20+
fprintf(stderr, "%s", message);
21+
}
22+
}
823

924
char *at_channel_get(struct at_userdata *userdata, const int index) {
1025
if (index <= 0 || index > AT_MAX_LOGICAL_CHANNELS)

driver/apdu/at_helpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "at_cmd.h"
44

5+
void at_warning_message(void);
56
char *at_channel_get(struct at_userdata *userdata, int index);
67
int at_channel_set(struct at_userdata *userdata, int index, const char *identifier);
78
int at_channel_next_id(struct at_userdata *userdata);

0 commit comments

Comments
 (0)