summaryrefslogtreecommitdiffstats
path: root/nsframework/framework_unified/client/include/native_service/ns_rcs_data_handler.hpp
blob: 6f303f1c061bcb153e8ac1adfc1db2b10c102715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file
 * @brief \~english This file contains declaration of CPassThruInDataHandler class
 *
 */
/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup native_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup framework_unified
 *  @ingroup native_service
 *  @{
 */
/** @addtogroup nsrcs
 *  @ingroup framework_unified
 *  @{
 */

// todo: move this file to the rcs interface folder

#ifndef _NS_RCS_DATA_HANDLER_H__  // NOLINT  (build/header_guard)
#define _NS_RCS_DATA_HANDLER_H__

#include <native_service/frameworkunified_types.h>
#include <native_service/ns_endianess.h>
#include <vector>

#ifdef AGL_STUB
#include <cstring>
#endif

typedef UI_8 NSRCS_BOOL;

#define SIZE_OF_PASSTHRU_DATATYPE_IDENTIFIER 1
#define SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER 3
#define PASSTHRU_DATA_HEADER_LEN 8


// not valid for buffer or array
// \return - 0 - invalid type id
/*UI_16 GetLengthOfBasicType(UI_8 f_ui8TypeId)
{

  UI_16 l_ui16LengthOfBasicType = 0;
  switch(f_ui8TypeId)
  {
  case 0x01:  l_ui16LengthOfBasicType = 2; break;  // eBool
  case 0x02:  l_ui16LengthOfBasicType = 1; break;  // eUint8
  case 0x03:  l_ui16LengthOfBasicType = 2; break;  // eUint16
  case 0x04:  l_ui16LengthOfBasicType = 4; break;  // eUint32
  case 0x05:  l_ui16LengthOfBasicType = 8; break;  // eUint64
  case 0x06:  l_ui16LengthOfBasicType = 1; break;  // eSint8
  case 0x07:  l_ui16LengthOfBasicType = 2; break;  // eSint16
  case 0x08:  l_ui16LengthOfBasicType = 4; break;  // eSint32
  case 0x09:  l_ui16LengthOfBasicType = 8; break;  // eSint64
  case 0x0A:  l_ui16LengthOfBasicType = 8; break;  // eReal
  default: break;
  }
  return l_ui16LengthOfBasicType;
}*/

/////////////////////////////////////////
/// Class: CPassThruInDataHandler
/////////////////////////////////////////
/**
 * @class CPassThruInDataHandler
 * \~english @brief Data Handler
 * \~english @par   Brief Introduction
 *        Class to get/set function to do input data handler
 *
 */
class CPassThruInDataHandler {
 public:
  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup CPassThruInDataHandler
  /// \~english @par Summary
  ///       Constructor of CPassThruInDataHandler class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To generate a CPassThruInDataHandler class. \n
  ///       Member variables (m_ui8Data, m_ui16TotalLength, m_ui16ParamCount, m_pui8CurOffset, m_ui16RemainingLength) to
  ///       be initialized. \n
  /// \~english @see  ~CPassThruInDataHandler
  ////////////////////////////////////////////////////////////////////////////////////
  CPassThruInDataHandler(UI_8 *f_pui8Data, UI_16 f_ui16Length, UI_16 f_ui16ParamCount)
    : m_ui8Data(f_pui8Data),
      m_ui16TotalLength(f_ui16Length),
      m_ui16ParamCount(f_ui16ParamCount),
      m_pui8CurOffset(f_pui8Data),
      m_ui16RemainingLength(f_ui16Length) {

  }

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup ~CPassThruInDataHandler
  /// \~english @par Summary
  ///       Destructor of CPassThruInDataHandler class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To delete a CPassThruInDataHandler class. \n
  /// \~english @see  CPassThruInDataHandler
  ////////////////////////////////////////////////////////////////////////////////////
  ~CPassThruInDataHandler() {
    m_ui8Data = NULL;  // Do not delete. Because, not allocated in this class
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetBool
  /// \~english @par Brief
  ///     This function is used to convert value to type NSRCS_BOOL
  /// \~english @param [out] f_rcsboolOutValue
  ///     NSRCS_BOOL & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type NSRCS_BOOL(f_rcsboolOutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetBool(NSRCS_BOOL &f_rcsboolOutValue) {
    return GetValue<NSRCS_BOOL>(f_rcsboolOutValue);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetUI8
  /// \~english @par Brief
  ///     This function is used to convert value to type UI_8
  /// \~english @param [out] f_rcsboolOutValue
  ///     UI_8 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type UI_8(f_ui8OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetUI8(UI_8 &f_ui8OutValue) {
    return GetValue<UI_8>(f_ui8OutValue);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetUI16
  /// \~english @par Brief
  ///     This function is used to convert value to type UI_16
  /// \~english @param [out] f_rcsboolOutValue
  ///     UI_16 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type UI_16(f_ui16OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetUI16(UI_16 &f_ui16OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<UI_16>(f_ui16OutValue);
    f_ui16OutValue = ConvertEndian_UI16(f_ui16OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetUI32
  /// \~english @par Brief
  ///     This function is used to convert value to type UI_32
  /// \~english @param [out] f_rcsboolOutValue
  ///     UI_32 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type UI_32(f_ui32OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetUI32(UI_32 &f_ui32OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<UI_32>(f_ui32OutValue);
    f_ui32OutValue = ConvertEndian_UI32(f_ui32OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetUI64
  /// \~english @par Brief
  ///     This function is used to convert value to type UI_64
  /// \~english @param [out] f_rcsboolOutValue
  ///     UI_64 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type UI_64(f_ui64OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetUI64(UI_64 &f_ui64OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<UI_64>(f_ui64OutValue);
    f_ui64OutValue = ConvertEndian_UI64(f_ui64OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetSI8
  /// \~english @par Brief
  ///     This function is used to convert value to type SI_8
  /// \~english @param [out] f_rcsboolOutValue
  ///     SI_8 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type SI_8(f_si8OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetSI8(SI_8 &f_si8OutValue) {
    return GetValue<SI_8>(f_si8OutValue);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetSI16
  /// \~english @par Brief
  ///     This function is used to convert value to type SI_16
  /// \~english @param [out] f_rcsboolOutValue
  ///     SI_16 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type SI_16(f_si16OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetSI16(SI_16 &f_si16OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<SI_16>(f_si16OutValue);
    f_si16OutValue = ConvertEndian_SI16(f_si16OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetSI32
  /// \~english @par Brief
  ///     This function is used to convert value to type SI_32
  /// \~english @param [out] f_rcsboolOutValue
  ///     SI_32 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type SI_32(f_si32OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetSI32(SI_32 &f_si32OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<SI_32>(f_si32OutValue);
    f_si32OutValue = ConvertEndian_SI32(f_si32OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetSI64
  /// \~english @par Brief
  ///     This function is used to convert value to type SI_64
  /// \~english @param [out] f_rcsboolOutValue
  ///     SI_64 & - the given type of covert result
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Convert member data to the type SI_64(f_si64OutValue).
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetSI64(SI_64 &f_si64OutValue) {
    EFrameworkunifiedStatus l_eStatus = GetValue<SI_64>(f_si64OutValue);
    f_si64OutValue = ConvertEndian_SI64(f_si64OutValue);
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetBuffer
  /// \~english @par Brief
  ///     This function is used to get the buffer and its size.
  /// \~english @param [out] f_pui8Buffer
  ///     UI_8 *& - buffer address
  /// \~english @param [out] f_ui16BufLength
  ///     UI_16 - buffer size
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - invalid data type id passed
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient data is available
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_ui16RemainingLength) is invalid(outrange of the size
  ///      SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER) [eFrameworkunifiedStatusInvldParam]
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Get buffer address(f_pui8Buffer) and its size.
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetBuffer(UI_8 *&f_pui8Buffer, UI_16 &f_ui16BufLength) {
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    if (f_pui8Buffer == NULL) {
      FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __func__, "f_pui8Buffer is NULL");
      return eFrameworkunifiedStatusNullPointer;
    }
    if (m_pui8CurOffset == NULL) {
      FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __func__, "m_pui8CurOffsetis NULL");
      return eFrameworkunifiedStatusNullPointer;
    }
    if (m_ui16RemainingLength >= SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER) {
      if (0xB == *m_pui8CurOffset) {  // check if the corresponding data is of type buffer
        m_pui8CurOffset++;
        f_ui16BufLength = *(static_cast<UI_16 *>(static_cast<PVOID>(m_pui8CurOffset)));
        f_ui16BufLength = ConvertEndian_UI16(f_ui16BufLength);
        m_pui8CurOffset += sizeof(UI_16);
        m_ui16RemainingLength = static_cast<UI_16>(m_ui16RemainingLength - SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER);

        if (m_ui16RemainingLength >= f_ui16BufLength) {
          f_pui8Buffer = m_pui8CurOffset;
          m_pui8CurOffset += f_ui16BufLength;
          m_ui16RemainingLength = static_cast<UI_16>(m_ui16RemainingLength - f_ui16BufLength);
        } else {
          l_eStatus = eFrameworkunifiedStatusFail;
        }
      } else {
        l_eStatus = eFrameworkunifiedStatusInvldID;
      }
    } else {
      l_eStatus = eFrameworkunifiedStatusFail;
    }
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetArrayCount
  /// \~english @par Brief
  ///     This function is used to get the buffer and its size.
  /// \~english @param [out] f_ui16NoOfArrayElements
  ///     UI_16 - buffer size
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - If no array id found at the current location
  /// \~english @retval eFrameworkunifiedStatusFail - no sufficient buffer to read the data
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - Data of value(m_ui16RemainingLength) is invalid(outrange of the size
  ///      SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER) [eFrameworkunifiedStatusInvldParam]
  ///      - Data of value(m_pui8CurOffset) is invalid [eFrameworkunifiedStatusInvldParam]
  ///      - Covert value(m_pui8CurOffset) failed [eFrameworkunifiedStatusFail]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Get buffer address(f_pui8Buffer) and its size.
  ///       Return the value(type EFrameworkunifiedStatus) indicate the operation result.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus GetArrayCount(UI_16 &f_ui16NoOfArrayElements) {
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    if (m_pui8CurOffset == NULL) {
      FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __func__, "m_pui8CurOffsetis NULL");
      return eFrameworkunifiedStatusNullPointer;
    }
    if (m_ui16RemainingLength >= SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER) {
      if (0xC == *m_pui8CurOffset) {  // check if the corresponding data is of type array
        m_pui8CurOffset++;
        f_ui16NoOfArrayElements = *(static_cast<UI_16 *>(static_cast<PVOID>(m_pui8CurOffset)));
        f_ui16NoOfArrayElements = ConvertEndian_UI16(f_ui16NoOfArrayElements);
        m_pui8CurOffset += sizeof(UI_16);
        m_ui16RemainingLength = static_cast<UI_16>(m_ui16RemainingLength - SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER);
      } else {
        l_eStatus = eFrameworkunifiedStatusInvldID;
      }
    } else {
      l_eStatus = eFrameworkunifiedStatusFail;
    }
    return l_eStatus;
  }

  UI_16 GetDataLength() {
    return m_ui16TotalLength;
  }

 private:
  // template <class DataType>
  // EFrameworkunifiedStatus GetValue(DataType& f_dtOutValue);


  /*
   *  \return -
   *  eFrameworkunifiedStatusFail - no sufficient data is available
   *  eFrameworkunifiedStatusOK - data retrieved
   *  eFrameworkunifiedStatusInvldID - invalid data type id passed
   */
  template <class DataType>
  EFrameworkunifiedStatus GetValue(DataType &l_dtOutValue) {
    if (m_pui8CurOffset == NULL) {
      FRAMWEORKUNIFIEDLOG(ZONE_NS_ERR, __func__, "m_pui8CurOffsetis NULL");
      return eFrameworkunifiedStatusNullPointer;
    }
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    if (m_ui16RemainingLength >= (sizeof(DataType) + SIZE_OF_PASSTHRU_DATATYPE_IDENTIFIER)) {
      if ((0x1 <= *m_pui8CurOffset) && (*m_pui8CurOffset <= 0x9))  // Get value is applicable only for basic types,
        // not for buffer and array
      {
        m_pui8CurOffset++;
        l_dtOutValue = *(static_cast<DataType *>(static_cast<PVOID>(m_pui8CurOffset)));
        m_ui16RemainingLength = static_cast<UI_16>(m_ui16RemainingLength - sizeof(DataType));
        m_pui8CurOffset += sizeof(DataType);
      } else {
        l_eStatus = eFrameworkunifiedStatusInvldID;
      }
    } else {
      l_eStatus = eFrameworkunifiedStatusFail;
    }
    return l_eStatus;
  }

  UI_8 *m_ui8Data;
  UI_16 m_ui16TotalLength;  // total data length
  UI_16 m_ui16ParamCount;

  UI_8 *m_pui8CurOffset;
  UI_16 m_ui16RemainingLength;  // remaining data length. Not yet parsed
};

/////////////////////////////////////////
//// CPassThruOutDataHandler
/////////////////////////////////////////
/**
 * @class CPassThruOutDataHandler
 * \~english @brief Data Handler
 * \~english @par   Brief Introduction
 *        Class to get/set function to do output data handler
 *
 */
class CPassThruOutDataHandler {
 public:
  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup CPassThruOutDataHandler
  /// \~english @par Summary
  ///       Constructor of CPassThruOutDataHandler class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To generate a CPassThruOutDataHandler class. \n
  ///       Member variables (m_ui16TotalLength, m_ui16ParamCount, m_ui16CurOffset, m_ui16CurrentArrCount,
  ///       m_bArrayTypeSet, m_ui8LastArrDataType) to be initialized. \n
  /// \~english @see  ~CPassThruOutDataHandler
  ////////////////////////////////////////////////////////////////////////////////////
  CPassThruOutDataHandler(UI_8 f_ui8ClientId, UI_8 f_ui8PluginId, UI_32 f_ui32CommandId)
    : m_ui16TotalLength(PASSTHRU_DATA_HEADER_LEN),
      m_ui16ParamCount(0),
      m_ui16CurOffset(0),
      m_ui16CurrentArrCount(0),
      m_bArrayTypeSet(FALSE),
      m_ui8LastArrDataType(0) {  // default data type eNull
    m_vui8Data.resize(PASSTHRU_DATA_HEADER_LEN);
    // TODO: check error condition for resize operation
    // TODO: try if &m_vui8Data[m_ui16CurOffset] directly works without casting
    *static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = f_ui8ClientId;
    m_ui16CurOffset++;
    *static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = f_ui8PluginId;
    m_ui16CurOffset++;
    *static_cast<UI_32 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = ConvertEndian_UI32(f_ui32CommandId);
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + sizeof(UI_32));
    *static_cast<UI_16 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = 0;  // initialize param count
    m_ui16ParamCount = m_ui16CurOffset;
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + sizeof(UI_16));
    m_ui8ClientId = f_ui8ClientId;
  }

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup ~CPassThruOutDataHandler
  /// \~english @par Summary
  ///       Destructor of CPassThruOutDataHandler class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of internal state
  ///       - The internal state is not changed.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To delete a CPassThruOutDataHandler class. \n
  /// \~english @see  CPassThruOutDataHandler
  ////////////////////////////////////////////////////////////////////////////////////
  ~CPassThruOutDataHandler() {
    m_vui8Data.clear();
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetClientID
  /// \~english @par Brief
  ///     This function is used to get clinet id.
  /// \~english @param none
  /// \~english @retval
  ///     UI_8 - client id
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Return the value(m_ui8ClientId).
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  UI_8 GetClientID() {
    return m_ui8ClientId;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetData
  /// \~english @par Brief
  ///     This function is used to get m_vui8Data data address.
  /// \~english @param none
  /// \~english @retval
  ///     UI_8 * - m_vui8Data data address
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Return m_vui8Data data address.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  UI_8 *GetData() {
    return static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[0]));
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup GetLength
  /// \~english @par Brief
  ///     This function is used to get m_ui16CurOffset value.
  /// \~english @param none
  /// \~english @retval
  ///     UI_16 - m_ui16CurOffset value
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Return m_ui16CurOffset value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  UI_16 GetLength() {
    return m_ui16CurOffset;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetBool
  /// \~english @par Brief
  ///     This function is used to set NSRCS_BOOL type value.
  /// \~english @param[in] f_rcsboolValue
  ///        NSRCS_BOOL - new NSRCS_BOOL value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set NSRCS_BOOL type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetBool(NSRCS_BOOL &f_rcsboolValue) {
    return SetValue<NSRCS_BOOL>(f_rcsboolValue, 0x1);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetUI8
  /// \~english @par Brief
  ///     This function is used to set UI_8 type value.
  /// \~english @param[in] f_ui8Value
  ///        UI_8 - new UI_8 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set UI_8 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetUI8(UI_8 f_ui8Value) {
    return SetValue<UI_8>(f_ui8Value, 0x2);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetUI16
  /// \~english @par Brief
  ///     This function is used to set UI_16 type value.
  /// \~english @param[in] f_ui16Value
  ///        UI_16 - new UI_16 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set UI_16 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetUI16(UI_16 f_ui16Value) {
    return SetValue<UI_16>(ConvertEndian_UI16(f_ui16Value), 0x3);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetUI32
  /// \~english @par Brief
  ///     This function is used to set UI_32 type value.
  /// \~english @param[in] f_ui32Value
  ///        UI_32 - new UI_32 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set UI_32 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetUI32(UI_32 f_ui32Value) {
    return SetValue<UI_32>(ConvertEndian_UI32(f_ui32Value), 0x4);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetUI64
  /// \~english @par Brief
  ///     This function is used to set UI_64 type value.
  /// \~english @param[in] f_ui64Value
  ///        UI_64 - new UI_64 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set UI_64 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetUI64(UI_64 f_ui64Value) {
    return SetValue<UI_64>(ConvertEndian_UI64(f_ui64Value), 0x5);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetSI8
  /// \~english @par Brief
  ///     This function is used to set SI_8 type value.
  /// \~english @param[in] f_si8Value
  ///        SI_8 - new SI_8 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set SI_8 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetSI8(SI_8 f_si8Value) {
    return SetValue<SI_8>(f_si8Value, 0x6);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetSI16
  /// \~english @par Brief
  ///     This function is used to set SI_16 type value.
  /// \~english @param[in] f_si16Value
  ///        SI_16 - new SI_16 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set SI_16 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetSI16(SI_16 f_si16Value) {
    return SetValue<SI_16>(ConvertEndian_SI16(f_si16Value), 0x7);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetSI32
  /// \~english @par Brief
  ///     This function is used to set SI_32 type value.
  /// \~english @param[in] f_si32Value
  ///        SI_32 - new SI_32 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set SI_32 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetSI32(SI_32 f_si32Value) {
    return SetValue<SI_32>(ConvertEndian_SI32(f_si32Value), 0x8);
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetSI64
  /// \~english @par Brief
  ///     This function is used to set SI_64 type value.
  /// \~english @param[in] f_si64Value
  ///        SI_64 - new SI_64 value
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - set array element of different type
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set SI_64 type value.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetSI64(SI_64 f_si64Value) {
    return SetValue<SI_64>(ConvertEndian_SI64(f_si64Value), 0x9);
  }


  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetBuffer
  /// \~english @par Brief
  ///     This function is used to set buffer and size.
  /// \~english @param[in] f_pui8Buffer
  ///        UI_8* - buffer address
  /// \~english @param[in] f_ui16BufLength
  ///        UI_16 - buffer size
  /// \~english @retval EFrameworkunifiedStatus
  /// \~english @retval eFrameworkunifiedStatusOK - data retrieved
  /// \~english @retval eFrameworkunifiedStatusInvldID - data member(m_ui8LastArrDataType) is invalid value
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set buffer and size.
  /// \~english @see none 
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetBuffer(UI_8 *f_pui8Buffer, UI_16 f_ui16BufLength) {
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    // TODO: add error check for resize operation
    if (f_pui8Buffer == NULL) {
      FRAMEWORKUNIFIEDLOG(ZONE_NS_ERR, __func__, "f_pui8Buffer is NULL");
      return eFrameworkunifiedStatusNullPointer;
    }
    m_ui16TotalLength = static_cast<UI_16>(m_ui16TotalLength + f_ui16BufLength + SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER);
    m_vui8Data.resize(m_ui16TotalLength);
    *static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = 0xB;
    m_ui16CurOffset++;
    *static_cast<UI_16 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = ConvertEndian_UI16(f_ui16BufLength);
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + sizeof(UI_16));
    std::memcpy(&m_vui8Data[m_ui16CurOffset], f_pui8Buffer, f_ui16BufLength);
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + f_ui16BufLength);

    if (!m_bArrayTypeSet) {
//      *static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount])) =
//          (*static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount]))) + 1;
      UpdateParamCount();
    } else {
      // setting array element
      m_ui16CurrentArrCount--;

      if ((m_ui8LastArrDataType != 0) && (m_ui8LastArrDataType != 0xB)) {
        l_eStatus = eFrameworkunifiedStatusInvldID;
      } else {
        m_ui8LastArrDataType = 0xB;
        if (0 == m_ui16CurrentArrCount) {
          m_ui8LastArrDataType = 0;  // default data type eNull
          m_bArrayTypeSet = FALSE;
        }
      }
    }
    return l_eStatus;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetArrayCount
  /// \~english @par Brief
  ///     This function is used to set ArrayCount.
  /// \~english @param f_ui16ArrayCount
  ///     UI_16 - ArrayCount
  /// \~english @retval none
  /// \~english @par Prerequisite
  ///      - None
  /// \~english @par Change of internal state
  ///      - None
  /// \~english @par Conditions of processing failure
  ///      - none
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync Only
  /// \~english @par Detail
  ///       Set ArrayCount.
  /// \~english @see none
  ////////////////////////////////////////////////////////////////////////////////////////////////
  EFrameworkunifiedStatus SetArrayCount(UI_16 f_ui16ArrayCount) {
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    // TODO: add error check for resize operation
    m_ui16TotalLength = static_cast<UI_16>(m_ui16TotalLength + SIZE_OF_PASSTHRU_PARAM_BUFFERTYPE_HEADER);
    m_vui8Data.resize(m_ui16TotalLength);
    *static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = 0xC;
    m_ui16CurOffset++;
    *static_cast<UI_16 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = ConvertEndian_UI16(f_ui16ArrayCount);
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + sizeof(UI_16));

    m_ui16CurrentArrCount = f_ui16ArrayCount;
    m_bArrayTypeSet = TRUE;
//    *static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount])) =
//        (*static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount]))) + 1;
    UpdateParamCount();

    // TODO: add error handling, if any other element is added before the array count reaches to f_ui16ArrayCount
    return l_eStatus;
  }

 private:
  CPassThruOutDataHandler() {

  }

  // SetValue
  // \return - eFrameworkunifiedStatusInvldID - If setting array element of different type
  template <class DataType>
  EFrameworkunifiedStatus SetValue(DataType l_dtValue, UI_8  f_ui8DataType) {
    EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
    // TODO: add error check for resize operation

    m_ui16TotalLength = static_cast<UI_16>(m_ui16TotalLength + SIZE_OF_PASSTHRU_DATATYPE_IDENTIFIER + sizeof(DataType));
    m_vui8Data.resize(m_ui16TotalLength);
    *static_cast<UI_8 *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = f_ui8DataType;
    m_ui16CurOffset++;
    *static_cast<DataType *>(static_cast<PVOID>(&m_vui8Data[m_ui16CurOffset])) = l_dtValue;
    m_ui16CurOffset = static_cast<UI_16>(m_ui16CurOffset + sizeof(DataType));

    if (!m_bArrayTypeSet) {
//      *static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount])) =
//          (*static_cast<UI_16*>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount]))) + 1;
      UpdateParamCount();
    } else {
      // setting array element
      m_ui16CurrentArrCount--;

      if ((m_ui8LastArrDataType != 0) && (m_ui8LastArrDataType != f_ui8DataType)) {
        l_eStatus = eFrameworkunifiedStatusInvldID;
      } else {
        m_ui8LastArrDataType = f_ui8DataType;
        if (0 == m_ui16CurrentArrCount) {
          m_ui8LastArrDataType = 0;  // default data type eNull
          m_bArrayTypeSet = FALSE;
        }
      }
    }
    return l_eStatus;
  }

  VOID UpdateParamCount() {
    UI_16 l_ui16ParamCount = static_cast<UI_16>(ConvertEndian_UI16(*static_cast<UI_16 *>(static_cast<PVOID>
                                                                                         (&m_vui8Data[m_ui16ParamCount]))) + 1);
    l_ui16ParamCount = ConvertEndian_UI16(l_ui16ParamCount);
    *static_cast<UI_16 *>(static_cast<PVOID>(&m_vui8Data[m_ui16ParamCount])) = l_ui16ParamCount;
  }

  // UI_8* m_ui8Data;
  std::vector<UI_8> m_vui8Data;
  UI_16 m_ui16TotalLength;  // total data length
  UI_16 m_ui16ParamCount;
  UI_16 m_ui16CurOffset;
  UI_8  m_ui8ClientId;

  // required for array data type
  UI_16 m_ui16CurrentArrCount;
  BOOL m_bArrayTypeSet;
  UI_8 m_ui8LastArrDataType;
};

#endif  // _NS_RCS_DATA_HANDLER_H__  // NOLINT  (build/header_guard)
/** @}*/
/** @}*/
/** @}*/
/** @}*/