AM243x MCU+ SDK  09.00.00
yang_db_runtime.h File Reference

Go to the source code of this file.

Typedefs

typedef struct yang_db_runtime_data yang_db_runtime_dataq_t
 

Functions

yang_db_runtime_dataq_tyang_db_runtime_init (xl4_data_data_t *xdd, uc_dbald *dbald, uc_hwald *hwald)
 
void yang_db_runtime_close (yang_db_runtime_dataq_t *ydrd)
 
int yang_db_runtime_readfile (yang_db_runtime_dataq_t *ydrd, const char *fname)
 
int yang_db_runtime_get_vtype (uc_dbald *dbald, uint8_t *aps)
 
int yang_db_runtime_put_oneline (yang_db_runtime_dataq_t *ydrd, char *kstr, char *vstr, uint8_t onhw)
 write one node db data by a string line More...
 
int yang_db_runtime_askaction (yang_db_runtime_dataq_t *ydrd, uc_notice_data_t *ucntd)
 ask to call 'uc_nc_askaction_push' More...
 
int yang_db_runtime_get_oneline (yang_db_runtime_dataq_t *ydrd, const char *line, void **value, uint32_t *vsize)
 get one node db data by a string line More...
 
int yang_db_runtime_notice_register (yang_db_runtime_dataq_t *ydrd, uc_notice_data_t *ucntd, const char *line, char *semname, UC_NOTICE_SIG_T **sem)
 
uint8_t yang_db_runtime_getvknum (uc_dbald *dbald, uint8_t *aps)
 
int yang_db_runtime_getvkvtype (uc_dbald *dbald, uint8_t *aps, uint8_t vkindex, uint8_t *vkey, uint8_t *vtype)
 
int yang_db_runtime_getvkstr (uc_dbald *dbald, xl4_data_data_t *xdd, uint8_t *aps, uint8_t vkindex, char **rstr)
 
int yang_db_runtime_waititem (yang_db_runtime_dataq_t *ydrd, const char *witem, void *waitv, uint32_t wvsize, int tout_ms)
 wait witem, if waitv!=NULL wait unitl the value matches. if waitv==NULL wait appearance of witem. More...
 

Typedef Documentation

◆ yang_db_runtime_dataq_t

typedef struct yang_db_runtime_data yang_db_runtime_dataq_t

Function Documentation

◆ yang_db_runtime_init()

yang_db_runtime_dataq_t* yang_db_runtime_init ( xl4_data_data_t xdd,
uc_dbald *  dbald,
uc_hwald *  hwald 
)

◆ yang_db_runtime_close()

void yang_db_runtime_close ( yang_db_runtime_dataq_t ydrd)

◆ yang_db_runtime_readfile()

int yang_db_runtime_readfile ( yang_db_runtime_dataq_t ydrd,
const char *  fname 
)

◆ yang_db_runtime_get_vtype()

int yang_db_runtime_get_vtype ( uc_dbald *  dbald,
uint8_t *  aps 
)

◆ yang_db_runtime_put_oneline()

int yang_db_runtime_put_oneline ( yang_db_runtime_dataq_t ydrd,
char *  kstr,
char *  vstr,
uint8_t  onhw 
)

write one node db data by a string line

Parameters
ydrdyang_db_runtime_dataq_t
kstrkey string
vstrvalue string
onhwaction on hardware
Returns
-1:error, 0:success

◆ yang_db_runtime_askaction()

int yang_db_runtime_askaction ( yang_db_runtime_dataq_t ydrd,
uc_notice_data_t *  ucntd 
)

ask to call 'uc_nc_askaction_push'

Parameters
ydrdyang_db_runtime_dataq_t
ucntduc_notice_data_t
Returns
-1:error, 0:success
Note
ydrd->aps,kvs,kss must be set already to call this function.

◆ yang_db_runtime_get_oneline()

int yang_db_runtime_get_oneline ( yang_db_runtime_dataq_t ydrd,
const char *  line,
void **  value,
uint32_t *  vsize 
)

get one node db data by a string line

Parameters
ydrdyang_db_runtime_dataq_t
linekey string
valuevalue pointer to return read value. it is reallocated inside the function. it must be NULL or allocated address.
vsizevalue size
Returns
-1:error, vtype>=0:success

◆ yang_db_runtime_notice_register()

int yang_db_runtime_notice_register ( yang_db_runtime_dataq_t ydrd,
uc_notice_data_t *  ucntd,
const char *  line,
char *  semname,
UC_NOTICE_SIG_T **  sem 
)

◆ yang_db_runtime_getvknum()

uint8_t yang_db_runtime_getvknum ( uc_dbald *  dbald,
uint8_t *  aps 
)
Returns
number of value keys on aps node.

◆ yang_db_runtime_getvkvtype()

int yang_db_runtime_getvkvtype ( uc_dbald *  dbald,
uint8_t *  aps,
uint8_t  vkindex,
uint8_t *  vkey,
uint8_t *  vtype 
)
Returns
vtype of vkindex's key on aps node. return -1: error return 0: vkey, vtype(yang_vtype_enum_t) is set

◆ yang_db_runtime_getvkstr()

int yang_db_runtime_getvkstr ( uc_dbald *  dbald,
xl4_data_data_t xdd,
uint8_t *  aps,
uint8_t  vkindex,
char **  rstr 
)
Returns
value key node string of vkindex's key on aps node. return -1: error return 0: the result str in '*rst', the caller must call UB_SD_RELMEM to releas.

◆ yang_db_runtime_waititem()

int yang_db_runtime_waititem ( yang_db_runtime_dataq_t ydrd,
const char *  witem,
void *  waitv,
uint32_t  wvsize,
int  tout_ms 
)

wait witem, if waitv!=NULL wait unitl the value matches. if waitv==NULL wait appearance of witem.

Returns
return 0:got the waitv, 1:timed out, -1:error