From 5c8a07cd871853b3eb0942239d04a997016ea298 Mon Sep 17 00:00:00 2001 From: qazmko1029 Date: Sat, 30 Dec 2023 23:19:59 +0800 Subject: [PATCH] LwipMibCompiler: compile read-create object as read-write in generated C code --- .../apps/LwipMibCompiler/LwipMibCompiler/Program.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs b/contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs index 5dff8405..600c9c87 100644 --- a/contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs +++ b/contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs @@ -74,7 +74,7 @@ namespace LwipMibCompiler string mibFileName = Path.GetFileNameWithoutExtension(mibFile).ToLowerInvariant(); destFile = Path.Combine(destFile, mibFileName + ".c"); } - + string destFileExt = Path.GetExtension(destFile); if (!String.IsNullOrEmpty(destFileExt)) { @@ -94,10 +94,10 @@ namespace LwipMibCompiler } } - + // read and resolve MIB Console.WriteLine(" Reading MIB file..."); - + MibDocument md = new MibDocument(mibFile); MibTypesResolver.ResolveTypes(md.Modules[0]); MibTree mt = new MibTree(md.Modules[0] as MibModule); @@ -335,7 +335,7 @@ namespace LwipMibCompiler { Console.WriteLine(String.Format("Unsupported BaseType: Module='{0}', Name='{1}'!", mibType.Module, mibType.Name)); } - + return null; } } @@ -353,7 +353,7 @@ namespace LwipMibCompiler } else if (ote.Access == MaxAccess.readCreate) { - result.AccessMode = SnmpAccessMode.ReadOnly; + result.AccessMode = SnmpAccessMode.ReadWrite; } else if (ignoreAccessibleFlag && (ote.Access == MaxAccess.notAccessible)) { @@ -426,7 +426,7 @@ namespace LwipMibCompiler } MibTreeNode rowNode = mibTreeNode.ChildNodes[0]; - + ObjectType rot = rowNode.Entity as ObjectType; if (rot != null) {