BB -- LINUX USB as Mass storage device -- capture eject

Hello All,
I have used g_file_storage module insmoded in BB angstrom linux …to expose it as a MSC for windows XP host…

Now Requirement in my project was to
capture the event on BB side when its disconnected from PC (Windows or linux)
and i found that g_file_storage gives disconnected messages in dmesg on BB as its disconnected from PC …

How do i access dmesg messages from C program …where i need to handle disconnect event and handle it …

Thanks
Nidhi

mohit hada wrote:

Hello All,
I have used g_file_storage module insmoded in BB angstrom linux ....to expose it as a MSC for windows XP host...........

Now Requirement in my project was to
capture the event on BB side when its disconnected from PC (Windows or linux)
and i found that g_file_storage gives disconnected messages in dmesg on BB as its disconnected from PC ........

How do i access dmesg messages from C program .....where i need to handle disconnect event and handle it ....

you could export the state of usb "connectedness" in sysfs...

How do i access dmesg messages from C program …where i need to handle disconnect event and handle it …?

“you could export the state of usb “connectedness” in sysfs…”
could you please explain it a bit more …or some url link pointers to know how to do it …

thanks for answer …
Nidhi