le_data_interface.h
Go to the documentation of this file.
18 * A data connection is needed for applications that exchange data with devices where SMS messages19 * are insufficient or not possible. The data connection can be established over a mobile network,22 * The data connection service provides a basic API for requesting and releasing a data connection.27 * removed. A data connection request will no longer ensure that the radio is on, or verify that the35 * be called indicating it's now connected. The interface name is sent only when the data connection37 * called with the new state. To release a data connection, an application can use le_data_Release().41 * If the default data connection is not currently available when le_data_Request() is called, the42 * data connection service first ensures all pre-conditions are satisfied (e.g., modem is registered46 * connection will not be started. Instead, the existing data connection will be used. This happens52 * transmitting data when the state is connected, and should stop transmitting data when the state54 * establish or re-establish the connection endlessly until le_data_Release() is called. There's no58 * le_data_Release(). The data connection will be released only after le_data_Release() is called by61 * @note When using the cellular technology, the data connection service can use a specific cellular64 * retrieved by le_data_GetCellularProfileIndex(). The profile to use is loaded when the first data91 * @note The default route activation status can be retrieved with le_data_GetDefaultRouteStatus().96 * A sample code showing how to set the modem default route if it isn't set by the data connection98 * @snippet "apps/test/dataConnectionService/dataConnectionServiceRouteTest/dcsRouteTestComp/dcsRouteTest.c" DefaultRoute117 * one in the list is used for the default data connection. If the connection is also unavailable132 * and @c r+n+1. Technologies with ranks under @c r are not impacted. If the technology is already140 * @warning To get the date and time, use GetDateTime rather than sequential calls to GetDate and144 * When the data connection service is connected, the date and time can be retrieved from a distant145 * server using le_data_GetDate() and le_data_GetTime(). The time protocol and time server to use153 * <tt> time.nist.gov </tt> for @ref LE_DATA_TP and to <tt> pool.ntp.org </tt> for @ref LE_DATA_NTP.155 * @note The configured time protocol needs to be supported by your platform to be used by the data226 //--------------------------------------------------------------------------------------------------230 //--------------------------------------------------------------------------------------------------233 //--------------------------------------------------------------------------------------------------236 * Connect the current client thread to the service providing this API. Block until the service is239 * For each thread that wants to use this API, either ConnectService or TryConnectService must be240 * called before any other functions in this API. Normally, ConnectService is automatically called245 //--------------------------------------------------------------------------------------------------251 //--------------------------------------------------------------------------------------------------254 * Try to connect the current client thread to the service providing this API. Return with an error257 * For each thread that wants to use this API, either ConnectService or TryConnectService must be258 * called before any other functions in this API. Normally, ConnectService is automatically called267 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).270 //--------------------------------------------------------------------------------------------------276 //--------------------------------------------------------------------------------------------------280 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants283 //--------------------------------------------------------------------------------------------------290 //--------------------------------------------------------------------------------------------------296 * longer a connection to the service, and the functions in this API can't be used. For details, see301 //--------------------------------------------------------------------------------------------------308 //--------------------------------------------------------------------------------------------------312 //--------------------------------------------------------------------------------------------------315 //--------------------------------------------------------------------------------------------------319 //--------------------------------------------------------------------------------------------------322 //--------------------------------------------------------------------------------------------------326 //--------------------------------------------------------------------------------------------------329 //--------------------------------------------------------------------------------------------------333 //--------------------------------------------------------------------------------------------------336 //--------------------------------------------------------------------------------------------------340 //--------------------------------------------------------------------------------------------------343 //--------------------------------------------------------------------------------------------------349 //--------------------------------------------------------------------------------------------------358 //--------------------------------------------------------------------------------------------------362 //--------------------------------------------------------------------------------------------------369 //--------------------------------------------------------------------------------------------------373 * @deprecated The DCS functionality to populate the default APN name into the cellular channel's382 //--------------------------------------------------------------------------------------------------388 //--------------------------------------------------------------------------------------------------392 //--------------------------------------------------------------------------------------------------399 //--------------------------------------------------------------------------------------------------408 //--------------------------------------------------------------------------------------------------417 //--------------------------------------------------------------------------------------------------424 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------443 //--------------------------------------------------------------------------------------------------452 //--------------------------------------------------------------------------------------------------458 //--------------------------------------------------------------------------------------------------466 //--------------------------------------------------------------------------------------------------472 //--------------------------------------------------------------------------------------------------487 //--------------------------------------------------------------------------------------------------495 //--------------------------------------------------------------------------------------------------497 * Delete a route on the data connection service interface, if the data session is connected using510 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------520 * Get the cellular profile index used by the data connection service when the cellular technology526 //--------------------------------------------------------------------------------------------------532 //--------------------------------------------------------------------------------------------------534 * Set the cellular profile index used by the data connection service when the cellular technology542 //--------------------------------------------------------------------------------------------------549 //--------------------------------------------------------------------------------------------------553 * @warning To get the date and time, use GetDateTime rather than sequential calls to GetDate and563 //--------------------------------------------------------------------------------------------------574 //--------------------------------------------------------------------------------------------------578 * @warning To get the date and time, use GetDateTime rather than sequential calls to GetDate and588 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------612 //--------------------------------------------------------------------------------------------------le_result_t le_data_GetDate(uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)void le_data_ConnectService(void)void le_data_Release(le_data_RequestObjRef_t requestRef)LE_FULL_API void le_data_SetServerDisconnectHandler(le_data_DisconnectHandler_t disconnectHandler, void *contextPtr)le_data_RequestObjRef_t le_data_Request(void)le_result_t le_data_GetDateTime(uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr, uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)void le_data_RemoveConnectionStateHandler(le_data_ConnectionStateHandlerRef_t handlerRef)le_result_t le_data_SetTechnologyRank(uint32_t rank, le_data_Technology_t technology)le_data_Technology_t le_data_GetNextUsedTechnology(void)le_result_t le_data_AddRoute(const char *LE_NONNULL ipDestAddrStr)int32_t le_data_GetCellularProfileIndex(void)le_result_t le_data_TryConnectService(void)void le_data_DisconnectService(void)le_result_t le_data_GetTime(uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)le_result_t le_data_SetCellularProfileIndex(int32_t profileIndex)le_data_Technology_t le_data_GetTechnology(void)le_result_t le_data_DelRoute(const char *LE_NONNULL ipDestAddrStr)void(* le_data_DisconnectHandler_t)(void *)Definition: le_data_interface.h:231bool le_data_GetDefaultRouteStatus(void)le_data_Technology_t le_data_GetFirstUsedTechnology(void)le_data_ConnectionStateHandlerRef_t le_data_AddConnectionStateHandler(le_data_ConnectionStateHandlerFunc_t handlerPtr, void *contextPtr)