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 can47 * An AT command statement is requested before sending it. The following steps have to be done for67 * le_atClient_SetFinalResponse() are the first characters of the response lines. They are used as a72 * '>' character to receive additional information. The given text is sent to the modem when '>' is78 * When the AT command declaration is complete, it can be sent using le_atClient_Send(). This API is81 * le_atClient_SetCommandAndSend() is equivalent to le_atClient_Create(), le_atClient_SetCommand(),94 * - le_atClient_GetFirstIntermediateResponse() is used to get the first intermediate result code.96 * le_atClient_GetNextIntermediateResponse().Returns LE_NOT_FOUND when there are no further results.98 * When a response has been set in the AT command declaration, the AT command response returned by109 * le_atClient_RemoveUnsolicitedResponseHandler(). The subscribed handler is called when the given110 * pattern is detected. The handler receives a parameter with the complete line of the unsolicited143 //--------------------------------------------------------------------------------------------------147 //--------------------------------------------------------------------------------------------------150 //--------------------------------------------------------------------------------------------------153 * Connect the current client thread to the service providing this API. Block until the service is156 * For each thread that wants to use this API, either ConnectService or TryConnectService must be157 * called before any other functions in this API. Normally, ConnectService is automatically called162 //--------------------------------------------------------------------------------------------------168 //--------------------------------------------------------------------------------------------------171 * Try to connect the current client thread to the service providing this API. Return with an error174 * For each thread that wants to use this API, either ConnectService or TryConnectService must be175 * called before any other functions in this API. Normally, ConnectService is automatically called184 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).187 //--------------------------------------------------------------------------------------------------193 //--------------------------------------------------------------------------------------------------197 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants200 //--------------------------------------------------------------------------------------------------207 //--------------------------------------------------------------------------------------------------213 * longer a connection to the service, and the functions in this API can't be used. For details, see218 //--------------------------------------------------------------------------------------------------225 //--------------------------------------------------------------------------------------------------228 //--------------------------------------------------------------------------------------------------232 //--------------------------------------------------------------------------------------------------235 //--------------------------------------------------------------------------------------------------239 //--------------------------------------------------------------------------------------------------243 //--------------------------------------------------------------------------------------------------244 typedef struct le_atClient_UnsolicitedResponseHandler* le_atClient_UnsolicitedResponseHandlerRef_t;247 //--------------------------------------------------------------------------------------------------252 //--------------------------------------------------------------------------------------------------254 (261 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------274 //--------------------------------------------------------------------------------------------------282 //--------------------------------------------------------------------------------------------------289 //--------------------------------------------------------------------------------------------------295 //--------------------------------------------------------------------------------------------------301 //--------------------------------------------------------------------------------------------------311 //--------------------------------------------------------------------------------------------------318 //--------------------------------------------------------------------------------------------------328 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------347 * @note If the AT Command reference or set intermediate response is invalid, a fatal error occurs,350 //--------------------------------------------------------------------------------------------------359 //--------------------------------------------------------------------------------------------------362 * Several final responses can be specified separated by a '|' character into the string given in372 //--------------------------------------------------------------------------------------------------381 //--------------------------------------------------------------------------------------------------392 //--------------------------------------------------------------------------------------------------401 //--------------------------------------------------------------------------------------------------411 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------431 //--------------------------------------------------------------------------------------------------440 //--------------------------------------------------------------------------------------------------452 //--------------------------------------------------------------------------------------------------459 //--------------------------------------------------------------------------------------------------470 //--------------------------------------------------------------------------------------------------481 //--------------------------------------------------------------------------------------------------492 //--------------------------------------------------------------------------------------------------504 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------545 //--------------------------------------------------------------------------------------------------562 //--------------------------------------------------------------------------------------------------570 //--------------------------------------------------------------------------------------------------586 //--------------------------------------------------------------------------------------------------590 //--------------------------------------------------------------------------------------------------struct le_atClient_UnsolicitedResponseHandler * le_atClient_UnsolicitedResponseHandlerRef_tDefinition: le_atClient_interface.h:244le_result_t le_atClient_SetCommand(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL command)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_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_atClient_DeviceRef_t le_atClient_Start(int fd)le_result_t le_atClient_Delete(le_atClient_CmdRef_t cmdRef)le_result_t le_atClient_SetFinalResponse(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL response)le_result_t le_atClient_Stop(le_atClient_DeviceRef_t device)le_result_t le_atClient_Send(le_atClient_CmdRef_t cmdRef)void le_atClient_RemoveUnsolicitedResponseHandler(le_atClient_UnsolicitedResponseHandlerRef_t handlerRef)le_result_t le_atClient_SetIntermediateResponse(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL intermediate)le_result_t le_atClient_SetTimeout(le_atClient_CmdRef_t cmdRef, uint32_t timer)void(* le_atClient_UnsolicitedResponseHandlerFunc_t)(const char *LE_NONNULL unsolicitedRsp, void *contextPtr)Definition: le_atClient_interface.h:254le_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_GetFinalResponse(le_atClient_CmdRef_t cmdRef, char *finalRsp, size_t finalRspSize)void le_atClient_SetServerDisconnectHandler(le_atClient_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_atClient_GetNextIntermediateResponse(le_atClient_CmdRef_t cmdRef, char *intermediateRsp, size_t intermediateRspSize)void le_atClient_ConnectService(void)void(* le_atClient_DisconnectHandler_t)(void *)Definition: le_atClient_interface.h:148le_result_t le_atClient_TryConnectService(void)le_result_t le_atClient_SetDevice(le_atClient_CmdRef_t cmdRef, le_atClient_DeviceRef_t devRef)le_result_t le_atClient_SetText(le_atClient_CmdRef_t cmdRef, const char *LE_NONNULL text)