From 9ddb843cc860d3861b37c7b5eedb4b55487c17e2 Mon Sep 17 00:00:00 2001 From: Mirela Chirica Date: Tue, 19 Feb 2019 10:18:08 +0200 Subject: [PATCH] Cellular: Added explanatory comment for AT cellular stack's socket_open routine --- features/cellular/framework/AT/AT_CellularStack.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/cellular/framework/AT/AT_CellularStack.h b/features/cellular/framework/AT/AT_CellularStack.h index 8ce5764665..0efa77bb20 100644 --- a/features/cellular/framework/AT/AT_CellularStack.h +++ b/features/cellular/framework/AT/AT_CellularStack.h @@ -52,6 +52,12 @@ protected: // NetworkStack */ 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_close(nsapi_socket_t handle);