le_atClient_interface.h
Go to the documentation of this file.
17 * @warning Some AT commands may conflict with Legato APIs; using both may cause problems that can40 * le_atClient_Start() must be called to bind a specific device with the ATClient, the user app must52 * An AT command statement is requested before sending it. The following steps have to be done for72 * le_atClient_SetFinalResponse() are the first characters of the response lines. They are used as a77 * '>' character to receive additional information. The given text is sent to the modem when '>' is83 * When the AT command declaration is complete, it can be sent using le_atClient_Send(). This API is86 * le_atClient_SetCommandAndSend() is equivalent to le_atClient_Create(), le_atClient_SetCommand(),99 * - le_atClient_GetFirstIntermediateResponse() is used to get the first intermediate result code.101 * le_atClient_GetNextIntermediateResponse().Returns LE_NOT_FOUND when there are no further results.103 * When a response has been set in the AT command declaration, the AT command response returned by114 * le_atClient_RemoveUnsolicitedResponseHandler(). The subscribed handler is called when the given115 * pattern is detected. The handler receives a parameter with the complete line of the unsolicited148 //--------------------------------------------------------------------------------------------------152 //--------------------------------------------------------------------------------------------------155 //--------------------------------------------------------------------------------------------------158 * Connect the current client thread to the service providing this API. Block until the service is161 * For each thread that wants to use this API, either ConnectService or TryConnectService must be162 * called before any other functions in this API. Normally, ConnectService is automatically called167 //--------------------------------------------------------------------------------------------------173 //--------------------------------------------------------------------------------------------------176 * Try to connect the current client thread to the service providing this API. Return with an error179 * For each thread that wants to use this API, either ConnectService or TryConnectService must be180 * called before any other functions in this API. Normally, ConnectService is automatically called189 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).192 //--------------------------------------------------------------------------------------------------198 //--------------------------------------------------------------------------------------------------202 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants205 //--------------------------------------------------------------------------------------------------212 //--------------------------------------------------------------------------------------------------218 * longer a connection to the service, and the functions in this API can't be used. For details, see223 //--------------------------------------------------------------------------------------------------230 //--------------------------------------------------------------------------------------------------233 //--------------------------------------------------------------------------------------------------237 //--------------------------------------------------------------------------------------------------240 //--------------------------------------------------------------------------------------------------244 //--------------------------------------------------------------------------------------------------248 //--------------------------------------------------------------------------------------------------249 typedef struct le_atClient_UnsolicitedResponseHandler* le_atClient_UnsolicitedResponseHandlerRef_t;252 //--------------------------------------------------------------------------------------------------257 //--------------------------------------------------------------------------------------------------259 (266 //--------------------------------------------------------------------------------------------------272 //--------------------------------------------------------------------------------------------------279 //--------------------------------------------------------------------------------------------------287 //--------------------------------------------------------------------------------------------------294 //--------------------------------------------------------------------------------------------------300 //--------------------------------------------------------------------------------------------------306 //--------------------------------------------------------------------------------------------------316 //--------------------------------------------------------------------------------------------------323 //--------------------------------------------------------------------------------------------------333 //--------------------------------------------------------------------------------------------------342 //--------------------------------------------------------------------------------------------------352 * @note If the AT Command reference or set intermediate response is invalid, a fatal error occurs,355 //--------------------------------------------------------------------------------------------------364 //--------------------------------------------------------------------------------------------------367 * Several final responses can be specified separated by a '|' character into the string given in377 //--------------------------------------------------------------------------------------------------386 //--------------------------------------------------------------------------------------------------397 //--------------------------------------------------------------------------------------------------406 //--------------------------------------------------------------------------------------------------416 //--------------------------------------------------------------------------------------------------425 //--------------------------------------------------------------------------------------------------436 //--------------------------------------------------------------------------------------------------445 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------464 //--------------------------------------------------------------------------------------------------475 //--------------------------------------------------------------------------------------------------486 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------509 //--------------------------------------------------------------------------------------------------520 //--------------------------------------------------------------------------------------------------531 //--------------------------------------------------------------------------------------------------550 //--------------------------------------------------------------------------------------------------567 //--------------------------------------------------------------------------------------------------575 //--------------------------------------------------------------------------------------------------591 //--------------------------------------------------------------------------------------------------595 //--------------------------------------------------------------------------------------------------le_result_t le_atClient_TryConnectService(void)le_atClient_UnsolicitedResponseHandlerRef_t le_atClient_AddUnsolicitedResponseHandler(const char *LE_NONNULL unsolRsp, le_atClient_DeviceRef_t devRef, le_atClient_UnsolicitedResponseHandlerFunc_t handlerPtr, void *contextPtr, uint32_t lineCount)le_result_t le_atClient_SetTimeout(le_atClient_CmdRef_t cmdRef, uint32_t timer)le_result_t le_atClient_SetText(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL text)void le_atClient_SetServerDisconnectHandler(le_atClient_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_atClient_SetIntermediateResponse(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL intermediate)void(* le_atClient_UnsolicitedResponseHandlerFunc_t)(const char *LE_NONNULL unsolicitedRsp, void *contextPtr)Definition: le_atClient_interface.h:259le_result_t le_atClient_Delete(le_atClient_CmdRef_t cmdRef)le_atClient_DeviceRef_t le_atClient_Start(int fd)le_result_t le_atClient_GetNextIntermediateResponse(le_atClient_CmdRef_t cmdRef, char *intermediateRsp, size_t intermediateRspSize)void(* le_atClient_DisconnectHandler_t)(void *)Definition: le_atClient_interface.h:153le_result_t le_atClient_SetDevice(le_atClient_CmdRef_t cmdRef, le_atClient_DeviceRef_t devRef)struct le_atClient_UnsolicitedResponseHandler * le_atClient_UnsolicitedResponseHandlerRef_tDefinition: le_atClient_interface.h:249le_result_t le_atClient_SetCommandAndSend(le_atClient_CmdRef_t *cmdRefPtr, le_atClient_DeviceRef_t devRef, const char *LE_NONNULL command, const char *LE_NONNULL interResp, const char *LE_NONNULL finalResp, uint32_t timeout)le_atClient_CmdRef_t le_atClient_Create(void)le_result_t le_atClient_GetFinalResponse(le_atClient_CmdRef_t cmdRef, char *finalRsp, size_t finalRspSize)le_result_t le_atClient_Send(le_atClient_CmdRef_t cmdRef)le_result_t le_atClient_Stop(le_atClient_DeviceRef_t device)void le_atClient_RemoveUnsolicitedResponseHandler(le_atClient_UnsolicitedResponseHandlerRef_t handlerRef)le_result_t le_atClient_SetFinalResponse(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL response)void le_atClient_ConnectService(void)le_result_t le_atClient_GetFirstIntermediateResponse(le_atClient_CmdRef_t cmdRef, char *intermediateRsp, size_t intermediateRspSize)void le_atClient_DisconnectService(void)le_result_t le_atClient_SetCommand(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL command)