You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by chihi asma <ch...@yahoo.fr> on 2009/04/07 18:09:24 UTC

Re : Problem with upnp examples

Thanks Francesco,

I tried to resolve the problem but I still have the same error, the TV can't get the date correctly from the remote clock.
Can anyone help me?

Thanks in advance

Asma




________________________________
De : Francesco Furfari <fr...@isti.cnr.it>
À : users@felix.apache.org
Envoyé le : Jeudi, 2 Avril 2009, 14h06mn 27s
Objet : Re: Problem with upnp examples

hello,

if I remember well, it should be a problem of data types used in the examples, actually the clock sends time events, not dates event. We continued to  used the same types used by Cyberlink devices (that's time or string I don't remember perfectly now) , but the TV uses a Date type. So converting the long in a date causes problems with remote devices.

regards,
francesco

chihi asma wrote:
> Hi,
> 
> I'm testing felix upnp examples on  a pc and an embedded system. On the PC, I'm running the base driver, the tester, the tv and the clock. On the embedded system, I'm running the clock.
> - The devices on the PC communicate normaly, the TV displays the date of the clock  correctly.
> - However, when I start the clock on the embedded system, the tester of the PC detects it but the TV displays the date incorrectly.
> 
> Can anyone tell me whats wrong? 
> Thanks in advance.
> 
> Asma
> 
> 
> 
>      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


      

Re: Re : Re : Problem with upnp examples

Posted by sana <sa...@gmail.com>.
thanks a lot :)

2009/4/11 chihi asma <ch...@yahoo.fr>

> Hi Francesco,
>
> Thanks a  lot, I'll try this and I will tell you.
>
>
>
>
> ________________________________
> De : "francesco.furfari@isti.cnr.it" <fr...@isti.cnr.it>
> À : "users@felix.apache.org" <us...@felix.apache.org>
> Cc : francesco.furfari@isti.cnr.it
> Envoyé le : Samedi, 11 Avril 2009, 17h45mn 54s
> Objet : Re: Re : Problem with upnp examples
>
> Hi Asma, Sana
>
> I fixed the bug by changing the type used by the clock to a DateTime
> type. Update and rebuild the TV and clock device to test them.
>
> FYI, 1) I changed the types used by the UPnPStateVariable of the clock
>
> *TimeStateVariable*, line 46;
>
> public Class getJavaDataType() {
>
> return Date.class; // before Long.class
>
> }
>
> public String getUPnPDataType() {
>
> return TYPE_DATETIME; // before TYPE_TIME
>
> }
>
> 2) The right Date value is fired now by the clock
>
> *ClockDevice* line 143;
>
> -- old version ---
>
> public void update() {
>
>   Clock clock = Clock.getInstance();
>   Calendar cal = clock.getCalendar();
>   long time = cal.getTime().getTime();
>   UPnPStateVariable variable = timerService.getStateVariable("Time");
>     notifier.propertyChange(
>       new PropertyChangeEvent(variable,
>       "Time",
>       new Long(time-1000),
>       new long(time)));
> }
>
>
>
> -- new version --
>
> public void update() {
>
> Clock clock = Clock.getInstance();
> Calendar cal = clock.getCalendar();
> Date date = cal.getTime();
> UPnPStateVariable variable = timerService.getStateVariable("Time");
> notifier.propertyChange(
>     new PropertyChangeEvent(variable,"Time",null,date));
> }
>
> 3) finally, the TV is refreshed by using directly a Date .
>
> *TvDevice*, line 263
>
> public void notifyUPnPEvent(
>
>     String deviceId,String serviceId, Dictionary events) {
>     ....
>     if (deviceId.indexOf("Clock") != -1){
>       Date date = (Date) events.get("Time");
>       clockTime = date.toString();
>     }
> ...
>
>
>
> The converter was ok. In the UPnP OSgi Spec. the time is mapped to a
> long, and the DateTime to a Date.
>
> BRs,
> francesco
>
>
>
>
>
> On 4/10/2009, "sana" <sa...@gmail.com> wrote:
>
> > 4810 FETCH (BODY[1.1] NI
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
>

Re : Re : Problem with upnp examples

Posted by chihi asma <ch...@yahoo.fr>.
Hi Francesco,

Thanks a  lot, I'll try this and I will tell you.




________________________________
De : "francesco.furfari@isti.cnr.it" <fr...@isti.cnr.it>
À : "users@felix.apache.org" <us...@felix.apache.org>
Cc : francesco.furfari@isti.cnr.it
Envoyé le : Samedi, 11 Avril 2009, 17h45mn 54s
Objet : Re: Re : Problem with upnp examples

Hi Asma, Sana

I fixed the bug by changing the type used by the clock to a DateTime
type. Update and rebuild the TV and clock device to test them.

FYI, 1) I changed the types used by the UPnPStateVariable of the clock

*TimeStateVariable*, line 46;

public Class getJavaDataType() {

return Date.class; // before Long.class

}

public String getUPnPDataType() {

return TYPE_DATETIME; // before TYPE_TIME

}

2) The right Date value is fired now by the clock

