Cellular: Added explanatory comment for AT cellular stack's socket_open routine

pull/9752/head
Mirela Chirica 2019-02-19 10:18:08 +02:00
parent 31da50e8fa
commit 9ddb843cc8
1 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,12 @@ protected: // NetworkStack
*/ */
virtual nsapi_error_t socket_stack_init(); virtual nsapi_error_t socket_stack_init();
/**
* Note: Socket_open does not actually open socket on all drivers, but that's deferred until calling `sendto`.
* The reason is that IP stack implementations are very much modem specific and it's quite common that when a
* socket is created (via AT commands) it must also be given remote IP address, and that is usually known
* only when calling `sendto`.
*/
virtual nsapi_error_t socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto); virtual nsapi_error_t socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto);
virtual nsapi_error_t socket_close(nsapi_socket_t handle); virtual nsapi_error_t socket_close(nsapi_socket_t handle);