le_avc_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_avc_common.h
12  *
13  * Type definitions for le_avc.
14  *
15  */
16 #ifndef LE_AVC_COMMON_H_INCLUDE_GUARD
17 #define LE_AVC_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_limit_common.h"
24 
25 #define IFGEN_LE_AVC_PROTOCOL_ID "658699438f36e61a5791638b9905361c"
26 #define IFGEN_LE_AVC_MSG_SIZE 529
27 /** @addtogroup le_avc
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Maximum APN name length without NULL terminator.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_AVC_APN_NAME_MAX_LEN 48
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Maximum APN name length including NULL terminator.
41  */
42 //--------------------------------------------------------------------------------------------------
43 #define LE_AVC_APN_NAME_MAX_LEN_BYTES 49
44 
45 //--------------------------------------------------------------------------------------------------
46 /**
47  * Maximum user name length without NULL terminator.
48  */
49 //--------------------------------------------------------------------------------------------------
50 #define LE_AVC_USERNAME_MAX_LEN 28
51 
52 //--------------------------------------------------------------------------------------------------
53 /**
54  * Maximum user name length including NULL terminator.
55  */
56 //--------------------------------------------------------------------------------------------------
57 #define LE_AVC_USERNAME_MAX_LEN_BYTES 29
58 
59 //--------------------------------------------------------------------------------------------------
60 /**
61  * Maximum password length without NULL terminator..
62  */
63 //--------------------------------------------------------------------------------------------------
64 #define LE_AVC_PASSWORD_MAX_LEN 28
65 
66 //--------------------------------------------------------------------------------------------------
67 /**
68  * Maximum password length including NULL terminator.
69  */
70 //--------------------------------------------------------------------------------------------------
71 #define LE_AVC_PASSWORD_MAX_LEN_BYTES 29
72 
73 //--------------------------------------------------------------------------------------------------
74 /**
75  * Maximum number of retry timers.
76  */
77 //--------------------------------------------------------------------------------------------------
78 #define LE_AVC_NUM_RETRY_TIMERS 8
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  * Polling timer value range in minutes. 525600 minutes = 1 year.
83  */
84 //--------------------------------------------------------------------------------------------------
85 #define LE_AVC_POLLING_TIMER_MAX_VAL 525600
86 
87 //--------------------------------------------------------------------------------------------------
88 /**
89  */
90 //--------------------------------------------------------------------------------------------------
91 #define LE_AVC_POLLING_TIMER_MIN_VAL 0
92 
93 //--------------------------------------------------------------------------------------------------
94 /**
95  * Retry timer value range in minutes. 20160 minutes = 2 weeks.
96  */
97 //--------------------------------------------------------------------------------------------------
98 #define LE_AVC_RETRY_TIMER_MAX_VAL 20160
99 
100 //--------------------------------------------------------------------------------------------------
101 /**
102  */
103 //--------------------------------------------------------------------------------------------------
104 #define LE_AVC_RETRY_TIMER_MIN_VAL 0
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  * Default HTTP status.
109  */
110 //--------------------------------------------------------------------------------------------------
111 #define LE_AVC_HTTP_STATUS_INVALID 65535
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  * Communication info max string size
116  */
117 //--------------------------------------------------------------------------------------------------
118 #define LE_AVC_COMM_INFO_STR_MAX_LEN 256
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * Maximum length of a LwM2M resource excluding any termination character.
123  */
124 //--------------------------------------------------------------------------------------------------
125 #define LE_AVC_MAX_LWM2M_RESOURCE_LEN 512
126 
127 //--------------------------------------------------------------------------------------------------
128 /**
129  * Maximum length of a LwM2M resource. One extra byte is added for the null character.
130  */
131 //--------------------------------------------------------------------------------------------------
132 #define LE_AVC_MAX_LWM2M_RESOURCE_BYTES 513
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Communication info codes
137  */
138 //--------------------------------------------------------------------------------------------------
139 #define LE_AVC_COMM_INFO_UDP_NO_ERR 0
140 
141 //--------------------------------------------------------------------------------------------------
142 /**
143  */
144 //--------------------------------------------------------------------------------------------------
145 #define LE_AVC_COMM_INFO_UDP_OPEN_ERR 1
146 
147 //--------------------------------------------------------------------------------------------------
148 /**
149  */
150 //--------------------------------------------------------------------------------------------------
151 #define LE_AVC_COMM_INFO_UDP_CLOSE_ERR 2
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  */
156 //--------------------------------------------------------------------------------------------------
157 #define LE_AVC_COMM_INFO_UDP_SEND_ERR 3
158 
159 //--------------------------------------------------------------------------------------------------
160 /**
161  */
162 //--------------------------------------------------------------------------------------------------
163 #define LE_AVC_COMM_INFO_UDP_RECV_ERR 4
164 
165 //--------------------------------------------------------------------------------------------------
166 /**
167  */
168 //--------------------------------------------------------------------------------------------------
169 #define LE_AVC_COMM_INFO_UDP_CONNECT_ERR 5
170 
171 //--------------------------------------------------------------------------------------------------
172 /**
173  */
174 //--------------------------------------------------------------------------------------------------
175 #define LE_AVC_COMM_INFO_BEARER_UP 6
176 
177 //--------------------------------------------------------------------------------------------------
178 /**
179  */
180 //--------------------------------------------------------------------------------------------------
181 #define LE_AVC_COMM_INFO_BEARER_DOWN 7
182 
183 //--------------------------------------------------------------------------------------------------
184 /**
185  */
186 //--------------------------------------------------------------------------------------------------
187 #define LE_AVC_COMM_INFO_PDP_CONTEXT 8
188 
189 //--------------------------------------------------------------------------------------------------
190 /**
191  */
192 //--------------------------------------------------------------------------------------------------
193 #define LE_AVC_COMM_INFO_COAP_201_CREATED 65
194 
195 //--------------------------------------------------------------------------------------------------
196 /**
197  */
198 //--------------------------------------------------------------------------------------------------
199 #define LE_AVC_COMM_INFO_COAP_202_DELETED 66
200 
201 //--------------------------------------------------------------------------------------------------
202 /**
203  */
204 //--------------------------------------------------------------------------------------------------
205 #define LE_AVC_COMM_INFO_COAP_204_CHANGED 68
206 
207 //--------------------------------------------------------------------------------------------------
208 /**
209  */
210 //--------------------------------------------------------------------------------------------------
211 #define LE_AVC_COMM_INFO_COAP_205_CONTENT 69
212 
213 //--------------------------------------------------------------------------------------------------
214 /**
215  */
216 //--------------------------------------------------------------------------------------------------
217 #define LE_AVC_COMM_INFO_COAP_231_CONTINUE 95
218 
219 //--------------------------------------------------------------------------------------------------
220 /**
221  */
222 //--------------------------------------------------------------------------------------------------
223 #define LE_AVC_COMM_INFO_COAP_400_BAD_REQUEST 128
224 
225 //--------------------------------------------------------------------------------------------------
226 /**
227  */
228 //--------------------------------------------------------------------------------------------------
229 #define LE_AVC_COMM_INFO_COAP_401_UNAUTHORIZED 129
230 
231 //--------------------------------------------------------------------------------------------------
232 /**
233  */
234 //--------------------------------------------------------------------------------------------------
235 #define LE_AVC_COMM_INFO_COAP_402_BAD_OPTION 130
236 
237 //--------------------------------------------------------------------------------------------------
238 /**
239  */
240 //--------------------------------------------------------------------------------------------------
241 #define LE_AVC_COMM_INFO_COAP_404_NOT_FOUND 132
242 
243 //--------------------------------------------------------------------------------------------------
244 /**
245  */
246 //--------------------------------------------------------------------------------------------------
247 #define LE_AVC_COMM_INFO_COAP_405_METHOD_NOT_ALLOWED 133
248 
249 //--------------------------------------------------------------------------------------------------
250 /**
251  */
252 //--------------------------------------------------------------------------------------------------
253 #define LE_AVC_COMM_INFO_COAP_406_NOT_ACCEPTABLE 134
254 
255 //--------------------------------------------------------------------------------------------------
256 /**
257  */
258 //--------------------------------------------------------------------------------------------------
259 #define LE_AVC_COMM_INFO_COAP_408_REQ_ENTITY_INCOMPLETE 136
260 
261 //--------------------------------------------------------------------------------------------------
262 /**
263  */
264 //--------------------------------------------------------------------------------------------------
265 #define LE_AVC_COMM_INFO_COAP_412_PRECONDITION_FAILED 140
266 
267 //--------------------------------------------------------------------------------------------------
268 /**
269  */
270 //--------------------------------------------------------------------------------------------------
271 #define LE_AVC_COMM_INFO_COAP_413_ENTITY_TOO_LARGE 141
272 
273 //--------------------------------------------------------------------------------------------------
274 /**
275  */
276 //--------------------------------------------------------------------------------------------------
277 #define LE_AVC_COMM_INFO_COAP_500_INTERNAL_SERVER_ERROR 160
278 
279 //--------------------------------------------------------------------------------------------------
280 /**
281  */
282 //--------------------------------------------------------------------------------------------------
283 #define LE_AVC_COMM_INFO_COAP_501_NOT_IMPLEMENTED 161
284 
285 //--------------------------------------------------------------------------------------------------
286 /**
287  */
288 //--------------------------------------------------------------------------------------------------
289 #define LE_AVC_COMM_INFO_COAP_503_SERVICE_UNAVAILABLE 163
290 
291 //--------------------------------------------------------------------------------------------------
292 /**
293  * Status of session or update
294  *
295  * If an update is pending, it must first be downloaded and then installed.
296  */
297 //--------------------------------------------------------------------------------------------------
298 typedef enum
299 {
301  ///< No updates pending
303  ///< Update pending download
305  ///< Download in progress
307  ///< Download has completed
309  ///< An error occurred downloading the update
311  ///< Install is pending (implies download complete)
313  ///< Install in progress
315  ///< Update has been successfully installed
317  ///< An error occurred installing the update
319  ///< Uninstall is pending
321  ///< Uninstall in progress
323  ///< App has been successfully uninstalled
325  ///< An error occurred uninstalling the update
327  ///< Session with AirVantage device management server started
329  ///< Session with bootstrap server started
331  ///< Session with AirVantage device management server or bootstrap
332  ///< server stopped
334  ///< Session with AirVantage device management server or bootstrap
335  ///< server failed
337  ///< Device reboot is pending
339  ///< Connection to the server is required. This is necessary when
340  ///< firmware package is installed (after a platform reboot). Also
341  ///< necessary after software update if device reboots(or session stops)
342  ///< in the middle of software update.
344  ///< Authentication with AirVantage device management server or
345  ///< bootstrap server started
347  ///< Authentication with AirVantage device management server or
348  ///< bootstrap server failed
350  ///< Package is certified sent by a trusted server
352  ///< Package is not certified sent by a trusted server
353 }
355 
356 
357 //--------------------------------------------------------------------------------------------------
358 /**
359  * Operations which require user agreement
360  */
361 //--------------------------------------------------------------------------------------------------
362 typedef enum
363 {
365  ///< User agreement for connection
367  ///< User agreement for download
369  ///< User agreement for install
371  ///< User agreement for uninstall
373  ///< User agreement for reboot
374 }
376 
377 
378 //--------------------------------------------------------------------------------------------------
379 /**
380  * Request to open or close avms session.
381  */
382 //--------------------------------------------------------------------------------------------------
383 typedef enum
384 {
386  ///< Request by user app to open AV session
388  ///< Request by user app to close AV session
389 }
391 
392 
393 //--------------------------------------------------------------------------------------------------
394 /**
395  * The type of pending update
396  */
397 //--------------------------------------------------------------------------------------------------
398 typedef enum
399 {
400  LE_AVC_UNKNOWN_UPDATE = 0,
401  ///<
402  LE_AVC_FIRMWARE_UPDATE = 1,
403  ///<
404  LE_AVC_FRAMEWORK_UPDATE = 2,
405  ///<
406  LE_AVC_APPLICATION_UPDATE = 3
407  ///<
408 }
410 
411 
412 //--------------------------------------------------------------------------------------------------
413 /**
414  * Error code used to provide diagnostic information after a failure (includes both download and
415  * install failure).
416  *
417  * @note
418  * Additional information may also be available in the target device's system log.
419  */
420 //--------------------------------------------------------------------------------------------------
421 typedef enum
422 {
424  ///< No error.
426  ///< Encountered a bad package, package download can not be
427  ///< resumed.
429  ///< Something failed while doing install/download, package
430  ///< download can not be resumed.
432  ///< Security check failure while installing the package,
433  ///< package download can not be resumed.
435  ///< RAM issue during package download, package download can be
436  ///< resumed but a platform reboot is requires.
438  ///< Network issue during package download (IP issues), package
439  ///< download can be resumed.
441  ///< Flash issue during package download, package download can
442  ///< not be resumed.
444  ///< Not enough space in flash to store the package
445 }
447 
448 
449 //--------------------------------------------------------------------------------------------------
450 /**
451  * Session type indicates whether the device is connected to the bootstrap server or the
452  * device management server.
453  */
454 //--------------------------------------------------------------------------------------------------
455 typedef enum
456 {
458  ///< Bootstrap session.
460  ///< Device Management session.
462  ///< Session type invalid.
463 }
465 
466 
467 //--------------------------------------------------------------------------------------------------
468 /**
469  * Status of the device credentials
470  */
471 //--------------------------------------------------------------------------------------------------
472 typedef enum
473 {
475  ///< Neither Bootstrap nor Device Management
476  ///< credential is provisioned.
478  ///< Bootstrap credential is provisioned but Device
479  ///< Management credential is not provisioned.
481  ///< Device Management credential is provisioned.
482 }
484 
485 
486 //--------------------------------------------------------------------------------------------------
487 /**
488  * Reference type used by Add/Remove functions for EVENT 'le_avc_StatusEvent'
489  */
490 //--------------------------------------------------------------------------------------------------
491 typedef struct le_avc_StatusEventHandler* le_avc_StatusEventHandlerRef_t;
492 
493 
494 //--------------------------------------------------------------------------------------------------
495 /**
496  * Reference type used by Add/Remove functions for EVENT 'le_avc_SessionRequestEvent'
497  */
498 //--------------------------------------------------------------------------------------------------
499 typedef struct le_avc_SessionRequestEventHandler* le_avc_SessionRequestEventHandlerRef_t;
500 
501 
502 //--------------------------------------------------------------------------------------------------
503 /**
504  * Reference type used by Add/Remove functions for EVENT 'le_avc_CommInfo'
505  */
506 //--------------------------------------------------------------------------------------------------
507 typedef struct le_avc_CommInfoHandler* le_avc_CommInfoHandlerRef_t;
508 
509 
510 //--------------------------------------------------------------------------------------------------
511 /**
512  * Reference returned by BlockInstall function and used by UnblockInstall function
513  */
514 //--------------------------------------------------------------------------------------------------
515 typedef struct le_avc_BlockRequest* le_avc_BlockRequestRef_t;
516 
517 
518 //--------------------------------------------------------------------------------------------------
519 /**
520  * Handler for update availability status
521  */
522 //--------------------------------------------------------------------------------------------------
523 typedef void (*le_avc_StatusHandlerFunc_t)
524 (
525  le_avc_Status_t updateStatus,
526  ///< status of pending update, if available
527  int32_t totalNumBytes,
528  ///< Total number of bytes to be downloaded
529  ///< only valid when updateStatus is one of
530  ///< DOWNLOAD_PENDING, DOWNLOAD_IN_PROGRESS or DOWNLOAD_COMPLETE.
531  ///< returns -1 if value is unknown
532  int32_t progress,
533  ///< Task completion in percentage
534  ///< Valid when updateStatus is one of DOWNLOAD_IN_PROGRESS,
535  ///< INSTALL_IN_PROGRESS or UNINSTALL_IN_PROGRESS.
536  ///< returns -1 if value is unknown
537  void* contextPtr
538  ///<
539 );
540 
541 //--------------------------------------------------------------------------------------------------
542 /**
543  * Handler for receiving session open or close request.
544  */
545 //--------------------------------------------------------------------------------------------------
547 (
548  le_avc_SessionRequest_t request,
549  ///< Request to open or close AV session
550  void* contextPtr
551  ///<
552 );
553 
554 //--------------------------------------------------------------------------------------------------
555 /**
556  * Handler for receiving communication information.
557  */
558 //--------------------------------------------------------------------------------------------------
559 typedef void (*le_avc_CommInfoHandlerFunc_t)
560 (
561  uint8_t code,
562  ///< Communication information code
563  const char* LE_NONNULL str,
564  ///< Communication information string
565  void* contextPtr
566  ///<
567 );
568 
569 
570 //--------------------------------------------------------------------------------------------------
571 /**
572  * Get if this client bound locally.
573  */
574 //--------------------------------------------------------------------------------------------------
575 LE_SHARED bool ifgen_le_avc_HasLocalBinding
576 (
577  void
578 );
579 
580 
581 //--------------------------------------------------------------------------------------------------
582 /**
583  * Init data that is common across all threads
584  */
585 //--------------------------------------------------------------------------------------------------
586 LE_SHARED void ifgen_le_avc_InitCommonData
587 (
588  void
589 );
590 
591 
592 //--------------------------------------------------------------------------------------------------
593 /**
594  * Perform common initialization and open a session
595  */
596 //--------------------------------------------------------------------------------------------------
597 LE_SHARED le_result_t ifgen_le_avc_OpenSession
598 (
599  le_msg_SessionRef_t _ifgen_sessionRef,
600  bool isBlocking
601 );
602 
603 //--------------------------------------------------------------------------------------------------
604 /**
605  * Add handler function for EVENT 'le_avc_StatusEvent'
606  *
607  * This event provides information on update availability status
608  */
609 //--------------------------------------------------------------------------------------------------
610 LE_SHARED le_avc_StatusEventHandlerRef_t ifgen_le_avc_AddStatusEventHandler
611 (
612  le_msg_SessionRef_t _ifgen_sessionRef,
613  le_avc_StatusHandlerFunc_t handlerPtr,
614  ///< [IN]
615  void* contextPtr
616  ///< [IN]
617 );
618 
619 //--------------------------------------------------------------------------------------------------
620 /**
621  * Remove handler function for EVENT 'le_avc_StatusEvent'
622  */
623 //--------------------------------------------------------------------------------------------------
624 LE_SHARED void ifgen_le_avc_RemoveStatusEventHandler
625 (
626  le_msg_SessionRef_t _ifgen_sessionRef,
628  ///< [IN]
629 );
630 
631 //--------------------------------------------------------------------------------------------------
632 /**
633  * Add handler function for EVENT 'le_avc_SessionRequestEvent'
634  *
635  * This event provides information on session open or close request.
636  */
637 //--------------------------------------------------------------------------------------------------
638 LE_SHARED le_avc_SessionRequestEventHandlerRef_t ifgen_le_avc_AddSessionRequestEventHandler
639 (
640  le_msg_SessionRef_t _ifgen_sessionRef,
642  ///< [IN]
643  void* contextPtr
644  ///< [IN]
645 );
646 
647 //--------------------------------------------------------------------------------------------------
648 /**
649  * Remove handler function for EVENT 'le_avc_SessionRequestEvent'
650  */
651 //--------------------------------------------------------------------------------------------------
652 LE_SHARED void ifgen_le_avc_RemoveSessionRequestEventHandler
653 (
654  le_msg_SessionRef_t _ifgen_sessionRef,
656  ///< [IN]
657 );
658 
659 //--------------------------------------------------------------------------------------------------
660 /**
661  * Add handler function for EVENT 'le_avc_CommInfo'
662  *
663  * This event provides communication errors.
664  */
665 //--------------------------------------------------------------------------------------------------
666 LE_SHARED le_avc_CommInfoHandlerRef_t ifgen_le_avc_AddCommInfoHandler
667 (
668  le_msg_SessionRef_t _ifgen_sessionRef,
669  le_avc_CommInfoHandlerFunc_t handlerPtr,
670  ///< [IN]
671  void* contextPtr
672  ///< [IN]
673 );
674 
675 //--------------------------------------------------------------------------------------------------
676 /**
677  * Remove handler function for EVENT 'le_avc_CommInfo'
678  */
679 //--------------------------------------------------------------------------------------------------
680 LE_SHARED void ifgen_le_avc_RemoveCommInfoHandler
681 (
682  le_msg_SessionRef_t _ifgen_sessionRef,
683  le_avc_CommInfoHandlerRef_t handlerRef
684  ///< [IN]
685 );
686 
687 //--------------------------------------------------------------------------------------------------
688 /**
689  * Start a session with the AirVantage server
690  *
691  * This will cause a query to be sent to the server, for pending updates.
692  *
693  * @return
694  * - LE_OK if connection request has been sent.
695  * - LE_FAULT on failure
696  * - LE_DUPLICATE if already connected.
697  */
698 //--------------------------------------------------------------------------------------------------
699 LE_SHARED le_result_t ifgen_le_avc_StartSession
700 (
701  le_msg_SessionRef_t _ifgen_sessionRef
702 );
703 
704 //--------------------------------------------------------------------------------------------------
705 /**
706  * Stop a session with the AirVantage server
707  *
708  * If a download is in progress and the user agreement is enabled, this suspends the download,
709  * otherwise if the user agreement is disabled, a new connection is automatically initiated in order
710  * to resume the download.
711  *
712  * @return
713  * - LE_OK on success
714  * - LE_FAULT on failure
715  * - LE_DUPLICATE if already disconnected
716  */
717 //--------------------------------------------------------------------------------------------------
718 LE_SHARED le_result_t ifgen_le_avc_StopSession
719 (
720  le_msg_SessionRef_t _ifgen_sessionRef
721 );
722 
723 //--------------------------------------------------------------------------------------------------
724 /**
725  * Send a specific message to the server to be sure that the route between the device and the server
726  * is available.
727  * This API needs to be called when any package download is over (successfully or not) and before
728  * sending any notification on asset data to the server.
729  *
730  * @return
731  * - LE_OK when the treatment is launched
732  * - LE_FAULT on failure
733  * - LE_UNSUPPORTED when the API is not supported
734  *
735  */
736 //--------------------------------------------------------------------------------------------------
737 LE_SHARED le_result_t ifgen_le_avc_CheckRoute
738 (
739  le_msg_SessionRef_t _ifgen_sessionRef
740 );
741 
742 //--------------------------------------------------------------------------------------------------
743 /**
744  * Defer the currently pending connection, for the given number of minutes
745  *
746  * @return
747  * - LE_OK on success
748  * - LE_FAULT on failure
749  */
750 //--------------------------------------------------------------------------------------------------
751 LE_SHARED le_result_t ifgen_le_avc_DeferConnect
752 (
753  le_msg_SessionRef_t _ifgen_sessionRef,
754  uint32_t deferMinutes
755  ///< [IN]
756 );
757 
758 //--------------------------------------------------------------------------------------------------
759 /**
760  * Accept the currently pending download
761  *
762  * @return
763  * - LE_OK on success
764  * - LE_FAULT on failure
765  */
766 //--------------------------------------------------------------------------------------------------
767 LE_SHARED le_result_t ifgen_le_avc_AcceptDownload
768 (
769  le_msg_SessionRef_t _ifgen_sessionRef
770 );
771 
772 //--------------------------------------------------------------------------------------------------
773 /**
774  * Defer the currently pending download, for the given number of minutes
775  *
776  * @return
777  * - LE_OK on success
778  * - LE_FAULT on failure
779  */
780 //--------------------------------------------------------------------------------------------------
781 LE_SHARED le_result_t ifgen_le_avc_DeferDownload
782 (
783  le_msg_SessionRef_t _ifgen_sessionRef,
784  uint32_t deferMinutes
785  ///< [IN]
786 );
787 
788 //--------------------------------------------------------------------------------------------------
789 /**
790  * Accept the currently pending install
791  *
792  * @return
793  * - LE_OK on success
794  * - LE_FAULT on failure
795  */
796 //--------------------------------------------------------------------------------------------------
797 LE_SHARED le_result_t ifgen_le_avc_AcceptInstall
798 (
799  le_msg_SessionRef_t _ifgen_sessionRef
800 );
801 
802 //--------------------------------------------------------------------------------------------------
803 /**
804  * Defer the currently pending install
805  *
806  * @return
807  * - LE_OK on success
808  * - LE_FAULT on failure
809  */
810 //--------------------------------------------------------------------------------------------------
811 LE_SHARED le_result_t ifgen_le_avc_DeferInstall
812 (
813  le_msg_SessionRef_t _ifgen_sessionRef,
814  uint32_t deferMinutes
815  ///< [IN]
816 );
817 
818 //--------------------------------------------------------------------------------------------------
819 /**
820  * Accept the currently pending uninstall
821  *
822  * @return
823  * - LE_OK on success
824  * - LE_FAULT on failure
825  */
826 //--------------------------------------------------------------------------------------------------
827 LE_SHARED le_result_t ifgen_le_avc_AcceptUninstall
828 (
829  le_msg_SessionRef_t _ifgen_sessionRef
830 );
831 
832 //--------------------------------------------------------------------------------------------------
833 /**
834  * Defer the currently pending uninstall
835  *
836  * @return
837  * - LE_OK on success
838  * - LE_FAULT on failure
839  */
840 //--------------------------------------------------------------------------------------------------
841 LE_SHARED le_result_t ifgen_le_avc_DeferUninstall
842 (
843  le_msg_SessionRef_t _ifgen_sessionRef,
844  uint32_t deferMinutes
845  ///< [IN]
846 );
847 
848 //--------------------------------------------------------------------------------------------------
849 /**
850  * Accept the currently pending reboot
851  *
852  * @note When this function is called, a 2-second timer is launched and the reboot function is
853  * called when the timer expires.
854  *
855  * @return
856  * - LE_OK on success
857  * - LE_FAULT on failure
858  */
859 //--------------------------------------------------------------------------------------------------
860 LE_SHARED le_result_t ifgen_le_avc_AcceptReboot
861 (
862  le_msg_SessionRef_t _ifgen_sessionRef
863 );
864 
865 //--------------------------------------------------------------------------------------------------
866 /**
867  * Defer the currently pending reboot
868  *
869  * @return
870  * - LE_OK on success
871  * - LE_FAULT on failure
872  */
873 //--------------------------------------------------------------------------------------------------
874 LE_SHARED le_result_t ifgen_le_avc_DeferReboot
875 (
876  le_msg_SessionRef_t _ifgen_sessionRef,
877  uint32_t deferMinutes
878  ///< [IN]
879 );
880 
881 //--------------------------------------------------------------------------------------------------
882 /**
883  * Get the update type of the currently pending update
884  *
885  * @return
886  * - LE_OK on success
887  * - LE_FAULT if not available
888  */
889 //--------------------------------------------------------------------------------------------------
890 LE_SHARED le_result_t ifgen_le_avc_GetUpdateType
891 (
892  le_msg_SessionRef_t _ifgen_sessionRef,
893  le_avc_UpdateType_t* updateTypePtr
894  ///< [OUT]
895 );
896 
897 //--------------------------------------------------------------------------------------------------
898 /**
899  * Get the name for the currently pending app update
900  *
901  * @return
902  * - LE_OK on success
903  * - LE_FAULT if not available, or isn't APPL_UPDATE type
904  */
905 //--------------------------------------------------------------------------------------------------
906 LE_SHARED le_result_t ifgen_le_avc_GetAppUpdateName
907 (
908  le_msg_SessionRef_t _ifgen_sessionRef,
909  char* updateName,
910  ///< [OUT]
911  size_t updateNameSize
912  ///< [IN]
913 );
914 
915 //--------------------------------------------------------------------------------------------------
916 /**
917  * Prevent any pending updates from being installed.
918  *
919  * @return
920  * - Reference for block update request (to be used later for unblocking updates)
921  * - NULL if the operation was not successful
922  */
923 //--------------------------------------------------------------------------------------------------
924 LE_SHARED le_avc_BlockRequestRef_t ifgen_le_avc_BlockInstall
925 (
926  le_msg_SessionRef_t _ifgen_sessionRef
927 );
928 
929 //--------------------------------------------------------------------------------------------------
930 /**
931  * Allow any pending updates to be installed
932  */
933 //--------------------------------------------------------------------------------------------------
934 LE_SHARED void ifgen_le_avc_UnblockInstall
935 (
936  le_msg_SessionRef_t _ifgen_sessionRef,
937  le_avc_BlockRequestRef_t blockRef
938  ///< [IN] block request ref returned by le_avc_BlockInstall
939 );
940 
941 //--------------------------------------------------------------------------------------------------
942 /**
943  * Function to get error code when update fails.
944  *
945  * @return
946  * - Error code of encountered error.
947  * - ERR_NONE if update is in any other state.
948  */
949 //--------------------------------------------------------------------------------------------------
950 LE_SHARED le_avc_ErrorCode_t ifgen_le_avc_GetErrorCode
951 (
952  le_msg_SessionRef_t _ifgen_sessionRef
953 );
954 
955 //--------------------------------------------------------------------------------------------------
956 /**
957  * Function to read the current session type, or the last session type if there is no
958  * active session.
959  *
960  * @return
961  * - SessionType
962  */
963 //--------------------------------------------------------------------------------------------------
964 LE_SHARED le_avc_SessionType_t ifgen_le_avc_GetSessionType
965 (
966  le_msg_SessionRef_t _ifgen_sessionRef
967 );
968 
969 //--------------------------------------------------------------------------------------------------
970 /**
971  * Function to read the http status of the last download.
972  *
973  * @return
974  * - HttpStatus as defined in RFC 7231, Section 6.
975  */
976 //--------------------------------------------------------------------------------------------------
977 LE_SHARED uint16_t ifgen_le_avc_GetHttpStatus
978 (
979  le_msg_SessionRef_t _ifgen_sessionRef
980 );
981 
982 //--------------------------------------------------------------------------------------------------
983 /**
984  * Function to read the polling timer.
985  *
986  * @return
987  * - LE_OK on success
988  * - LE_FAULT if not available
989  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
990  */
991 //--------------------------------------------------------------------------------------------------
992 LE_SHARED le_result_t ifgen_le_avc_GetPollingTimer
993 (
994  le_msg_SessionRef_t _ifgen_sessionRef,
995  uint32_t* pollingTimerPtr
996  ///< [OUT] Polling timer interval, minutes
997 );
998 
999 //--------------------------------------------------------------------------------------------------
1000 /**
1001  * Function to read the retry timers.
1002  *
1003  * @return
1004  * - LE_OK on success.
1005  * - LE_FAULT if not able to read the timers.
1006  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1007  */
1008 //--------------------------------------------------------------------------------------------------
1009 LE_SHARED le_result_t ifgen_le_avc_GetRetryTimers
1010 (
1011  le_msg_SessionRef_t _ifgen_sessionRef,
1012  uint16_t* timerValuePtr,
1013  ///< [OUT] Array of retry timer intervals, minutes.
1014  size_t* timerValueSizePtr
1015  ///< [INOUT]
1016 );
1017 
1018 //--------------------------------------------------------------------------------------------------
1019 /**
1020  * Function to read APN configuration.
1021  *
1022  * @return
1023  * - LE_OK on success.
1024  * - LE_FAULT if there is any error while reading.
1025  * - LE_OVERFLOW if the buffer provided is too small.
1026  */
1027 //--------------------------------------------------------------------------------------------------
1028 LE_SHARED le_result_t ifgen_le_avc_GetApnConfig
1029 (
1030  le_msg_SessionRef_t _ifgen_sessionRef,
1031  char* apnName,
1032  ///< [OUT]
1033  size_t apnNameSize,
1034  ///< [IN]
1035  char* userName,
1036  ///< [OUT]
1037  size_t userNameSize,
1038  ///< [IN]
1039  char* userPwd,
1040  ///< [OUT]
1041  size_t userPwdSize
1042  ///< [IN]
1043 );
1044 
1045 //--------------------------------------------------------------------------------------------------
1046 /**
1047  * Function to write APN configuration.
1048  *
1049  * @return
1050  * - LE_OK on success.
1051  * - LE_OVERFLOW if one of the input strings is too long.
1052  */
1053 //--------------------------------------------------------------------------------------------------
1054 LE_SHARED le_result_t ifgen_le_avc_SetApnConfig
1055 (
1056  le_msg_SessionRef_t _ifgen_sessionRef,
1057  const char* LE_NONNULL apnName,
1058  ///< [IN]
1059  const char* LE_NONNULL userName,
1060  ///< [IN]
1061  const char* LE_NONNULL userPwd
1062  ///< [IN]
1063 );
1064 
1065 //--------------------------------------------------------------------------------------------------
1066 /**
1067  * Function to set the polling timer to a value in minutes.
1068  *
1069  * @return
1070  * - LE_OK on success.
1071  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1072  */
1073 //--------------------------------------------------------------------------------------------------
1074 LE_SHARED le_result_t ifgen_le_avc_SetPollingTimer
1075 (
1076  le_msg_SessionRef_t _ifgen_sessionRef,
1077  uint32_t pollingTimer
1078  ///< [IN] Polling timer interval, minutes
1079 );
1080 
1081 //--------------------------------------------------------------------------------------------------
1082 /**
1083  * Function to set the retry timers.
1084  *
1085  * @return
1086  * - LE_OK on success.
1087  * - LE_FAULT if not able to set the timers.
1088  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1089  */
1090 //--------------------------------------------------------------------------------------------------
1091 LE_SHARED le_result_t ifgen_le_avc_SetRetryTimers
1092 (
1093  le_msg_SessionRef_t _ifgen_sessionRef,
1094  const uint16_t* timerValuePtr,
1095  ///< [IN] Array of retry timer intervals, minutes.
1096  size_t timerValueSize
1097  ///< [IN]
1098 );
1099 
1100 //--------------------------------------------------------------------------------------------------
1101 /**
1102  * Function to retrieve status of the credentials provisioned on the device.
1103  *
1104  * @return
1105  * LE_AVC_NO_CREDENTIAL_PROVISIONED
1106  * - If neither Bootstrap nor Device Management credential is provisioned.
1107  * LE_AVC_BS_CREDENTIAL_PROVISIONED
1108  * - If Bootstrap credential is provisioned but Device Management credential is
1109  * not provisioned.
1110  * LE_AVC_DM_CREDENTIAL_PROVISIONED
1111  * - If Device management key is provisioned.
1112  */
1113 //--------------------------------------------------------------------------------------------------
1114 LE_SHARED le_avc_CredentialStatus_t ifgen_le_avc_GetCredentialStatus
1115 (
1116  le_msg_SessionRef_t _ifgen_sessionRef
1117 );
1118 
1119 //--------------------------------------------------------------------------------------------------
1120 /**
1121  * Function to set user agreements for download, install, reboot, connection and uninstall.
1122  *
1123  * @return
1124  * - LE_OK on success.
1125  * - LE_FAULT if failed to configure user agreement.
1126  */
1127 //--------------------------------------------------------------------------------------------------
1128 LE_SHARED le_result_t ifgen_le_avc_SetUserAgreement
1129 (
1130  le_msg_SessionRef_t _ifgen_sessionRef,
1131  le_avc_UserAgreement_t updateStatus,
1132  ///< [IN] Operation for which user agreements has to be set.
1133  bool enable
1134  ///< [IN] true = enable, false = disable.
1135 );
1136 
1137 //--------------------------------------------------------------------------------------------------
1138 /**
1139  * Function to get user agreements for download, install, reboot, connection and uninstall.
1140  *
1141  * @return
1142  * - LE_OK on success.
1143  * - LE_FAULT if failed to read user agreement state.
1144  */
1145 //--------------------------------------------------------------------------------------------------
1146 LE_SHARED le_result_t ifgen_le_avc_GetUserAgreement
1147 (
1148  le_msg_SessionRef_t _ifgen_sessionRef,
1149  le_avc_UserAgreement_t updateStatus,
1150  ///< [IN] Operation for which user agreements has to be read.
1151  bool* enablePtr
1152  ///< [OUT] true = enable, false = disable.
1153 );
1154 
1155 //--------------------------------------------------------------------------------------------------
1156 /**
1157  * Function to read a resource from a LWM2M object
1158  *
1159  * @return
1160  * - LE_OK on success.
1161  * - LE_FAULT if failed.
1162  * - LE_UNSUPPORTED if unsupported.
1163  */
1164 //--------------------------------------------------------------------------------------------------
1165 LE_SHARED le_result_t ifgen_le_avc_ReadLwm2mResource
1166 (
1167  le_msg_SessionRef_t _ifgen_sessionRef,
1168  uint16_t objectId,
1169  ///< [IN] Object identifier
1170  uint16_t objectInstanceId,
1171  ///< [IN] Object instance identifier
1172  uint16_t resourceId,
1173  ///< [IN] Resource identifier
1174  uint16_t resourceInstanceId,
1175  ///< [IN] Resource instance identifier
1176  char* data,
1177  ///< [OUT] String of requested resources to be read
1178  size_t dataSize
1179  ///< [IN]
1180 );
1181 /** @} **/
1182 #endif // LE_AVC_COMMON_H_INCLUDE_GUARD
Definition: le_avc_common.h:425
Bootstrap session.
Definition: le_avc_common.h:457
Definition: le_avc_common.h:330
Package is not certified sent by a trusted server.
Definition: le_avc_common.h:351
#define LE_SHARED
Definition: le_basics.h:300
Download has completed.
Definition: le_avc_common.h:306
No error.
Definition: le_avc_common.h:423
Definition: le_avc_common.h:437
Request by user app to open AV session.
Definition: le_avc_common.h:385
le_avc_ErrorCode_t
Definition: le_avc_common.h:421
Definition: le_avc_common.h:428
le_result_t
Definition: le_basics.h:46
le_avc_CredentialStatus_t
Definition: le_avc_common.h:472
Device Management credential is provisioned.
Definition: le_avc_common.h:480
Definition: le_avc_common.h:338
struct le_avc_CommInfoHandler * le_avc_CommInfoHandlerRef_t
Definition: le_avc_common.h:507
An error occurred installing the update.
Definition: le_avc_common.h:316
Package is certified sent by a trusted server.
Definition: le_avc_common.h:349
Not enough space in flash to store the package.
Definition: le_avc_common.h:443
Update has been successfully installed.
Definition: le_avc_common.h:314
Uninstall in progress.
Definition: le_avc_common.h:320
void(* le_avc_CommInfoHandlerFunc_t)(uint8_t code, const char *LE_NONNULL str, void *contextPtr)
Definition: le_avc_common.h:560
User agreement for connection.
Definition: le_avc_common.h:364
Definition: le_avc_common.h:343
An error occurred downloading the update.
Definition: le_avc_common.h:308
Uninstall is pending.
Definition: le_avc_common.h:318
Device Management session.
Definition: le_avc_common.h:459
Device reboot is pending.
Definition: le_avc_common.h:336
Session type invalid.
Definition: le_avc_common.h:461
Definition: le_avc_common.h:474
struct le_avc_BlockRequest * le_avc_BlockRequestRef_t
Definition: le_avc_common.h:515
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
le_avc_SessionRequest_t
Definition: le_avc_common.h:383
le_avc_SessionType_t
Definition: le_avc_common.h:455
Install in progress.
Definition: le_avc_common.h:312
Definition: le_avc_common.h:477
void(* le_avc_StatusHandlerFunc_t)(le_avc_Status_t updateStatus, int32_t totalNumBytes, int32_t progress, void *contextPtr)
Definition: le_avc_common.h:524
void(* le_avc_SessionRequestHandlerFunc_t)(le_avc_SessionRequest_t request, void *contextPtr)
Definition: le_avc_common.h:547
Definition: le_avc_common.h:434
User agreement for reboot.
Definition: le_avc_common.h:372
le_avc_UpdateType_t
Definition: le_avc_common.h:398
Session with bootstrap server started.
Definition: le_avc_common.h:328
User agreement for install.
Definition: le_avc_common.h:368
Definition: le_avc_common.h:440
le_avc_Status_t
Definition: le_avc_common.h:298
Definition: le_avc_common.h:431
Definition: le_avc_common.h:333
struct le_avc_SessionRequestEventHandler * le_avc_SessionRequestEventHandlerRef_t
Definition: le_avc_common.h:499
Definition: le_avc_common.h:346
App has been successfully uninstalled.
Definition: le_avc_common.h:322
Update pending download.
Definition: le_avc_common.h:302
Install is pending (implies download complete)
Definition: le_avc_common.h:310
User agreement for uninstall.
Definition: le_avc_common.h:370
Request by user app to close AV session.
Definition: le_avc_common.h:387
struct le_avc_StatusEventHandler * le_avc_StatusEventHandlerRef_t
Definition: le_avc_common.h:491
No updates pending.
Definition: le_avc_common.h:300
Download in progress.
Definition: le_avc_common.h:304
User agreement for download.
Definition: le_avc_common.h:366
An error occurred uninstalling the update.
Definition: le_avc_common.h:324
Session with AirVantage device management server started.
Definition: le_avc_common.h:326
le_avc_UserAgreement_t
Definition: le_avc_common.h:362