mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Cellular: Implement APN authentication for BG96
							parent
							
								
									fb899d2cc1
								
							
						
					
					
						commit
						4698cd268d
					
				| 
						 | 
				
			
			@ -111,3 +111,24 @@ nsapi_error_t QUECTEL_BG96_CellularNetwork::set_access_technology_impl(RadioAcce
 | 
			
		|||
 | 
			
		||||
    return _at.unlock_return_error();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nsapi_error_t QUECTEL_BG96_CellularNetwork::do_user_authentication()
 | 
			
		||||
{
 | 
			
		||||
    if (_pwd && _uname) {
 | 
			
		||||
        _at.cmd_start("AT+QICSGP=");
 | 
			
		||||
        _at.write_int(_cid);
 | 
			
		||||
        _at.write_int(1); // IPv4
 | 
			
		||||
        _at.write_string(_apn);
 | 
			
		||||
        _at.write_string(_uname);
 | 
			
		||||
        _at.write_string(_pwd);
 | 
			
		||||
        _at.write_int(_authentication_type);
 | 
			
		||||
        _at.cmd_stop();
 | 
			
		||||
        _at.resp_start();
 | 
			
		||||
        _at.resp_stop();
 | 
			
		||||
        if (_at.get_last_error() != NSAPI_ERROR_OK) {
 | 
			
		||||
            return NSAPI_ERROR_AUTH_FAILURE;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return NSAPI_ERROR_OK;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,6 +33,8 @@ protected:
 | 
			
		|||
    virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology opRat);
 | 
			
		||||
 | 
			
		||||
    virtual bool get_modem_stack_type(nsapi_ip_stack_t requested_stack);
 | 
			
		||||
 | 
			
		||||
    virtual nsapi_error_t do_user_authentication();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace mbed
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue