osaf/libs/core/include/ncsencdec_pub.h |   1 +
 osaf/libs/core/leap/hj_enc.c           |  17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)


diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
b/osaf/libs/core/include/ncsencdec_pub.h
--- a/osaf/libs/core/include/ncsencdec_pub.h
+++ b/osaf/libs/core/include/ncsencdec_pub.h
@@ -153,6 +153,7 @@
 void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
+void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
 void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
 void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
 void osaf_encode_bool(NCS_UBAID *ub, bool value);
diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
--- a/osaf/libs/core/leap/hj_enc.c
+++ b/osaf/libs/core/leap/hj_enc.c
@@ -408,6 +408,23 @@
        }
 }
 
+void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name)
+{
+       int i;
+
+       size_t len = strlen(name);
+       osaf_encode_uint16(ub, len);
+       for (i = 0; i < len; i++) {
+               osaf_encode_uint8(ub, name[i]);
+       }
+
+       // need to encode SA_MAX_NAME_LENGTH characters to remain
+       // compatible with osaf_decode_sanamet
+       for (i = len; i < SA_MAX_NAME_LENGTH; i++) {
+               osaf_encode_uint8(ub, 0);
+       }
+}
+
 void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time)
 {
        osaf_encode_uint64(ub, time);

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to