logo ← Lib TLS / Manual de funções - Single Thread

Manual de funções - Single Thread

Chamadas de Funções Single-Thread da Lib TLS

Fonte: Chamadas de Métodos Lib TLS - GSURF


GSURF_ERRORSSL gsurf_init_ssl(char *appDataDir, char *uuid);

Descrição:\
Inicializa a biblioteca SSL. Retorna GSURF_ERRORSSL.

Parâmetros:


GSURF_ERRORSSL gsurf_connect_ssl(const char *serviceName, const char *host);

Descrição:\
Estabelece conexão SSL com o serviço desejado. Retorna GSURF_ERRORSSL.

Parâmetros:


GSURF_ERRORSSL gsurf_read_ssl(void *buffer, unsigned int bufferLength, int *bytesProcessed);

Descrição:\
Lê dados enviados pelo servidor. Retorna GSURF_ERRORSSL.

Parâmetros:


GSURF_ERRORSSL gsurf_write_ssl(void *buffer, unsigned int bufferLength, int *bytesProcessed);

Descrição:\
Envia dados para o servidor. Retorna GSURF_ERRORSSL.

Parâmetros:


GSURF_ERRORSSL gsurf_disconnect_ssl();

Descrição:\
Encerra a conexão SSL com o servidor. Retorna GSURF_ERRORSSL.


GSURF_ERRORSSL gsurf_install_certificate_ssl(char *activationKey, unsigned int activationKeyLength, char *otp, unsigned int otpLength);

Descrição:\
Instala o certificado no dispositivo. Retorna GSURF_ERRORSSL.

Parâmetros:


void gsurf_free_ssl();

Descrição:\
Libera a memória alocada pela biblioteca GSurf.


void gsurf_set_cb_trace(GSURF_CB_TRACE cb_trace);

Descrição:\
Define o callback que será chamado para registro de logs. A configuração desse callback é opcional.

Parâmetros:

Assinatura da função de callback:

```c
void (GSURF_CB_TRACE)(const char title, int lenghtBuffer, const char *buffer);