Syntax
VM_RESULT vm_gsm_gprs_hold_bearer(
    VM_GSM_GPRS_HANDLE_TYPE handle_type, 
    VMINT handle
);
ContentsIndex
PreviousUpNext
vm_gsm_gprs_hold_bearer
Example
Syntax
VM_RESULT vm_gsm_gprs_hold_bearer(
    VM_GSM_GPRS_HANDLE_TYPE handle_type, 
    VMINT handle
);
Description

This function holds the bearer.

Parameters
Parameters 
Description 
VMINT handle 
[IN] TCP : handle = vm_tcp_connect
type 
UDP 
handle = vm_udp_create
HTTP 
handle = vm_http_get_current_handle. handle = vm_http_fetch_handle. 
HTTPS 
This uses the channel ID which is attained from the vm_https_set_channel_response_callback
Example
 static VMINT g_tcp_hd;

 void connection_manager(VMBOOL connect){
     if(connect){
         g_tcp_hd = vm_tcp_connect("http://www.mediatek.com", 80, VM_BEARER_DATA_ACCOUNT_TYPE_GPRS_NONE_PROXY_APN, tcp_cb);
     }
     else{
         vm_gsm_gprs_release_bearer();
     }
 }

 void tcp_cb(VMINT handle, VMINT event)
 {
     VMINT ret = 0;
     if (VM_TCP_EVENT_CONNECTED == event || VM_TCP_EVENT_CAN_WRITE == event)
     {
         ret = vm_gprs_hold_bearer(VM_GSM_GPRS_HANDLE_TYPE_TCP, handle);
         ret = vm_tcp_write(handle, "GET / HTTP/1.1rnHOST:www.mediate.com:80rnrn", strlen("GET / HTTP/1.1rnHOST:www.mediate.com:80rnrn"));
     }
     if (VM_TCP_EVENT_CAN_READ == event)
     {
         VMCHAR buf[2048] = {0};
         ret = vm_tcp_read(handle, buf, 2048);
         vm_tcp_close(handle);
     }
 }
File

vmgsm_gprs.h

Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.