openHiTLS API openHiTLS 0.1.0-Alpha1

◆ HITLS_Read()

int32_t HITLS_Read ( HITLS_Ctx ctx,
uint8_t *  data,
uint32_t  bufSize,
uint32_t *  readLen 
)

Read application data

注意
Only the application data decrypted by one record can be read by HiTLS at a time HiTLS copies the application data to the input cache. If the cache size is less than 16 KB, the maximum size of the application message decrypted by a single record is 16 KB. This will result in a partial copy of the application data You can call HITLS_GetReadPendingBytes to obtain the size of the remaining readable application data in the current record. This is useful in DTLS scenarios.
参数
ctx[IN] TLS context
data[OUT] Read data
bufSize[IN] Size of the buffer
readLen[OUT] Read length
返回值
HITLS_SUCCESS,ifsuccessful
HITLS_REC_NORMAL_RECV_BUF_EMPTY,recordThe receiving buffer is NULL and can be read again.
HITLS_REC_NORMAL_IO_BUSY,thenetwork I/O is busy and needs to wait for the next sending You can continue to read the I/O.
Forother error codes, see hitls_error.h.