_ .-') _ _ .-') ('-. .-') _ ( ( OO) ) ( \( -O ) ( OO ).-. ( OO) ) \ .'_ ,------. / . --. / ,------. / '._ ,`'--..._) | /`. ' | \-. \ ('-| _.---' |'--...__) | | \ ' | / | | .-'-' | | (OO|(_\ '--. .--' | | ' | | |_.' | \| |_.' | / | '--. | | | | / : | . '.' | .-. | \_)| .--' | | | '--' / | |\ \ | | | | \| |_) | | `-------' `--' '--' `--' `--' `--' `--'
1. Data transfer from PDM
Proposal how to transfer data from PDM without necessity to open second port and use binary transfer.
2. Log transfer
2.1. Work flow
-
User express intention to download logs
-
Q: PM needs to define where and how.
-
-
PDM control will request via keep alive, log download.
-
PDM sends [negative, persistent, INFO] MNR100 to indicate that logs will be transferred at some time in future.
-
PDM sends [positive, OK] MNR102 to indicate finished log transfer.
2.2. Log query
To define which logs to download, mnemonic LRQ (Log Range Query) will be used. It contains JSON data which defines which part of log file is required to transfer.
{
from:"2020-01-10T12:53:11.120",
to:"2020-01-10T13:27:46.547",
level:1,(1)
components:["SysError","SdCard"]
}
1 | at least this level and higher |
WIW53;LRQ{from:"2020-01-10T12:53:11.120", to:"2020-01-10T13:27:46.547", level:1, components:["SysError","SdCard"]}
2.3. Log transfer
Log entries will be transferred same way as they are now. Each record will be written to the database. User can then browse the logs in UI or export them as usually.
PSA00056; GAC09020; DTM2021-02-25T08:41:00; VER7.5.4.78; PID1300A48DE5; KEE; KAI0005; OPI{M:M17520 72,0 UMTS, SD:0x00, WU:47774 Bat:{a:12.6,n:12.5}}; DBG[{"cat":"CardPay","level":"1","time":"08:40:27.953","msg":"08637 TransID C:5434xxxxxxxx5017 32130056 00010063 436891 Am:400"}];
Please note, that DBG
mnemonic can contain multiple entries.
3. Configuration transfer
3.1. Workflow
-
User somehow express intention to download configuration.
-
PDM confirms the request by [negative, persistent, INFO] MNR103 that configuration data will be downloaded in future.
-
After transfer PDM sends [positive, OK] MNR104
3.2. Data transfer
Current version of protocol does not allow to transfer binary data in the direction PDM → Control. However a binary data converted to Base64 can be transferred without any problem. Because configuration files are relatively small and they will be rarely transferred, the overhead generated by Base64 should not be a problem. Then configuration data can be transferred like this.
{
part:{
content: "config",(1)
encoding: "base64"(2)
nr: 1,
total: 2,
crc: "12AB"
},
data:"SGksIEknbSBQRE03IGNvbmZpZ3VyYXRpb24="
}
1 | May be not needed in the first step. |
2 | Encoding of data. Use + for multiple. E.g. gzip+base64 means: at first was applied gzip and then base64 . |
Captured data will be stored to the database to the database and provided to the user for download.