Home › Forums › YumaPro User Forum › Error getting data from homemade SIL
Tagged: GET2
- This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by chassap1.
-
AuthorPosts
-
-
June 4, 2020 at 2:26 pm #18800chassap1Participant
I created a SIL using make_sil_dir_pro –split from the yang model below and installed it. I think I loaded it properly with the netconfd server, but when I do a get, I get an error. I can retrieve data from the toaster sample. What am I doing wrong?
<?xml version=’1.0′ encoding=’UTF-8′?>
<rpc xmlns=”urn:ietf:params:xml:ns:netconf:base:1.0″ message-id=”13″>
<get-config>
<source>
<running/>
</source>
<filter type=”subtree”>
<ddc-demo:tsnSystem xmlns:ddc-demo=”urn:ietf:params:xml:ns:yang:smiv2:DDC-DEMO-TSN-SWITCH-MIB”>
<ddc-demo:systemReadOnlyObject/>
</ddc-demo:tsnSystem>
</filter>
</get-config>
</rpc><?xml version=’1.0′ encoding=’UTF-8′?>
<rpc-reply xmlns:ncx=”http://netconfcentral.org/ns/yuma-ncx” xmlns=”urn:ietf:params:xml:ns:netconf:base:1.0″ message-id=”13″ ncx:last-modified=”2020-06-04T19:11:15Z” ncx:etag=”74″>
<data/>
</rpc-reply>/*
* This module has been generated by smidump 0.4.8:
*
* smidump -f yang DDC-DEMO-TSN-SWITCH-MIB
*
* Do not edit. Edit the source file instead!
*/module DDC-DEMO-TSN-SWITCH-MIB {
/*** NAMESPACE / PREFIX DEFINITION ***/
namespace “urn:ietf:params:xml:ns:yang:smiv2:DDC-DEMO-TSN-SWITCH-MIB”;
prefix “ddc-demo”;/*** LINKAGE (IMPORTS / INCLUDES) ***/
/*** META INFORMATION ***/
organization
“Data Device Corporation”;contact
“105 Wilbur Place Bohemia, NY 11716”;description
“TSN Switch Demo.”;revision “2018-04-05” {
description
“Initial Release.”;
}container tsnSystem {
leaf systemReadOnlyObject {
type int32;
config false;
description
“This parameter indcates a read only object.”;
}leaf systemReadWriteObject {
type int32;
config true;
description
“This parameter indicates the a read-write object”;
}
}} /* end of module DDC-DEMO-TSN-SWITCH-MIB */
-
June 5, 2020 at 6:00 pm #18801andyKeymaster
Did you implement the GET1 or GET2 callbacks in the SIL code that was generated?
After you generate the SIL code there are stub functions that have to be filled in
or else no data will be returned.Here is an example for GET2:
https://yumaworks.freshdesk.com/en/support/solutions/articles/1000258818-operational-data -
June 6, 2020 at 1:40 pm #18802chassap1Participant
Here is my get function. I was expecting the value 0x4DDC. Note: In my original post I used a get-config command. I tried just a get command and got same results. Its like it can’t find my leaf node. Is there any other initialization I need to do?
/* put your static variables here */
static int32 readOnlyObject = 0x4DDC;
static int32 readwriteObject;/********************************************************************
* FUNCTION u_DDC_DEMO_TSN_SWITCH_MIB_tsnSystem_systemReadOnlyObject_get
*
* Get database object callback for leaf systemReadOnlyObject
* Path: /tsnSystem/systemReadOnlyObject
* Fill in ‘dstval’ contents
*
* INPUTS:
* see ncx/getcb.h for details (getcb_fn_t)
*
* RETURNS:
* error status
********************************************************************/
status_t u_DDC_DEMO_TSN_SWITCH_MIB_tsnSystem_systemReadOnlyObject_get (
val_value_t *dstval)
{
status_t res = NO_ERR;
int32 v_systemReadOnlyObject;if (LOGDEBUG) {
log_debug(“\nEnter u_DDC_DEMO_TSN_SWITCH_MIB_tsnSystem_systemReadOnlyObject_get callback”);
}/* set the v_systemReadOnlyObject var here, change zero */
v_systemReadOnlyObject = readOnlyObject;
VAL_INT(dstval) = v_systemReadOnlyObject;return res;
} /* u_DDC_DEMO_TSN_SWITCH_MIB_tsnSystem_systemReadOnlyObject_get */
- This reply was modified 4 years, 4 months ago by chassap1.
-
June 8, 2020 at 12:23 pm #18804chassap1Participant
I got my readonly leaf to return data. I needed to add –module=DDC-DEMO-TSN-SWITCH-MIB.
Now I’m trying to figure out how to figure out how to get-config from my readwrite leaf object.
-
-
AuthorPosts
- You must be logged in to reply to this topic.