> 10.7 | AT^SISR Internet Service Read Data

> The AT^SISR command either triggers a read operation (download) or queries the number of bytes in the internal buffer.
> The AT^SISR write command may return the following errors:

> • | "+CME ERROR: operation failed" if there is a problem on application, socket, PPP or GPRS/GSM level. The AT^SISE command and the "^SIS" URC offer additional error information.

> • | "+CME ERROR: operation temporary not allowed" e.g. if the service has not network resources allocated.

> • | "+CME ERROR: operation not allowed" e.g. if the service is not configured.

> Syntax

> Test Command AT^SISR=?
> Response(s)
> OK

> Write Command AT^SISR=<srvProfileId>, <reqReadLength>
> Response(s)
> ^SISR: <srvProfileId>, <cnfReadLength>[, <remainUdpPacketLength>[, <optServParm>]]
> Number of data bytes are sent as specified by <cnfReadLength>. If peek operator was used no data bytes are sent.
> OK
> ERROR
> +CME ERROR: <err>

> PIN |  | ASC0 | ASC1 | USB | MUX1 | MUX2 | MUX3 |  |  | Charge | Q | Last
> ± |  | + | + | + | + | + | + |  |  | - | - | +

> Unsolicited Result Code
> ^SISR: <srvProfileId>, <urcCauseId>
> Data availability status of the Internet service configured with AT^SISS has changed. The URC is issued when:

> • | data is available after opening an Internet service or

> • | less data was confirmed (in <cnfReadLength>) than requested (with <reqReadLength>) during the last "Read Data" operation and new data is available.

> The URC is disabled in polling mode. See AT^SCFG, parameter "Tcp/WithURCs", <tcpWithUrc>.
> Parameter Description

> <srvProfileId>(num)

> <srvProfileId> 0 ... 9 specified with AT^SISS.

> <reqReadLength>(num)

> 0
> Peek Operator: Query number of received bytes within internal buffers.
> The behaviour of the peek operator depends on the selected Internet service, i.e. it may not be supported by all IP Services.
> For "Socket" service configured for UDP the size of the next available UDP packet is returned.
> 1...1500
> Requested number of data bytes to be read via the Internet service specified in <srvProfileId>.

> <cnfReadLength>(num)

> -2
> Indicates end of data. Data transfer has been finished (all data have been read) and the service can be closed with AT^SISC.
> -1
> Applies only to HTTP: Querying number of available bytes is not supported by the HTTP service.
> 0
> Indicates that no further data is available at the moment.
> >0
> Number of available data bytes. The range is determined by <reqReadLength>:
> If <reqReadLength> was greater than 0, then <cnfReadLength> may be less or equal to the value requested with <reqReadLength>.
> If <reqReadLength> equals 0 (peek operator) the value indicated by <cnfReadLength> may be greater than 1500.

> <urcCauseId>(num)

> Indicates whether or not data is available for reading with AT^SISR.
> 1
> Data is available and can be read by sending the AT^SISR command. The URC appears when less data was confirmed (in <cnfReadLength>) than requested (with <reqReadLength>) during the last "Read Data" operation and new data is available.
> 2
> End of data. Data transfer has completed (all data read). The service can be closed with AT^SISC.

> <remainUdpPacketLength>(num)

> Optional third parameter of the AT^SISR write command response displayed only if the Socket service uses the UDP protocol.
> The reception of each datagram must be completed before the next datagram can be received. This may be a problem if the buffer of the hostapplication is limited and not designed to handle the maximum packet size of 1500 bytes. To compensate this, the host is advised to request, via <reqReadLength>, an amount less or equal its maxmimum buffer capacity and wait for the resulting AT^SISR write command response with parameter <remainUdpPacketLength>. The benefit of this approach is that the host may properly receive all parts of a UDP datagram, as after each received data part the number of remaining bytes is synchronized, until reading the datagram is finished.
> If the currently read datagram is smaller than the number of bytes requested by the host the <remainUdpPacketLength> parameter is omitted.
> Further write attempts with AT^SISR are denied as long as the <remainUdpPacketLength> is unequal 0 or is not omitted. In this case the service returns "+CME ERROR: operation of service temporary not allowed".
> 0
> Indicates that all bytes of the current UDP datagram are read.
> 1...(max. data size)-1
> Indicates that the currently read UDP datagram is not yet complete. The displayed value is the remaining number of bytes.
> <remainUdpPacketLength> is unequal 0 until reading all parts of the current datagram is finished.

> <optServParm>(str)

> Service specific parameter of the AT^SISR write command response. If the Socket service is configured as UDP endpoint this parameter returns the IP address and the UDP port of the remote host that has sent the current UDP data.