*ClockDevice* line 143;

-- old version ---

public void update() {

  Clock clock = Clock.getInstance();
  Calendar cal = clock.getCalendar();
  long time = cal.getTime().getTime();
  UPnPStateVariable variable = timerService.getStateVariable("Time");
    notifier.propertyChange(
      new PropertyChangeEvent(variable,
      "Time",
      new Long(time-1000),
      new long(time)));
}



-- new version --

public void update() {

Clock clock = Clock.getInstance();
Calendar cal = clock.getCalendar();
Date date = cal.getTime();
UPnPStateVariable variable = timerService.getStateVariable("Time");
notifier.propertyChange(
    new PropertyChangeEvent(variable,"Time",null,date));
}

3) finally, the TV is refreshed by using directly a Date .

*TvDevice*, line 263

public void notifyUPnPEvent(

    String deviceId,String serviceId, Dictionary events) {
    ....
    if (deviceId.indexOf("Clock") != -1){
      Date date = (Date) events.get("Time");
      clockTime = date.toString();
    }
...



The converter was ok. In the UPnP OSgi Spec. the time is mapped to a
long, and the DateTime to a Date.

BRs,
francesco





On 4/10/2009, "sana" <sa...@gmail.com> wrote:

> 4810 FETCH (BODY[1.1] NI

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


      

Re: Re : Problem with upnp examples

Posted by fr...@isti.cnr.it.
Hi Asma, Sana

I fixed the bug by changing the type used by the clock to a DateTime
type. Update and rebuild the TV and clock device to test them.

FYI, 1) I changed the types used by the UPnPStateVariable of the clock

*TimeStateVariable*, line 46;

public Class getJavaDataType() {

return Date.class; // before Long.class

}

public String getUPnPDataType() {

return TYPE_DATETIME; // before TYPE_TIME

}

2) The right Date value is fired now by the clock

*ClockDevice* line 143;

-- old version ---

public void update() {

  Clock clock = Clock.getInstance();
  Calendar cal = clock.getCalendar();
  long time = cal.getTime().getTime();
  UPnPStateVariable variable = timerService.getStateVariable("Time");
    notifier.propertyChange(
      new PropertyChangeEvent(variable,
      "Time",
      new Long(time-1000),
      new long(time)));
}



-- new version --

public void update() {

Clock clock = Clock.getInstance();
Calendar cal = clock.getCalendar();
Date date = cal.getTime();
UPnPStateVariable variable = timerService.getStateVariable("Time");
notifier.propertyChange(
    new PropertyChangeEvent(variable,"Time",null,date));
}

3) finally, the TV is refreshed by using directly a Date .

*TvDevice*, line 263

