thanks a lot :)

2009/4/11 chihi asma <[email protected]>

> Hi Francesco,
>
> Thanks a  lot, I'll try this and I will tell you.
>
>
>
>
> ________________________________
> De : "[email protected]" <[email protected]>
> À : "[email protected]" <[email protected]>
> Cc : [email protected]
> 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" <[email protected]> wrote:
>
> > 4810 FETCH (BODY[1.1] NI
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>

Reply via email to