Base64 encoding/decoding of socket sent/received data - #BASE. Telit Wireless Solutions LE910
광고
광고
Telit LE910 V2 Series AT Commands
80446ST10707A Rev . 0– 2015-11-03
Base64 encoding/decoding of socket sent/received data - #BASE64
#BASE64 – Base64 encoding/decoding of socket sent/received data
AT#BASE64=
SELINT 2
Set command enables base64 encoding and/or decoding of data
<connId>,<enc>,<dec>
[,<unused_B > sent/received to/from the socket in online or in command mode.
[,<unused_C >]] Parameters:
<connId>
1..6
- socket connection identifier
<enc>
0 – no encoding of data received from serial port.
1 - MIME RFC2045 base64 encoding of data received from serial port that have to be sent to <connId> socket.
Note: as indicated from RFC2045 the encoded output stream is represented in lines of no more than 76 characters each.
Lines are defined as sequences of octets separated by a CRLF sequence.
2 - RFC 3548 base64 encoding of data received from serial port that have to be sent to <connId> socket.
Note: as indicated from RFC3548 CRLF have not to be added.
<dec>
0 – no decoding of data received from socket <connId>.
1 - MIME RFC2045 base64 decoding of data received from socket <connId> and sent to serial port.
(Same rule as for <enc> regarding line feeds in the received file that has to be decoded)
2 - RFC3548 base64 decoding of data received from socket
<connId> and sent to serial port.
(Same rule as for <enc> regarding line feeds in the received file that has to be decoded)
Note: it is possible to use command to change current
<enc>/<dec> settings for a socket already opened in command mode or in online mode after suspending it.
(In this last case obviously it is necessary to set
AT#SKIPESC=1).
Note: to use #BASE64 in command mode, if data to send exceed maximum value for #SSENDEXT command, they have to be divided in multiple parts.
Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved
Mod. 0808 2011-07 Rev.2
page 356 of 509
AT#BASE64?
AT#BASE64=?
Example
Telit LE910 V2 Series AT Commands
80446ST10707A Rev . 0– 2015-11-03
These parts have to be a multiple of 57 bytes, except for the last one, to distinguish EOF condition.
(Base64 encoding rules)
For the same reason if #SRECV command is used by the application to receive data, a multiple of 78 bytes has to be considered.
Note: to use #SRECV to receive data with <dec> enabled, it is necessary to consider that: reading <maxByte> bytes from socket, user will get less due to decoding that is performed.
Note: values are automatically saved in NVM.
Read command returns the current <enc>/<dec> settings for all the six sockets, in the format:
#BASE64:<connId1><enc1>,<dec1>,0,0<CR><LF>
. . .
#BASE64:<connId6>,<enc6>,<dec6>,0,0<CR><LF>
Test command returns the range of supported values for all the subparameters.
AT#SKIPESC=1
OK
AT#SD=<connId>,<txProt>,<rPort>,<IPaddr>
CONNECT
//Data sent without modifications(default)
………
+++ (suspension)
OK at#base64=<connId>,1,0
OK
AT#SO=<connId>
CONNECT
// Data received from serial port are encoded
// base64 before to be sent on the socket
………………
+++ (suspension)
OK at#base64=<connId>,0,1
OK
Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved
Mod. 0808 2011-07 Rev.2
page 357 of 509
Telit LE910 V2 Series AT Commands
80446ST10707A Rev . 0– 2015-11-03
AT#SO=<connId>
CONNECT
// Data received from socket are decoded
// base64 before to be sent on the serial port
+++ (suspension)
…………………
Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved
Mod. 0808 2011-07 Rev.2
page 358 of 509
다운로드
광고