Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Finding mediastores and their states: (3 Items)
   
Finding mediastores and their states  
Hello,

Is there a way to query mme how many media stores have already been detected and what their id's and states are?

Our hardware has two USB ports and mcd can detect the presence of an USB stick in either of these two ports. It does not
 matter if the USB stick was inserted before or after power up. The USB stick gets mounted as /fs/usb0.

Our client application registers for mme events and can detect when a USB stick was inserted thru these events "
EVENT_MS_STATECHANGE", "EVENT_MS_SYNC_STARTED", ..., "EVENT_MS_DB_SYNC_COMPLETE", and "EVENT_SYNCCOMPLETE".

These all worked fine when the USB stick was inserted after the client application has already started. I am able to 
determine, from the events received, the mediastore id and its state. 

The problem comes if the USB stick was inserted before power up, none of the events get captured by the client 
application because the client application started after mcd has already detected and mounted the USB stick.

What can our client application do, when it starts, to discover mediastores that have already been detected by mcd?

Thanks.

Re: Finding mediastores and their states  
You can query the MME mediastores tables in the database. Each mediastore
has a state (active or unavailable) which will tell you if it is currently
inserted or not.

Alternatively, in your mme.conf, there is this setting:
<!-- Controls whether or not devices are automatically detected
                 by the MME. This is independent of synchronization. -->
            <!--<DeviceDetection enabled="true"/>-->


If you uncomment the DeviceDetection and set it to false, I.e.:
<DeviceDetection enabled="false"


The MME, when it starts, won't monitor devices. Instead, once your app is
running, you can connect to the MME, register for events and then issue
mme_start_device_detection(), this way you won't miss any of the
statechange events.

Regards,
Gilles

Re: Finding mediastores and their states  
Thank you Gilles,

I tried query mediastore tables and got the info I needed.

Regards,

Guu