]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/smux/value2os.h
snma agent -> smux
[stg.git] / projects / stargazer / plugins / other / smux / value2os.h
diff --git a/projects/stargazer/plugins/other/smux/value2os.h b/projects/stargazer/plugins/other/smux/value2os.h
new file mode 100644 (file)
index 0000000..830fb3b
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __VALUE_2_OS_H__
+#define __VALUE_2_OS_H__
+
+template <typename T>
+bool ValueToOS(const T & value, ObjectSyntax * objectSyntax);
+
+template <>
+inline
+bool ValueToOS<int>(const int & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_number;
+asn_long2INTEGER(&simpleSyntax->choice.number, value);
+return true;
+}
+
+#endif