le_atServer_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_atServer AT Commands Server
14  *
15  * @ref le_atServer_interface.h "API Reference"
16  *
17  * The AT commands Server handles AT commands' subscriptions on a requested serial device. The
18  * server is compliant with 3GPP 27.007, paragraphs 4.0, 4.1 and 4.2, and V25 ter, paragraphs 5.3,
19  * 5.4.
20  *
21  * @section le_atServer_binding IPC interfaces binding
22  *
23  * All the functions of this API are provided by the @b atService.
24  *
25  * Here's a code sample binding to the AT commands server:
26  * @verbatim
27  bindings:
28  {
29  atServerTest.atServerTestComp.le_atServer -> atService.le_atServer
30  }
31  @endverbatim
32  *
33  * @section atServer_syntax AT command syntax
34  *
35  * @subsection atServer_Syntax Syntax rules
36  *
37  * To be interpreted, the command line sent to the AT commands server must start by the pattern
38  * "AT" (mean ATtention command).<br>
39  * Lowercase characters are changed to their uppercase equivalents. Only characters between quotes
40  * are not replaced.
41  *
42  * The supported command formats are:
43  * - Basic syntax command:
44  * - using the format AT<command>[<number>]<br>
45  * The command name is composed of one or several of those characters: A to Z, & and \\.
46  * - the syntax of S command is also supported, like:
47  * - ATS<parameter_number>?
48  * - ATS<parameter_number>=<value>
49  * - D command is supported. The characters which don't belong to the following list are
50  * ignore:
51  * - V.250 dialing digits: 0 1 2 3 4 5 6 7 8 9 * # + A B C D
52  * - V.250 modifier characters: , T P ! W @
53  * - V.250 semicolon character: ;
54  * - GSM/UMTS modifier characters:
55  * - I or i for CLIR supplementary service subscription
56  * (I=invocation, i=suppression)
57  * - G or g for CUG supplementary service subscription (G=invocation,
58  * g=suppression)
59  * - Direct dialing from phonebook: > (if follow by a string, it has to be put
60  * between quote)
61  * .
62  * @if 0 doxygen comment: The dot above ends the sub item, and must be kept @endif
63  * All characters after the "D" are considered part of The D command parameter up to a semicolon or
64  * the end of command line.
65  * <br>
66  * - Extended command format, with the following format:
67  * - action command with no parameters: AT+<name>
68  * - parameter command: AT+<name>=<value1>[,<value2>[,<value3>[...]]]<br>
69  * Values must be separated by a coma. Some values may be optional: in that case, optional
70  * value can be omitted in the AT command (e.g. AT+ABCD=,1).<br>
71  * A value is a string composed of one or several of the following characters: 0 to 9,
72  * A to F, H, z*, #, +, -. To set a value with other characters, the value has to be set
73  * between quote.
74  * - test command (determine the supported values): AT+<name>=?
75  * - read command (determine the current values, or stored values): AT+<name>?
76  *
77  * @note '+' AT command starting character shall be replaced by other symbol, not included into
78  * a to z, A to Z, & and \\.
79  *
80  * @subsection atServer_concate Concatenating commands
81  *
82  * Basic syntax command can be concatenated without a separator:<br>
83  * ATE1V1S95=47S0=0
84  *
85  * Additional commands (extended syntax command or basic syntax command) can be added after an
86  * extended syntax command with the insertion of a semicolon at the end of the command:<br>
87  * AT+CMDA=<param1>,<param2>;+CMDB?;+CMDC=?<br>
88  * AT+CMDA=<param1>,<param2>;E1V1
89  *
90  * Extended syntax command can be concatenated after basic syntax commands without a separator:<br>
91  * ATE1V1+CMD=<param1>
92  *
93  * @section atServer_binding Device Binding
94  *
95  * le_atServer_Start() must be called to bind the file descriptor of the device with the AT commands
96  * server. Note that a socket can also be bound.
97  * Multiple devices can be bound.
98  * A file descriptor can be unbound using le_atServer_Stop().
99  *
100  * The server can be suspended using le_atServer_Suspend() in order to use the
101  * opened fd for other purposes like starting a PPP service on the opened fd.
102  * For that a fd dup needs to be done before opening a server session.
103  * When needed, the server can be resumed using le_atServer_Resume(). Make sure
104  * to close the fd when the application exists or you may get too many open files error.
105  *
106  * used before opening a server session
107  * @section atServer_subscription Subscription
108  *
109  * A new AT command can be added into the parser using le_atServer_Create(), and it can be deleted
110  * using le_atServer_Delete().
111  * le_atServer_EnableEcho() allows the user to enable echo on a selected device.
112  * le_atServer_DisableEcho() allows the user to disable echo on a selected device.
113  *
114  * le_atServer_EnableExtendedErrorCodes() allows the user to use extended error
115  * codes on a selected device.
116  * le_atServer_DisableExtendedErrorCodes() allows the user to disable extended
117  * error codes on a selected device.
118  *
119  * @section atServer_handler Handler
120  *
121  * To handle the AT command, the application has to subscribe a handler using
122  * le_atServer_AddCommandHandler(). It can be removed with le_atServer_RemoveCommandHandler().<br>
123  * The called handler (le_atServer_CommandHandlerRef_t prototype) can use
124  * le_atServer_GetCommandName() to retrieve the received AT command string.<br>
125  * The device used to execute the AT command can be retrieve thanks to le_atServer_GetDevice().<br>
126  * It can also call le_atServer_GetParameter() to retrieve parameters of the AT command. This
127  * function gets the string sending through the AT command. If the parameter was sent between
128  * quotes, the quotes are removed. This API can be used for both formats:
129  * - In case of a basic format command, if exists, the parameter can be retrieved at the index 0.<br>
130  * For S command specific format (ATS<parameter_number>=<value>), the <parameter_number> is
131  * retrieved at the index 0, the <value> parameter at the index 1.
132  *
133  * - In case of an extended format command, parameters are retrieved thanks to their indexes,
134  * starting from 0. If the parameter is missed (e.g. "AT+CMD=,1"), the getting value is an empty
135  * string (i.e. '\0' with null length).
136  *
137  * The handler receives in argument the type of the AT command (of le_atServer_Type_t type).
138  * Even if these types are specific to the extended format commands according to the standards, they
139  * are also applicable here to basic format commands to detect commands with parameters, or read
140  * values (e.g. ATS<parameter_number>?).
141  *
142  * @section atServer_responses Responses
143  *
144  * @subsection intermediateRsp Intermediate response
145  *
146  * The application has can send intermediate responses through
147  * le_atServer_SendIntermediateResponse().
148  *
149  * @subsection finalRsp Final response
150  *
151  * In all cases, the application must send a final response using
152  * le_atServer_SendFinalResponse(). The corresponding device will be locked until the final response
153  * is sent.
154  *
155  * If no answer is sent, the device will not accept any new AT commands (an error will be
156  * returned).
157  *
158  * le_atServer_SendFinalResponse() has to inform of the result thanks to the argument of
159  * le_atServer_FinalRsp_t type. This argument permits to the AT command Server to:
160  * - create the result string if no custom string is provided
161  * - continue or stop the parsing of concatenated commands: if one command is failed, next commands
162  * are not executed, the final result of the concatenated AT command is the last error.
163  *
164  * @subsection unsolicitedRsp Unsolicited response
165  *
166  * The application can also send unsolicited responses to warn a host
167  * application using le_atServer_SendUnsolicitedResponse().
168  *
169  * This response is sent when no AT command is being processing on the device (i.e. unsolicited
170  * response is sent between the latest final response and the next reception of an AT command).<br>
171  * If an unsolicited response is sent when an AT command is in progress, the unsolicited response
172  * is buffered and sent as soon as the device becomes available (i.e., the processing AT command
173  * sends its final response).
174  *
175  * @section Text
176  *
177  * le_atServer_GetTextAsync() allows the user to register a le_atServer_GetTextCallback_t callback
178  * to retrieve text and sends a prompt <CR><LF><greater_than><SPACE> on the current command's
179  * device.
180  *
181  * It will receive at max LE_ATSERVER_TEXT_MAX_LEN bytes.
182  * If Esc Key is hit then the command is canceled and an empty buffer is returned with result
183  * set to LE_OK.
184  * If Ctrl+z is hit then the received buffer is returned and the result is set to LE_OK.
185  * In case of a read error, an empty buffer is returned with result set to LE_IO_ERROR;
186  *
187  * Example:
188  *
189  * AT+CMGS="+85291234567"
190  * > <ESC>
191  *
192  * OK
193  *
194  * AT+CMGS="+85291234567"
195  * > It is easy to send text messages. <CTRL-Z>
196  * +CMGS: 5
197  *
198  * OK
199  *
200  * @section atServer_bridge Bridge
201  *
202  * A second file descriptor can be used thanks to le_atServer_OpenBridge() to send
203  * all unknown AT commands to an altervative device (such as the modem). For all devices linked to
204  * that bridge using le_atServer_AddDeviceToBridge(), unknown commands will be sent through that file
205  * descriptor.
206  *
207  * @image html atCommandsParserBridge.png
208  *
209  * @note AT commands server is opened on the file descriptor fd1 using le_atServer_Open() API.
210  * AT commands server is bridged on the file descriptor fd2 using le_atServer_OpenBridge() API.
211  *
212  * A device can be remove from a bridge thanks to le_atServer_RemoveDeviceFromBridge() API.
213  * A bridge can be closed using le_atServer_CloseBridge() API.
214  *
215  * @warning Some modem AT commands may conflict with Legato APIs; using both may cause problems that
216  * can be difficult to diagnose. The modem AT commands should be avoided whenever possible, and
217  * should only be used with great care.
218  *
219  * The application can send an unsolicited on all opened device, or only one on a dedicated deivce.
220  *
221  * <HR>
222  *
223  * Copyright (C) Sierra Wireless Inc.
224  */
225 /**
226  * @file le_atServer_interface.h
227  *
228  * Legato @ref c_atServer include file.
229  *
230  * Copyright (C) Sierra Wireless Inc.
231  */
232 
233 #ifndef LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
234 #define LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
235 
236 
237 #include "legato.h"
238 
239 // Interface specific includes
240 #include "le_atDefs_interface.h"
241 
242 
243 //--------------------------------------------------------------------------------------------------
244 /**
245  * Type for handler called when a server disconnects.
246  */
247 //--------------------------------------------------------------------------------------------------
248 typedef void (*le_atServer_DisconnectHandler_t)(void *);
249 
250 //--------------------------------------------------------------------------------------------------
251 /**
252  *
253  * Connect the current client thread to the service providing this API. Block until the service is
254  * available.
255  *
256  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
257  * called before any other functions in this API. Normally, ConnectService is automatically called
258  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
259  *
260  * This function is created automatically.
261  */
262 //--------------------------------------------------------------------------------------------------
264 (
265  void
266 );
267 
268 //--------------------------------------------------------------------------------------------------
269 /**
270  *
271  * Try to connect the current client thread to the service providing this API. Return with an error
272  * if the service is not available.
273  *
274  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
275  * called before any other functions in this API. Normally, ConnectService is automatically called
276  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
277  *
278  * This function is created automatically.
279  *
280  * @return
281  * - LE_OK if the client connected successfully to the service.
282  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
283  * bound.
284  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
285  * - LE_COMM_ERROR if the Service Directory cannot be reached.
286  */
287 //--------------------------------------------------------------------------------------------------
289 (
290  void
291 );
292 
293 //--------------------------------------------------------------------------------------------------
294 /**
295  * Set handler called when server disconnection is detected.
296  *
297  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
298  * to continue without exiting, it should call longjmp() from inside the handler.
299  */
300 //--------------------------------------------------------------------------------------------------
302 (
303  le_atServer_DisconnectHandler_t disconnectHandler,
304  void *contextPtr
305 );
306 
307 //--------------------------------------------------------------------------------------------------
308 /**
309  *
310  * Disconnect the current client thread from the service providing this API.
311  *
312  * Normally, this function doesn't need to be called. After this function is called, there's no
313  * longer a connection to the service, and the functions in this API can't be used. For details, see
314  * @ref apiFilesC_client.
315  *
316  * This function is created automatically.
317  */
318 //--------------------------------------------------------------------------------------------------
320 (
321  void
322 );
323 
324 
325 //--------------------------------------------------------------------------------------------------
326 /**
327  * Maximum text length.
328  */
329 //--------------------------------------------------------------------------------------------------
330 #define LE_ATSERVER_TEXT_MAX_LEN 4096
331 
332 //--------------------------------------------------------------------------------------------------
333 /**
334  * Reference type for an AT command.
335  */
336 //--------------------------------------------------------------------------------------------------
337 typedef struct le_atServer_Cmd* le_atServer_CmdRef_t;
338 
339 
340 //--------------------------------------------------------------------------------------------------
341 /**
342  * Reference type for a AT command device.
343  */
344 //--------------------------------------------------------------------------------------------------
345 typedef struct le_atServer_Device* le_atServer_DeviceRef_t;
346 
347 
348 //--------------------------------------------------------------------------------------------------
349 /**
350  * Reference type for a AT commands server / AT commands client bridge.
351  */
352 //--------------------------------------------------------------------------------------------------
353 typedef struct le_atServer_Bridge* le_atServer_BridgeRef_t;
354 
355 
356 //--------------------------------------------------------------------------------------------------
357 /**
358  * Received AT command type.
359  *
360  */
361 //--------------------------------------------------------------------------------------------------
362 typedef enum
363 {
365  ///< Action AT command (e.g. 'AT+CMD')
367  ///< AT command received with parameters (e.g. 'AT+CMD=x,y')
369  ///< Test AT command (e.g. 'AT+CMD=?')
371  ///< Read AT command (e.g. 'AT+CMD?')
372 }
374 
375 
376 //--------------------------------------------------------------------------------------------------
377 /**
378  * Final response.
379  */
380 //--------------------------------------------------------------------------------------------------
381 typedef enum
382 {
384  ///< AT command successfully treated, "\r\nOK\r\n" is sent if no custom
385  ///< response is set
387  ///< error in AT command treatement, "\r\nERROR\r\n" is sent if no custom
388  ///< response is set
389 }
391 
392 
393 //--------------------------------------------------------------------------------------------------
394 /**
395  * Device availability.
396  */
397 //--------------------------------------------------------------------------------------------------
398 typedef enum
399 {
401  ///< action will be done on all bound devices
403  ///< action will be done on a specified device
404 }
406 
407 
408 //--------------------------------------------------------------------------------------------------
409 /**
410  * Reference type used by Add/Remove functions for EVENT 'le_atServer_Command'
411  */
412 //--------------------------------------------------------------------------------------------------
413 typedef struct le_atServer_CommandHandler* le_atServer_CommandHandlerRef_t;
414 
415 
416 //--------------------------------------------------------------------------------------------------
417 /**
418  * Handler for the AT command processing.
419  *
420  * @note The argument "parametersNumber" is set only when "type" parameter value is
421  * LE_AT_SERVER_TYPE_PARA
422  */
423 //--------------------------------------------------------------------------------------------------
424 typedef void (*le_atServer_CommandHandlerFunc_t)
425 (
426  le_atServer_CmdRef_t commandRef,
427  ///< Received AT command reference
428  le_atServer_Type_t type,
429  ///< Received AT command type
430  uint32_t parametersNumber,
431  ///< Parameters number
432  void* contextPtr
433  ///<
434 );
435 
436 //--------------------------------------------------------------------------------------------------
437 /**
438  * Get text callback
439  *
440  * @return
441  * - LE_OK: The function succeeded
442  * - LE_IO_ERROR: An io error happened and the function couldn't read from the device
443  */
444 //--------------------------------------------------------------------------------------------------
445 typedef void (*le_atServer_GetTextCallbackFunc_t)
446 (
447  le_atServer_CmdRef_t cmdRef,
448  ///< Received AT command reference
449  le_result_t result,
450  ///< Result
451  const char* LE_NONNULL text,
452  ///< Received text
453  uint32_t len,
454  ///< Text length
455  void* contextPtr
456  ///<
457 );
458 
459 //--------------------------------------------------------------------------------------------------
460 /**
461  * Suspend server / enter data mode
462  *
463  * When this function is called the server stops monitoring the fd for events
464  * hence no more I/O operations are done on the fd by the server.
465  *
466  * @return
467  * - LE_OK Success.
468  * - LE_BAD_PARAMETER Invalid device reference.
469  * - LE_FAULT Device not monitored
470  *
471  */
472 //--------------------------------------------------------------------------------------------------
474 (
476  ///< [IN] device to be suspended
477 );
478 
479 //--------------------------------------------------------------------------------------------------
480 /**
481  * Resume server / enter command mode
482  *
483  * When this function is called the server resumes monitoring the fd for events
484  * and is able to interpret AT commands again.
485  *
486  * @return
487  * - LE_OK Success.
488  * - LE_BAD_PARAMETER Invalid device reference.
489  * - LE_FAULT Device not monitored
490  *
491  */
492 //--------------------------------------------------------------------------------------------------
494 (
496  ///< [IN] device to be resumed
497 );
498 
499 //--------------------------------------------------------------------------------------------------
500 /**
501  * This function opens an AT server session on the requested device.
502  *
503  * @return
504  * - Reference to the requested device.
505  * - NULL if the device is not available or fd is a BAD FILE DESCRIPTOR.
506  *
507  * @note Make sure to duplicate (man dup) your file descriptor before opening
508  * a server session to be able to use the suspend/resume feature
509  *
510  */
511 //--------------------------------------------------------------------------------------------------
513 (
514  int fd
515  ///< [IN] File descriptor.
516 );
517 
518 //--------------------------------------------------------------------------------------------------
519 /**
520  * This function closes the AT server session on the requested device.
521  *
522  * @return
523  * - LE_OK The function succeeded.
524  * - LE_BAD_PARAMETER Invalid device reference.
525  * - LE_BUSY The requested device is busy.
526  * - LE_FAULT Failed to stop the server, check logs
527  * for more information.
528  */
529 //--------------------------------------------------------------------------------------------------
531 (
533  ///< [IN] device to be unbound
534 );
535 
536 //--------------------------------------------------------------------------------------------------
537 /**
538  * This function created an AT command and register it into the AT parser.
539  *
540  * @return
541  * - Reference to the AT command.
542  * - NULL if an error occurs.
543  */
544 //--------------------------------------------------------------------------------------------------
546 (
547  const char* LE_NONNULL name
548  ///< [IN] AT command name string
549 );
550 
551 //--------------------------------------------------------------------------------------------------
552 /**
553  * This function deletes an AT command (i.e. unregister from the AT parser).
554  *
555  * @return
556  * - LE_OK The function succeeded.
557  * - LE_FAULT The function failed to delete the command.
558  * - LE_BUSY Command is in progress.
559  *
560  */
561 //--------------------------------------------------------------------------------------------------
563 (
564  le_atServer_CmdRef_t commandRef
565  ///< [IN] AT command reference
566 );
567 
568 //--------------------------------------------------------------------------------------------------
569 /**
570  * Add handler function for EVENT 'le_atServer_Command'
571  *
572  * This event provides information when the AT command is detected.
573  *
574  */
575 //--------------------------------------------------------------------------------------------------
577 (
578  le_atServer_CmdRef_t commandRef,
579  ///< [IN] AT command reference
581  ///< [IN] Handler to called when the AT command is detected
582  void* contextPtr
583  ///< [IN]
584 );
585 
586 //--------------------------------------------------------------------------------------------------
587 /**
588  * Remove handler function for EVENT 'le_atServer_Command'
589  */
590 //--------------------------------------------------------------------------------------------------
592 (
594  ///< [IN]
595 );
596 
597 //--------------------------------------------------------------------------------------------------
598 /**
599  * This function can be used to get the parameters of a received AT command.
600  *
601  * @return
602  * - LE_OK The function succeeded.
603  * - LE_FAULT The function failed to get the requested parameter.
604  *
605  */
606 //--------------------------------------------------------------------------------------------------
608 (
609  le_atServer_CmdRef_t commandRef,
610  ///< [IN] AT command reference
611  uint32_t index,
612  ///< [IN] agument index
613  char* parameter,
614  ///< [OUT] parameter value
615  size_t parameterSize
616  ///< [IN]
617 );
618 
619 //--------------------------------------------------------------------------------------------------
620 /**
621  * This function can be used to get the AT command string.
622  *
623  * @return
624  * - LE_OK The function succeeded.
625  * - LE_FAULT The function failed to get the AT command string.
626  *
627  */
628 //--------------------------------------------------------------------------------------------------
630 (
631  le_atServer_CmdRef_t commandRef,
632  ///< [IN] AT command reference
633  char* name,
634  ///< [OUT] AT command string
635  size_t nameSize
636  ///< [IN]
637 );
638 
639 //--------------------------------------------------------------------------------------------------
640 /**
641  * This function can be used to get the device reference in use for an AT command specified with
642  * its reference.
643  *
644  * @return
645  * - LE_OK The function succeeded.
646  * - LE_FAULT The function failed to get the AT command string.
647  *
648  */
649 //--------------------------------------------------------------------------------------------------
651 (
652  le_atServer_CmdRef_t commandRef,
653  ///< [IN] AT command reference
654  le_atServer_DeviceRef_t* deviceRefPtr
655  ///< [OUT] Device reference
656 );
657 
658 //--------------------------------------------------------------------------------------------------
659 /**
660  * This function can be used to send an intermediate response.
661  *
662  * @return
663  * - LE_OK The function succeeded.
664  * - LE_FAULT The function failed to send the intermediate response.
665  *
666  */
667 //--------------------------------------------------------------------------------------------------
669 (
670  le_atServer_CmdRef_t commandRef,
671  ///< [IN] AT command reference
672  const char* LE_NONNULL intermediateRsp
673  ///< [IN] Intermediate response to be
674  ///< sent
675 );
676 
677 //--------------------------------------------------------------------------------------------------
678 /**
679  * This function can be used to send the final response.
680  *
681  * @return
682  * - LE_OK The function succeeded.
683  * - LE_FAULT The function failed to send the final response.
684  *
685  */
686 //--------------------------------------------------------------------------------------------------
688 (
689  le_atServer_CmdRef_t commandRef,
690  ///< [IN] AT command reference
691  le_atServer_FinalRsp_t finalResponse,
692  ///< [IN] Final response to be sent
693  bool customStringAvailable,
694  ///< [IN] Custom final response has to be sent
695  ///< instead of the default one.
696  const char* LE_NONNULL finalRsp
697  ///< [IN] custom final response string
698 );
699 
700 //--------------------------------------------------------------------------------------------------
701 /**
702  * This function can be used to send the unsolicited response.
703  *
704  * @return
705  * - LE_OK The function succeeded.
706  * - LE_FAULT The function failed to send the unsolicited response.
707  *
708  */
709 //--------------------------------------------------------------------------------------------------
711 (
712  const char* LE_NONNULL unsolRsp,
713  ///< [IN] Unsolicited response to be
714  ///< sent
715  le_atServer_AvailableDevice_t availableDevice,
716  ///< [IN] device to send the
717  ///< unsolicited response
719  ///< [IN] device reference where the
720  ///< unsolicited response has to
721  ///< be sent
722 );
723 
724 //--------------------------------------------------------------------------------------------------
725 /**
726  * This function enables echo on the selected device.
727  *
728  * @return
729  * - LE_OK The function succeeded.
730  * - LE_BAD_PARAMETER Invalid device reference.
731  */
732 //--------------------------------------------------------------------------------------------------
734 (
736  ///< [IN] device reference
737 );
738 
739 //--------------------------------------------------------------------------------------------------
740 /**
741  * This function disables echo on the selected device.
742  *
743  * @return
744  * - LE_OK The function succeeded.
745  * - LE_BAD_PARAMETER Invalid device reference.
746  */
747 //--------------------------------------------------------------------------------------------------
749 (
751  ///< [IN] device reference
752 );
753 
754 //--------------------------------------------------------------------------------------------------
755 /**
756  * This function opens a AT commands server bridge.
757  * All unknown AT commands will be sent on this alternative file descriptor thanks to the AT client
758  * Service.
759  *
760  * @return
761  * - Reference to the requested bridge.
762  * - NULL if the device can't be bridged
763  */
764 //--------------------------------------------------------------------------------------------------
766 (
767  int fd
768  ///< [IN] File descriptor.
769 );
770 
771 //--------------------------------------------------------------------------------------------------
772 /**
773  * This function closes an opened bridge.
774  *
775  * @return
776  * - LE_OK The function succeeded.
777  * - LE_FAULT The function failed to close the bridge.
778  * - LE_BUSY The bridge is in use (devices references have to be removed first).
779  */
780 //--------------------------------------------------------------------------------------------------
782 (
783  le_atServer_BridgeRef_t bridgeRef
784  ///< [IN] Bridge reference
785 );
786 
787 //--------------------------------------------------------------------------------------------------
788 /**
789  * This function adds a device to an opened bridge.
790  *
791  * @return
792  * - LE_OK The function succeeded.
793  * - LE_BUSY The device is already used by the bridge.
794  * - LE_FAULT The function failed to add the device to the bridge.
795  */
796 //--------------------------------------------------------------------------------------------------
798 (
799  le_atServer_DeviceRef_t deviceRef,
800  ///< [IN] Device reference to add to the bridge
801  le_atServer_BridgeRef_t bridgeRef
802  ///< [IN] Bridge refence
803 );
804 
805 //--------------------------------------------------------------------------------------------------
806 /**
807  * This function removes a device from a bridge
808  *
809  * @return
810  * - LE_OK The function succeeded.
811  * - LE_NOT_FOUND The device is not isued by the specified bridge
812  * - LE_BUSY The device is currently in use
813  * - LE_FAULT The function failed to add the device to the bridge.
814  */
815 //--------------------------------------------------------------------------------------------------
817 (
818  le_atServer_DeviceRef_t deviceRef,
819  ///< [IN] Device reference to add to the bridge
820  le_atServer_BridgeRef_t bridgeRef
821  ///< [IN] Bridge refence
822 );
823 
824 //--------------------------------------------------------------------------------------------------
825 /**
826  * This function enables extended error codes on the selected device.
827  */
828 //--------------------------------------------------------------------------------------------------
830 (
831  void
832 );
833 
834 //--------------------------------------------------------------------------------------------------
835 /**
836  * This function disables extended error codes on the selected device.
837  */
838 //--------------------------------------------------------------------------------------------------
840 (
841  void
842 );
843 
844 //--------------------------------------------------------------------------------------------------
845 /**
846  * This function allows the user to register a le_atServer_GetTextCallback_t callback
847  * to retrieve text and sends a prompt <CR><LF><greater_than><SPACE> on the current command's
848  * device.
849  *
850  * @return
851  * - LE_OK The function succeeded.
852  * - LE_BAD_PARAMETER Invalid device or command reference.
853  */
854 //--------------------------------------------------------------------------------------------------
856 (
857  le_atServer_CmdRef_t cmdRef,
858  ///< [IN] AT command reference
860  ///< [IN] Get text callback
861  void* contextPtr
862  ///< [IN]
863 );
864 
865 #endif // LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
void le_atServer_SetServerDisconnectHandler(le_atServer_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_atServer_AddDeviceToBridge(le_atServer_DeviceRef_t deviceRef, le_atServer_BridgeRef_t bridgeRef)
Definition: le_atServer_interface.h:383
void le_atServer_DisableExtendedErrorCodes(void)
le_result_t
Definition: le_basics.h:35
le_atServer_CmdRef_t le_atServer_Create(const char *LE_NONNULL name)
action will be done on all bound devices
Definition: le_atServer_interface.h:400
Action AT command (e.g. &#39;AT+CMD&#39;)
Definition: le_atServer_interface.h:364
le_atServer_BridgeRef_t le_atServer_OpenBridge(int fd)
le_result_t le_atServer_SendUnsolicitedResponse(const char *LE_NONNULL unsolRsp, le_atServer_AvailableDevice_t availableDevice, le_atServer_DeviceRef_t device)
void(* le_atServer_GetTextCallbackFunc_t)(le_atServer_CmdRef_t cmdRef, le_result_t result, const char *LE_NONNULL text, uint32_t len, void *contextPtr)
Definition: le_atServer_interface.h:446
le_result_t le_atServer_CloseBridge(le_atServer_BridgeRef_t bridgeRef)
struct le_atServer_Device * le_atServer_DeviceRef_t
Definition: le_atServer_interface.h:345
action will be done on a specified device
Definition: le_atServer_interface.h:402
le_atServer_DeviceRef_t le_atServer_Open(int fd)
le_result_t le_atServer_GetCommandName(le_atServer_CmdRef_t commandRef, char *name, size_t nameSize)
void(* le_atServer_DisconnectHandler_t)(void *)
Definition: le_atServer_interface.h:248
void le_atServer_EnableExtendedErrorCodes(void)
le_result_t le_atServer_Close(le_atServer_DeviceRef_t device)
le_result_t le_atServer_Delete(le_atServer_CmdRef_t commandRef)
le_atServer_FinalRsp_t
Definition: le_atServer_interface.h:381
void(* le_atServer_CommandHandlerFunc_t)(le_atServer_CmdRef_t commandRef, le_atServer_Type_t type, uint32_t parametersNumber, void *contextPtr)
Definition: le_atServer_interface.h:425
le_atServer_Type_t
Definition: le_atServer_interface.h:362
le_result_t le_atServer_GetTextAsync(le_atServer_CmdRef_t cmdRef, le_atServer_GetTextCallbackFunc_t callbackPtr, void *contextPtr)
le_atServer_CommandHandlerRef_t le_atServer_AddCommandHandler(le_atServer_CmdRef_t commandRef, le_atServer_CommandHandlerFunc_t handlerPtr, void *contextPtr)
void le_atServer_DisconnectService(void)
le_result_t le_atServer_RemoveDeviceFromBridge(le_atServer_DeviceRef_t deviceRef, le_atServer_BridgeRef_t bridgeRef)
le_result_t le_atServer_DisableEcho(le_atServer_DeviceRef_t device)
AT command received with parameters (e.g. &#39;AT+CMD=x,y&#39;)
Definition: le_atServer_interface.h:366
le_result_t le_atServer_EnableEcho(le_atServer_DeviceRef_t device)
void le_atServer_ConnectService(void)
Test AT command (e.g. &#39;AT+CMD=?&#39;)
Definition: le_atServer_interface.h:368
le_atServer_AvailableDevice_t
Definition: le_atServer_interface.h:398
le_result_t le_atServer_SendIntermediateResponse(le_atServer_CmdRef_t commandRef, const char *LE_NONNULL intermediateRsp)
le_result_t le_atServer_SendFinalResponse(le_atServer_CmdRef_t commandRef, le_atServer_FinalRsp_t finalResponse, bool customStringAvailable, const char *LE_NONNULL finalRsp)
le_result_t le_atServer_GetParameter(le_atServer_CmdRef_t commandRef, uint32_t index, char *parameter, size_t parameterSize)
struct le_atServer_CommandHandler * le_atServer_CommandHandlerRef_t
Definition: le_atServer_interface.h:413
Definition: le_atServer_interface.h:386
le_result_t le_atServer_TryConnectService(void)
void le_atServer_RemoveCommandHandler(le_atServer_CommandHandlerRef_t handlerRef)
le_result_t le_atServer_GetDevice(le_atServer_CmdRef_t commandRef, le_atServer_DeviceRef_t *deviceRefPtr)
le_result_t le_atServer_Suspend(le_atServer_DeviceRef_t device)
struct le_atServer_Cmd * le_atServer_CmdRef_t
Definition: le_atServer_interface.h:337
le_result_t le_atServer_Resume(le_atServer_DeviceRef_t device)
struct le_atServer_Bridge * le_atServer_BridgeRef_t
Definition: le_atServer_interface.h:353
Read AT command (e.g. &#39;AT+CMD?&#39;)
Definition: le_atServer_interface.h:370