public void notifyUPnPEvent(

    String deviceId,String serviceId, Dictionary events) {
    ....
    if (deviceId.indexOf("Clock") != -1){
       Date date = (Date) events.get("Time");
       clockTime = date.toString();
    }
...



The converter was ok. In the UPnP OSgi Spec. the time is mapped to a
long, and the DateTime to a Date.

BRs,
francesco





On 4/10/2009, "sana" <sa...@gmail.com> wrote:

> 4810 FETCH (BODY[1.1] NI

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Re : Problem with upnp examples

Posted by sana <sa...@gmail.com>.
hi francesco,


i have the same problem , can you please tell me where can i find where tv
can find the variable sent by Clock ( in which file/line)
and where the clock (in Clock code ( in which file/line)) is putting the
value and sending it to the TV



thanks in advance,
regards
Sana

2009/4/8 Francesco Furfari <fr...@isti.cnr.it>

> Hi
>
> did you use Date instead of Time data type with the Clock?
> Let me a couple of days to check if the problem is in the converter.
>
>
> regards,
> francesco
>
> chihi asma wrote:
>
>> Thanks Francesco,
>>
>> I tried to resolve the problem but I still have the same error, the TV
>> can't get the date correctly from the remote clock.
>> Can anyone help me?
>>
>> Thanks in advance
>>
>> Asma
>>
>>
>>
>>
>> ________________________________
>> De : Francesco Furfari <fr...@isti.cnr.it>
>> À : users@felix.apache.org
>> Envoyé le : Jeudi, 2 Avril 2009, 14h06mn 27s
>> Objet : Re: Problem with upnp examples
>>
>> hello,
>>
>> if I remember well, it should be a problem of data types used in the
>> examples, actually the clock sends time events, not dates event. We
>> continued to  used the same types used by Cyberlink devices (that's time or
>> string I don't remember perfectly now) , but the TV uses a Date type. So
>> converting the long in a date causes problems with remote devices.
>>
>> regards,
>> francesco
>>
>> chihi asma wrote:
>>
>>> Hi,
>>>
>>> I'm testing felix upnp examples on  a pc and an embedded system. On the
>>> PC, I'm running the base driver, the tester, the tv and the clock. On the
>>> embedded system, I'm running the clock.
>>> - The devices on the PC communicate normaly, the TV displays the date of
>>> the clock  correctly.
>>> - However, when I start the clock on the embedded system, the tester of
>>> the PC detects it but the TV displays the date incorrectly.
>>>
>>> Can anyone tell me whats wrong? Thanks in advance.
>>>
>>> Asma
>>>
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Re : Problem with upnp examples

Posted by Francesco Furfari <fr...@isti.cnr.it>.
Hi

did you use Date instead of Time data type with the Clock?
Let me a couple of days to check if the problem is in the converter.

regards,
francesco

chihi asma wrote:
> Thanks Francesco,
> 
> I tried to resolve the problem but I still have the same error, the TV can't get the date correctly from the remote clock.
> Can anyone help me?
> 
> Thanks in advance
> 
> Asma
> 
> 
> 
> 
> ________________________________
> De : Francesco Furfari <fr...@isti.cnr.it>
> À : users@felix.apache.org
> Envoyé le : Jeudi, 2 Avril 2009, 14h06mn 27s
> Objet : Re: Problem with upnp examples
> 
> hello,
> 
> if I remember well, it should be a problem of data types used in the examples, actually the clock sends time events, not dates event. We continued to  used the same types used by Cyberlink devices (that's time or string I don't remember perfectly now) , but the TV uses a Date type. So converting the long in a date causes problems with remote devices.
> 
> regards,
> francesco
> 
> chihi asma wrote:
>> Hi,
>>
>> I'm testing felix upnp examples on  a pc and an embedded system. On the PC, I'm running the base driver, the tester, the tv and the clock. On the embedded system, I'm running the clock.
>> - The devices on the PC communicate normaly, the TV displays the date of the clock  correctly.
>> - However, when I start the clock on the embedded system, the tester of the PC detects it but the TV displays the date incorrectly.
>>
>> Can anyone tell me whats wrong? 
>> Thanks in advance.
>>
>> Asma
>>
>>
>>
>>      
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
>       

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org