Hello everyone,
As mentioned in subject, I am working on a project in which SNMP protocol is to be implemented. I have written a code for SNMP Protocol which is working fine with the LPC1768 controller board. I am able to receive all the data(string) which is sent from controller to PC using ethernet. These strings are written in MIB_STR() function of MIB Table,
for eg.
const MIB_ENTRY snmp_mib[] = {
/* ---------- System MIB ----------- */
/* SysDescr Entry */
{ MIB_OCTET_STR | MIB_ATR_RO,
8, {OID0(1,3), 6, 1, 2, 1, 1, 1, 0},
MIB_STR("Hello World"), //as this string i am not updating while execution of main function so it is working fine
NULL }
};
but when i am trying to update current values of parameters in place of string, it is not allowing to do that.
for eg.
const MIB_ENTRY snmp_mib[] = {
/* ---------- System MIB ----------- */
/* SysDescr Entry */
{ MIB_OCTET_STR | MIB_ATR_RO,
8, {OID0(1,3), 6, 1, 2, 1, 1, 1, 0},
MIB_STR(Temp[1]), //error: initializer element is not a compile-time constant
NULL }
};
Temperature values are saved in an array in ASCII format.
so, I am planning to Copy the same MIB Table to RAM when controller starts execution of code & then i want controller to read MIB table from the specific RAM address area so, i can update Current values of parameters at respective RAM Address locations.
may i know how to make controller to read from Specific RAM address location instead of FLASH memory while execution of main function.
Has anyone encountered this issue or maybe even found a solution?
Thank you.
Regards,
Pruthviraj Gidveer.
Hi, PvgidVeer,
Can you tell us the tools you are using? is the MIB_STR(Temp[1]) a function or macro? do you have it's prototype?
BR
XiangJun Rong
Hello, Xiangjun_rong,
I am using Keil uVision 4 IDE and MIB_STR() is declared as a macro in Net_Config.h file
macro declaration in Net_Config.h is as given below.
/* SNMP-MIB Macros */
#define MIB_STR(s) sizeof(s)-1, s
Thanks & Regrads,
Pruthviraj Gidveer.
Hi,
Unfortunately, I do not see the Net_Config.h file in the LWIP directory, can you post all the project to the community so that we can have a review.
BR
XiangJun Rong
Hi everyone,
Here i have attached a code, If you compile this code you will get an error, to resolve that error goto line no.49 of SNMP_MIB.c file & do modifications as mentioned in commented line then it will work. but actually i want to print the values of which are stored in dataString[]. If i try to print values from the array dataString[] it will give an error. Help me to resolve this problem.
Thanks & regards,
Pruthviraj Gidveer.