Comments (6)
That line did come out right above, should be:
snmp->addReadWriteStringHandler(".1.3.6.1.4.1.38218.1.3.1.0", (char**)(*conf).sensor_name, 40, true);
from arduino_snmp.
Hi @dmarc1234.
What is the type of (*conf).sensor_name
?
If it is a char*
, then you'll need to pass the reference of it to addReadWriteStringHandler()
.
For example: snmp->addReadWriteStringHandler(".1.3.6.1.4.1.38218.1.3.1.0", &(*conf).sensor_name, 40, true);
You shouldn't need to cast it to a char** unless it's not a char* originally.
Let me know if that helps!. Thanks.
from arduino_snmp.
Thank you for your reply.
Yes, (*conf).sensor_name
is a char
within the CONFIG_REG structure.
I have tried:
snmp->addReadWriteStringHandler(".1.3.6.1.4.1.38218.1.3.1.0", &(*conf).sensor_name, 40, true);
but it will not compile, I need to cast to char** to make it compile, so:
snmp->addReadWriteStringHandler(".1.3.6.1.4.1.38218.1.3.1.0", (char**)&(*conf).client_name, 40, true);
which compiles but still results in a SNMP no such object error.
Also tried a different approach as follows:
CONFIG_REG *config = &configReg;
snmp->addReadWriteStringHandler(".1.3.6.1.4.1.38218.1.3.1.0", (char**)&config->sensor_name, 40, true);
which returns a blank string rather than the no object error.
Really not sure where to go next ?
from arduino_snmp.
@dmarc1234 Can you show me the declaration of the CONFIG_REG
type? What data type is sensor_name
?
from arduino_snmp.
This is how CONFIG_REG is defined:
// Structure to contain configuration information
typedef struct
{
char sensor_name[40]; // Sensor name
char sensor_location[40]; // Sensor location
} CONFIG_REG;
and then declared as a global in main.c :
CONFIG_REG configReg;
I then create a pointer to it using:
CONFIG_REG *config = &configReg;
from arduino_snmp.
@0neblock did you see my message in relation to the structure, still struggling to get this to work.
from arduino_snmp.
Related Issues (20)
- ESP8266 v3.0 breaks library - Use 2.7.4 (or older) HOT 5
- esp8266 Vscode HOT 3
- SNMP Manager HOT 2
- No reply to snmpwalk request to .1 HOT 2
- No reply to request to 1.0.8802.1.1.2.1.3.6.0 HOT 1
- OID response of .0.0 HOT 2
- Lot of libraries missing to compile on a MEGA2560 HOT 3
- SNMP trap HOT 1
- Issue when GoSNMP library uses the default MaxRepetitions=50 HOT 1
- transferring tables
- Float HOT 1
- ip address HOT 2
- addDynamicWrite ?
- How to "Delete" a SNMPTrap object when allocated with the new SNMPTrap command HOT 1
- Example not working
- How can I connect to an snmp manager having a password in communities?
- Long Form Length bug -- fix included HOT 1
- addDynamicIntegerHandler usage
- How to reuse trap and update setTrapOID() for each send
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino_snmp.