Skip navigation.
Home
The QNX Community Portal

View topic - How to create an environment variable in BSP startup file ?

How to create an environment variable in BSP startup file ?

Read-only archive of qnx.bsp (Discuss building an image, flashing a board or using a BSP) at inn.qnx.com

How to create an environment variable in BSP startup file ?

Postby metais » Mon Jul 17, 2006 1:45 pm

Hi everybody !

I want to create an environment variable in startup in order to retrieve it
in a QNX program.
Startup will read the value in a EEPROM, store it in an environment variable
and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I want
to create a new one. The function add_string could be OK but how my QNX
program can retrieve the index returned ?

Thanks for your help !
metais
Active Member
 
Posts: 17
Joined: Thu Mar 02, 2006 5:01 pm

Re: How to create an environment variable in BSP startup fil

Postby Alexander Koppel » Tue Aug 01, 2006 9:06 pm

You may want to take a look at confstr()in the Library Reference, getconf,
setconf in the Utilities Reference and "Configuration strings" in the
Configuring Your Environment chapter of the Neutrino User's Guide.

"metais" <laurent.metais@cp.com> wrote in message
news:e9g45a$s61$1@inn.qnx.com...
Hi everybody !

I want to create an environment variable in startup in order to retrieve
it in a QNX program.
Startup will read the value in a EEPROM, store it in an environment
variable and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I
want to create a new one. The function add_string could be OK but how my
QNX program can retrieve the index returned ?

Thanks for your help !


Alexander Koppel
 

Re: How to create an environment variable in BSP startup fil

Postby David Gibbs » Wed Aug 02, 2006 1:46 pm

metais <laurent.metais@cp.com> wrote:
Hi everybody !

I want to create an environment variable in startup in order to retrieve it
in a QNX program.
Startup will read the value in a EEPROM, store it in an environment variable
and so my QNX program will retrieve it.

I saw that function add_typed_string can set predefined variable but I want
to create a new one. The function add_string could be OK but how my QNX
program can retrieve the index returned ?

I think add_typed_string() will stick it in the system page, there may be
some macros or functions in <sys/syspage.h> that will allow you to retrieve
it.

-David
--
David Gibbs
QNX Training Services
dagibbs@qnx.com
David Gibbs
 


Return to qnx.bsp

Who is online

Users browsing this forum: No registered users and 1 guest