int cfe_setenv(char *name,char *val) { cfe_xiocb_t xiocb; xiocb.xiocb_fcode = CFE_CMD_ENV_SET; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; xiocb.xiocb_psize = sizeof(xiocb_envbuf_t); xiocb.plist.xiocb_envbuf.enum_idx = 0; xiocb.plist.xiocb_envbuf.name_ptr = BIGPTR(name); xiocb.plist.xiocb_envbuf.name_length = cfe_strlen(name); xiocb.plist.xiocb_envbuf.val_ptr = BIGPTR(val); xiocb.plist.xiocb_envbuf.val_length = cfe_strlen(val); cfe_iocb_dispatch(&xiocb); return xiocb.xiocb_status; }
int cfe_setenv(char *name, char *val) { cfe_xiocb_t xiocb; xiocb.xiocb_fcode = CFE_CMD_ENV_SET; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; xiocb.xiocb_psize = sizeof(xiocb_envbuf_t); xiocb.plist.xiocb_envbuf.enum_idx = 0; xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name); xiocb.plist.xiocb_envbuf.name_length = cfe_strlen(name); xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(val); xiocb.plist.xiocb_envbuf.val_length = cfe_strlen(val); /* Set flag to program it to the flash */ xiocb.xiocb_flags = CFE_FLG_ENV_PERMANENT; cfe_iocb_dispatch(&xiocb); return xiocb.xiocb_status; }
int cfe_open(char *name) { cfe_iocb_t iocb; iocb.iocb_fcode = CFE_CMD_DEV_OPEN; iocb.iocb_status = 0; iocb.iocb_handle = 0; iocb.iocb_flags = 0; iocb.iocb_psize = sizeof(iocb_buffer_t); iocb.plist.iocb_buffer.buf_offset = 0; iocb.plist.iocb_buffer.buf_ptr = name; iocb.plist.iocb_buffer.buf_length = cfe_strlen(name); cfe_iocb_dispatch(&iocb); return (iocb.iocb_status < 0) ? iocb.iocb_status : iocb.iocb_handle; }
int cfe_getdevinfo(char *name) { cfe_iocb_t iocb; iocb.iocb_fcode = CFE_CMD_DEV_GETINFO; iocb.iocb_status = 0; iocb.iocb_handle = 0; iocb.iocb_flags = 0; iocb.iocb_psize = sizeof(iocb_buffer_t); iocb.plist.iocb_buffer.buf_offset = 0; iocb.plist.iocb_buffer.buf_ptr = name; iocb.plist.iocb_buffer.buf_length = cfe_strlen(name); cfe_iocb_dispatch(&iocb); return (iocb.iocb_status < 0) ? iocb.iocb_status : (int)iocb.plist.iocb_buffer.buf_devflags; }
int cfe_open(char *name) { cfe_xiocb_t xiocb; xiocb.xiocb_fcode = CFE_CMD_DEV_OPEN; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; xiocb.xiocb_psize = sizeof(xiocb_buffer_t); xiocb.plist.xiocb_buffer.buf_offset = 0; xiocb.plist.xiocb_buffer.buf_ptr = BIGPTR(name); xiocb.plist.xiocb_buffer.buf_length = cfe_strlen(name); cfe_iocb_dispatch(&xiocb); return (xiocb.xiocb_status < 0) ? xiocb.xiocb_status : xiocb.xiocb_handle; }
int cfe_getdevinfo(char *name) { cfe_xiocb_t xiocb; xiocb.xiocb_fcode = CFE_CMD_DEV_GETINFO; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; xiocb.xiocb_psize = sizeof(xiocb_buffer_t); xiocb.plist.xiocb_buffer.buf_offset = 0; xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(name); xiocb.plist.xiocb_buffer.buf_length = cfe_strlen(name); cfe_iocb_dispatch(&xiocb); if (xiocb.xiocb_status < 0) return xiocb.xiocb_status; return xiocb.plist.xiocb_buffer.buf_devflags; }
int cfe_getenv(char *name, char *dest, int destlen) { cfe_xiocb_t xiocb; *dest = 0; xiocb.xiocb_fcode = CFE_CMD_ENV_GET; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; xiocb.xiocb_psize = sizeof(xiocb_envbuf_t); xiocb.plist.xiocb_envbuf.enum_idx = 0; xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name); xiocb.plist.xiocb_envbuf.name_length = cfe_strlen(name); xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(dest); xiocb.plist.xiocb_envbuf.val_length = destlen; cfe_iocb_dispatch(&xiocb); return xiocb.xiocb_status; }