QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Logging into QNX via telnet and phindows |
Ref. No. |
QNX.000009793 |
Category(ies) |
Development, Configuration |
Issue |
We have users logging into QNX via Telnet->Phindows->exceed.
We want to be able to determine if user is using Photon. For now, we are using the Env variable PHOTON to determine. Is there a better way to do this? How about using PHSTART Env variable?
|
Solution |
You can tell if process is running on Phindows or phditto by checking the system information. PhQuerySystemInfo() returns a PhSysInfo_t structure, one of the members of which is the structure gfx (PhGrafxInfo_t). You need to check the "possibilities" member of the structure (code below).
Note that this member gives the union of information for all graphics drivers un use. Thus, you'll find out if any of them is using Phindows. Here is a sample code: ********************************************** /*local variables*/ PhSysInfo_t Info; /*grab information*/ PtQuerySystemInfo(ABW_base, &Info); /*graphics information available*/ if(Info.gen.valid_fields & Ph_GEN_INFO_NUM_GFX){ x09if(Info.gen.num_gfx > 0){ x09x09if(Info.gfx.valid_fields & Ph_GFX_POSSIBILITIES){ x09x09x09if(Info.gfx.possibilities & Ph_GCAP_PHINDOWS){ x09x09x09x09printf("working via Phindowsn"); x09x09x09else x09x09x09x09printf("not working via Phindowsn"); x09x09} x09} } ********************************************** For further info, see the docs for PhQuerySystemInfo() in the Photon Library Reference, the section on regions in the Photon Programmer's Guide, and the /usr/include/photon/PhT.h file.
Aside, it is also true that the BAUD environment variable will be defined for a 'remote' photon session. x09x09 x09x09 x09
|
|