QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Implementing console functions under Photon |
Ref. No. |
QNX.000009231 |
Category(ies) |
Development, Character I/O |
Issue |
We have utilities that use the console read/write functions but now we would like them to work under Photon also.
What are the equivalent routines?
|
Solution |
There are none. The console functions talk to the device driver (Dev.con or Dev.win) to transfer data from and to the screen buffer. Under Photon, the device driver (Dev.pty) has no screen buffer. The screen buffer is maintained by pterm, but your application has no way of accessing that buffer. This is similar to a real serial terminal: Dev.ser has no idea what the screen looks like, and there's no way your software could ask the terminal.
The only way of knowing what the screen looks like is by having an copy of it in memory and updating the copy whenever you output anything. That's what terminal libraries (qnxterm) do. Of course, this only works if you're the only process that draws on the screen.
BTW If you really can't live without the console functions in Photon, you could try writing a device driver that supports them (just like Dev.win under QNX Windows). The PtTerminal widget should have all the hooks that such a driver might need. |
|