/* ping-pong heartbeat type: 0 - disable 1 - send ping frame but don't check pong frame 2 - send ping frame and check pong frame  */
int uvoice_ws_heartbeat_set(int type)
/* ping-pong heartbeat type: 0 - disable 1 - send ping frame but don't check pong frame 2 - send ping frame and check pong frame  */
int uvoice_ws_heartbeat_set(int type)
{
	ws_handler_t *handler = g_ws_handler;
	if (!handler) {
		M_LOGE("ws handler null !\n");
		return -1;
	}
	if (type < 0 || type > 2) {
		M_LOGE("type %d invalid !\n", type);
		return -1;
	}
	if (handler->heartbeat_type != type) {
		handler->heartbeat_type = type;
		M_LOGD("set heartbeat_type %d\n",
			handler->heartbeat_type);
	}
	return 0;
}