<commit_before>/*
 * Copyright (C) 2014-2016 Wilddog Technologies. All Rights Reserved. 
 *
 * FileName: wilddog_conn.c
 *
 * Description: connection functions.
 *
 * History:
 * Version      Author          Date        Description
 *
 * 0.4.0        lxs       2015-05-15  Create file.
 *
 */
 
#ifndef WILDDOG_PORT_TYPE_ESP   
#include <stdio.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "wilddog_payload.h"
     
#include "utlist.h"
#include "wilddog_config.h"
#include "wilddog.h"
#include "wilddog_conn_coap.h"
#include "wilddog_debug.h"
#include "wilddog_conn.h"
#include "wilddog_store.h"
#include "wilddog_common.h"
#include "wilddog_port.h"
#include "wilddog_url_parser.h"
#include "wilddog_payload.h"
#include "wilddog_api.h"
#include "test_lib.h"

#define DIFF(a,b)       ((a>b)?(a-b):(b-a))
#define RESP_IS_ERR(err)        ( err>= 400)

#define CB_NO_SERVERERR(err)    ((err)< WILDDOG_HTTP_INTERNAL_SERVER_ERR )
#define CB_IS_NORESPONSE(err)   ((err) == WILDDOG_ERR_RECVTIMEOUT)
#define _GETBYTE_H(b)   ((b>>4)&0x0f)        
#define _GETBYTE_L(b)   (b&0x0f)

#define WILDDOG_OBSERVE_REQ (0X01)          /* observer sign*/
#define WILDDOG_OBSERVE_WAITNOTIF (0X11)

#define FIRSTRTRANSMIT_INV  (2000)/* retransmit cover (FIRSTRTRANSMIT_INV**n) */
#define WILDDOG_PING_INTERVAL 60000 

typedef enum _CONN_BOOT_T{
    WILDDOG_CONN_FALSE,
    WILDDOG_CONN_TRUE,
}_Conn_Boot_T;

typedef enum _CONN_OBSERVE_FLAG_T{
    WILDDOG_Conn_Observe_Req =0x01,
    WILDDOG_Conn_Observe_Notif =0x11,
}_Conn_Observe_Flag_T;

typedef enum _CONN_AUTH_STATE{
    
    WILDDOG_CONN_AUTH_NOAUTH,<commit_msg>update ping interval to 50s<commit_after>/*
 * Copyright (C) 2014-2016 Wilddog Technologies. All Rights Reserved. 
 *
 * FileName: wilddog_conn.c
 *
 * Description: connection functions.
 *
 * History:
 * Version      Author          Date        Description
 *
 * 0.4.0        lxs       2015-05-15  Create file.
 *
 */
 
#ifndef WILDDOG_PORT_TYPE_ESP   
#include <stdio.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "wilddog_payload.h"
     
#include "utlist.h"
#include "wilddog_config.h"
#include "wilddog.h"
#include "wilddog_conn_coap.h"
#include "wilddog_debug.h"
#include "wilddog_conn.h"
#include "wilddog_store.h"
#include "wilddog_common.h"
#include "wilddog_port.h"
#include "wilddog_url_parser.h"
#include "wilddog_payload.h"
#include "wilddog_api.h"
#include "test_lib.h"

#define DIFF(a,b)       ((a>b)?(a-b):(b-a))
#define RESP_IS_ERR(err)        ( err>= 400)

#define CB_NO_SERVERERR(err)    ((err)< WILDDOG_HTTP_INTERNAL_SERVER_ERR )
#define CB_IS_NORESPONSE(err)   ((err) == WILDDOG_ERR_RECVTIMEOUT)
#define _GETBYTE_H(b)   ((b>>4)&0x0f)        
#define _GETBYTE_L(b)   (b&0x0f)

#define WILDDOG_OBSERVE_REQ (0X01)          /* observer sign*/
#define WILDDOG_OBSERVE_WAITNOTIF (0X11)

#define FIRSTRTRANSMIT_INV  (2000)/* retransmit cover (FIRSTRTRANSMIT_INV**n) */
#define WILDDOG_PING_INTERVAL 50000 

typedef enum _CONN_BOOT_T{
    WILDDOG_CONN_FALSE,
    WILDDOG_CONN_TRUE,
}_Conn_Boot_T;

typedef enum _CONN_OBSERVE_FLAG_T{
    WILDDOG_Conn_Observe_Req =0x01,
    WILDDOG_Conn_Observe_Notif =0x11,
}_Conn_Observe_Flag_T;

typedef enum _CONN_AUTH_STATE{
    
    WILDDOG_CONN_AUTH_NOAUTH,
{'fraction_non_alphanumeric': 0.12136222910216718, 'fraction_numerical': 0.030340557275541795, 'mean_word_length': 4.340495867768595, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6568621', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1347, 'n_words': 237}