Jumping Jack Flash weblog

Archivio per il 'Symbian' Categoria

Articoli riguardanti il sistema operativo Symbian in generale

Turn your phone into an universal remote control

Pubblicato da jumpjack su 10 Giugno 2008

This short tutorial shows how to turn almost any cellphone into an universal IR remote control.

CHECK GoogleCode page for downloads and updates

Old post (with detailed instructions about how to build hardware)

How I did it (and credits)

Why it should work also on non-stereo cellphones (but it does not?!?) (see also excel file)

Other uses for old phones
Available patents (not mine):
Infrared generator from audio signal source
IR receiver using IR transmitting diode

Requirements:

- a cellphone with stereo audio output (audio left , audio right , ground) or symmetrical audio output (audio+, audio-)

- 2 IR leds

- a wired headset compatible with the phone

- a PC with audio card

- an audio recording software on PC

- an audio editing software for PC or an audio sinthesyzer software for PC

This project does not depend on O.S. used: you just need ANY computer capable of recording audio and create audio files from scratch. Linux, Windows, MacOSX or whatelse makes NO difference.

Please look at this post to know how to:
- build an IR receiver for the PC
- sample a remote control
- (create a WAV file using Audacity program) (not strictly needed: this article describe an alternate method).

Once you sampled all needed buttons of your remote, it’s just a matter of building a proper WAV file for each one of them. If you don’t want to use Audacity to do it manually, you can use SOX program: it creates pieces of “raw” audio file, which joined together build up the final WAV file.

Here you find example scripts (for DOS/Windows environment) which build a WAV file based on binary description of the remote signal. You have to setup the unizeri.bat file to have it matching the sampled signal. Then call create.bat specifying as parameter the “creator file” (unizeri-raw, or unizeri-tv,… ), the final WAV file (testbutton) and the number of additional times you want the command is repeated (at least ONE occurrence will be alway created):

create unizeri-raw testbutton 4

(no extensions required for filenames) (NOTE: script must be run inside SOX folder).

This will result in a tesbutton.wav file which, played on a phone (or on PC, or on any audio capable device), equipped with audio-to-IR converter, to control your device.

The audio-to-IR converter:

It is just a couple of LEDs connected in oppopsite ways to “audio output left” and “audio output right” (for normal phones) or to “audio+” and “ground” (for phones with symetrical audio output like nokia 6680). In symetricl ouptu, Left- and Right- must be connected together (see below).

Audio-to-IR converter:

Connections for nokia 6680:

(10 Ohm resistor not strictly needed)

—————————————————-

Study about physics/optical phoenomena involved in this project:

Excel file - how to play a 38000 Hz “sound” through a 20000Hz-capable audio device

Big image summarizing Excel data

————————-

Forums about Ledrem:

Italian:

Nokioteca

PLC Forum

PC Tuner

HW upgrade

Planetmobile

English:

IP-mart.com

Hackint0sh

Pubblicato su Infrarossi, Sviluppo, Symbian, hardware | 2 Commenti »

What can you do with an old cellphone?

Pubblicato da jumpjack su 7 Giugno 2008

An old nokia series 60 phone (like nokia 6600 or 6680) costs around 50$. But it has:

- bluetooth support

- infrared support

- fotocamera

- video remote surveillance

- internet access

- SMS support

- USB support

- Python support (pys60)

Mix all these things together, and you could obtain:

1) 3d foto/video (*)

2) touchscreen (wiimote-like)

3) remote video surveillance

4) Add an IR led to your recipe, and you obtain an SMS-controlled remote-control.

5) Add a bluetooth GPS receiver and you have a GPS antitheft.

…any more ideas?

It’s just a matter of writing proper software!

(*) To make 3d photo of moving subjects, or 3d video, you need two separate but synchronized cameras. Bluetooth conection should allow such a synchronization, in such a way that when you shoot a photo on one phone, at the same time it’s shot on the other phone.

Pubblicato su GPS, Infrarossi, Symbian, hardware, intuizioni | Non ci sono Commenti »

Appunti su fattibilità telecomando tramite cellulare

Pubblicato da jumpjack su 10 Maggio 2008

Varie possibilità:

già pronte:

Novii Remote (solo alcuni nokia, a pagamento), utilizza porta IrDA, non puo’ campionare ma solo usare codici da scaricare da internet; c’e' da capire come creare nuovi codici

Psiloc IR Remote (moltissimi nokia s60, anche 3rd, stesso principio di Novii: non puo’  campionare).

La porta IrDa non puo’ essere usata per campionare i telecomandi, per motivi hardware, ma puo’ ”riprodurli”.

Pagina Psiloc da dove scaricare codici pronti:

http://irremote.psiloc.com/Show.aspx?d=TV

Pagina Psiloc per inviare codici da convertire:

http://irremote.psiloc.com/Wizard.aspx

Siti che forniscono codici per telecomandi (devono essere convertiti nei formati di Novii e Psiloc):

http://www.remotecentral.com

http://lirc.sourceforge.net/remotes/

Forum vari su configurazione Psiloc IR Remote:
http://www.nokioteca.net/home/forum/index.php?showtopic=79009&st=180
http://www.spaziocellulare.com/forum/showthread.php?t=11487&page=2
http://forum.telefonino.net/showthread.php?t=347683&page=3

Scaricamento codici pronti:

http://www.fileden.com/files/2008/2/23/1777406/APPS/IrRemote%20Codes%20Adapter%201.0.rar
http://www.novii.tv/up/forum/download.php?id=293&sid=5be11bcf85de88dc0f30504b4c4ea88d
http://www.novii.tv/up/forum/download.php?id=292&sid=5be11bcf85de88dc0f30504b4c4ea88d
http://lirc.sourceforge.net/remotes.tar.bz2
Download Psiloc IR Remote:
http://download12.getjar.com/downloads/web/pub/1758/Psiloc_Total_irRemote.sis
http://web.archive.org/web/20060321063024/http://www.psiloc.com/files/consumer/series60/Psiloc_TotalirRemote_S60.sis   (2.0 ???)

Download Novii Remote:
http://www.novii.tv/soft/NRN_21_Novii.zip
Programmi analoghi, per Windows Mobile (pocketPc)

Vantaggio: i PocketPC POSSONO campionare i telecomandi!

http://www.wincesoft.de/html/remotecontrol_ii.html

http://vitotechnology.com/en/products/remote.html

http://www.griffintechnology.com/griffinmobile/totalremote/  (fornisce anche hardware da collegare a presa cuffia, cosi’ qualunque dispositivo con uscita cuffia puo’ diventare telecomando! (ma prima bisogna registrare i codici!))  SITO MORTO

Progetti hardware di campionatori/replicatori telecomandi:

http://pc-ir-remote-vb.sourceforge.net/     PC IR Remote

http://www.geocities.com/odednoam/   IR Remote  - progetto semplicissimo: campionatore costituito da normale fotoresistenza collegata a scheda audio! (funziona solo al buio, registra codici telecomandi, per poi riprodurli sempre con scheda audio, stavolta collegata a diodo emettitore)

http://features.engadget.com/2004/07/27/how-to-turn-your-ipod-in-to-a-universal-infrared-remote-control/   Usare l’IPOD e il ”recorder di raggi infrarossi” della Griffin per telecomandare dispositivi.
Spiega anche come registrare IR senza PocketPC, con semplice diodo ricevente IR collegato a scheda audio.

http://people.inf.ethz.ch/mringwal/lirc/   Campionatore per LIRC e WinLIRC  (linux e windows)

http://it.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=2861419    Diodo IR ricevente su RS-compnents

Pubblicato su Infrarossi, Symbian | Contrassegnato da tag: , , , , , , , , | Non ci sono Commenti »

Esportazione appunti (Jotter) da cellulari Symbian UIQ 2.x (p800, p900, Motorola a1000)

Pubblicato da jumpjack su 21 Febbraio 2008

I telefoni UIQ 2.x usano per gli appunti un formato particolare, probabilmente proprieario, binario,
incompatibile con qualunque altra applicazione. Su alcuni modelli è FORSE possibile esportali tramite
SyncML, ma in ogni caso non sul mio Motorola a1000.

Questo è uno studio di reverse engineering sul formato del jotter, che dovrebbe portare, con l’aiuto di chi legge,
a scrivere un programma per PC in grado di esportare le note del Jotter.

Gli appunti sono organizzati su due file:

c:\system\apps\jotter\jotter.ini  File delle categorie

c:\documents\jotter\jotter  File dei dati

Il file jotter.ini sembra contenere il percorso c:\documents\jotter\jotter tante volte quante sono le
categorie esistenti, incluse quelle predefinite Generale e Personale.

E’ inoltre presente l’elenco delle categorie; ogni entry è formato da:

un  byte che indica la lunghezza del testo MOLTIPLICATA PER 4 (???)

il testo

4 byte che rappresentano l’UID della categoria; il terzo di questi byte vale 0×10 se la categoria è
“di sistema” (Generale, Personale, e forse un’altra (???)  ).

La categoria “Tutto” ha l’UID speciale ff ff 00 00

Categoria ”Personale”: 01 10 00 00

Categoria ”Generale”: 02 10 00 00

Sembra che, A VOLTE (???), aggiungendo una nuova categoria, questo elenco non vnga aggiornato, ma quello nuovo viene accodato a quello vecchio.

Le categorie sono elencate in ordine alfabetico.

E’ POSSIBILE che cambiando i percorsi associati alle categorie si possa usare un file Jotter
diverso per ogni categoria (???). Forse bisogna prima creare a mano le cartelle (???).

Il file Jotter contiene i dati degli appunti. Ogni entry è formato da 6 campi (elencati all’inizio del file):

Create_date (8), Update_date (8), Flags ( 8) , UID (4) , Sketch (6), Text_Jot (xxx)

Le date sono in formato symbian standard (vedi articolo apposito).

I flag sono sempre tutti a 00 00 00 sul mio A1000.

L’UID è ovviamente quello della categoria associata.

“Sketch” è presente solo se c’e' un disegno associato alla nota

Text_jot è formato da 2 byte:

- se il primo vale 0×00, il secondo indica IL DOPPIO della lunghezza della stringa dell’appunto.

- se il secondo vale 0×40, il primo indica la lunghezza ESATTA della stringa

- se il secondo vale 0×4Y e il primo 0xQR, con Y=qualunque , allora la lunghezza della stringa è data da 0×0YQR

Probabilmente questo schema è descrivibile in un modo piu’ sensato, che al momento non mi viene in mente…

PROBLEMA: non tutti gli appunti rispettano questo schema: alcuni sono semplicemente stringhe
precedute dalla loro lunghezza!

Questo pero’ puo’ dipendere che il Jotter sul mio a1000 è stato ”ereditato” dal SonyEricsson p800
che avevo prima, per cui forse c’e' stato un miscuglio di formati.

PROBLEMA2: bisogna scoprire se esiste una tabella di indirizzi che punta ai vari entry, per individuare
anche quelli ”speciali” senza intestaiozne.

Questa prima bozza di programma è in grado di estrarre ALCUNI degli appunti (solo se successivi
al 2003), individuandoli tramite le loro date:

http://www.planetmobile.it/jumpjack/ReadJotter.zip

Pubblicato su Motorola a1000, Programmazione, Symbian, Symbian UIQ | Non ci sono Commenti »

Symbian messages format (before 9.x version)

Pubblicato da jumpjack su 2 Febbraio 2008

Some notes about binary format of SMS files on Symbian UIQ (partially applicable to Symbian series60).

SEARCHSTRING = chr$(37)+chr$(58)+chr$(0)+chr$(16) ‘ SEQUENCE “0×25 0×3A 0×00 0×10″
RECEIVEDFLAG_MARKER = chr$(32)+chr$(41)+chr$(52)+chr$(24) ‘ SEQUENCE 0×20 0×29 0×34 0×18;
‘10 bytes after sequence beginning there is the  SENT/RECEIVED flag (0×00=rec, 0×01=sent)

‘ BINARY SEQUENCE “0×25 0×3A 0×00 0×10″ IS JUST BEFORE MESSAGE BODY BEGINING.
‘ IF TWO BYTES AFTER THE “10″ THERE IS A “02″, THE MESSAGE IS FROM A SPECIAL
‘ NUMBER AND ITS BODY STARTS AT BYTE AFTER THE “02″; ELSE BODY STARTS
‘ EXACTLY TWO BYTES AFTER “10″.

‘ IT IS AN SMS ONLY IF “SEARCHSTRING” IS PRESENT (INIZIO<>0), (both s60 and UIQ)
‘ BUTNOT AT OFFSET 0×05 (I.E. UID=SEARCHSTRING).

“0×34 0×18 0×00″ (BODY END) (both s60 and UIQ)

‘ DETERMINING IF SMS OR NOT:
inizio = instr(SMSMemo,SEARCHSTRING)+ (len(SEARCHSTRING)+1)
if inizio <> 5 and mid$(SMSMemo,22,2) <> chr$(162)+chr$(4) then ‘ IF “A2 04″ THEN… (???? not a message??)
if asc(mid$(SMSMemo,inizio))<32 then
inizio = inizio + 1 ‘ ???
end if

‘ GETTING BODY:
FineTesto = instr(inizio,SMSMemo,chr$(52)+chr$(24)+chr$(0))-3 ‘ LOOK FOR “34 18 00″ (BODY END) (both s60 and UIQ)
BASE = FineTesto
InizioTesto = inizio
LunghezzaTesto = FineTesto-inizio

‘ DETERMINING IF SENT OR RECEIVED:
if asc(mid$(SMSMemo,instr(SMSMemo,RECEIVEDFLAG_MARKER)+10,1)) = 0 then  [RECEIVED MESSAGE]

‘ **** RECEIVED MESSAGE ***

‘ FINDING SENDER NUMBER;
‘ NOTE: sender NAME is not available unless looking for it into local phonebook.
SenderBeginning = BASE + SENDER_OFFSET
SenderEnd = instr(SenderBeginning,SMSMemo,chr$(57)+chr$(0))
if SenderEnd = 0 then ‘ IF SPECIAL NUMBER…
if debug<>0 then LogFile.WriteLine( “SPECIAL NUMBER?!?”)
SenderEnd = instr(SenderBeginning,SMSMemo,chr$(0)+chr$(0))
end if
SenderEnd = SenderBeginning + asc(mid$(SMSMemo,SenderBeginning-1,1))/4

‘ EXTRACTING TIMESTAMP
TimestampBeginning = SenderBeginning - TIMESTAMP_RECEIVED_OFFSET

‘ PROCESSING TIMESTAMP:
microdate(hexstring$(mid$(SMSMemo,TimestampBeginning,8)))
‘ 8 bytes long; counting microseconds since year A.D. 0 (see Microdate() functuin below)

‘***** SENT MESSAGE *****

‘EXTRACTING TIMESTAMP:
TimestampBeginning = BASE + TIMESTAMP_SENT_OFFSET

‘ EXTRACTING RECIPIENT
RecipientBeginning = BASE + RECIPIENT_OFFSET
RecipientEnd = RecipientBeginning + asc(mid$(SMSMemo,RecipientBeginning-1,1))/4-1
RecipientName = mid$(SMSMemo,RecipientEnd+2,LunghezzaNome)

function microdate(s as string) as string
DefInt y,m,d,intdays,intmin,inthours,intseconds
DefLng dd,lngdays
DefDbl dbldays,decimals,hours,minutes,seconds
dim debug as string

debug = s
dbldays = hex2dec(s)/86400000000-12
lngdays = int(dbldays)
dd = datefromserial(lngdays,y,m,d)
if y < 1997 then
microdate=”[ERROR]“
‘EXIT FUNCTION
end if
y=y-1 ‘ TIMESERIAL STARTS COUNTING FROM AD 1, SYMBIAN STARTS FROM AD 0.
decimals = dbldays-lngdays
hours = decimals*86400/3600
minutes = (hours - int(hours))*60
seconds = (minutes-int(minutes))*60
inthours = int(hours)
intmin= int(minutes)
intseconds = int(seconds)
microdate = lead0$(y) & “/” & lead0$(m) & “/” & lead0$(d) & ” ” & lead0$(inthours) & “:” & lead0$(intmin) & “:” &lead0$(intseconds)
end function

Pubblicato su Symbian, Symbian UIQ | 6 Commenti »

Scrivere midlet java per accedere all’AGPS del Motorola a1000

Pubblicato da jumpjack su 13 Gennaio 2008

- scaricare SDK per A925, che per errore contiene le librerie necessarie per compilare programmi che utilizzino le Location
API; l’indirizzo è questo, ma bisogna essere registrati (gratuitamente) su Motocoder.com:
https://developer.motorola.com/docstools/sdks/archive/a925/
il file che serve è C:\Symbian\A925SDK\epoc32\tools\j2me\j2me-debug.zip

- mettere il suddetto  file nella cartella C:\Programmi\programmazione\WTK22\lib (cioè la cartella delle librerie del
Wireless ToolKit v. 2.2; per altre versioni dovrebbe essere analogo)

- dalla cartella C:\Programmi\programmazione\WTK22\lib togliere il file midpapi20.jar e metterlo in un posto sicuro

- rinominare \j2me-debug.zip in midpapi20.jar

- adesso dovrebbe essere possibile compilare sorgenti java che accedono al package com.motorola.location; un esempio
è nella documentazione dell’E1000 , ed è riportato anche in questo forum Bisogna pero’ correggere il sorgente, sostituendo LOCATION_UNAVAILABLE con ERR_UNAVAILABLE alla riga 11.

- purtroppo, come mostra il file .JAD della midlet Locator  di www.geomaia.co.uk (sito morto), per far funzionare tale
midlet sono necessarie 2 cose:

- nel file JAD, nella sezione MIDlet-Permissions: , ci deve essere scritto com.symbian.midp.io.protocol.location   (e questo sarebbe facile)

- però, nel file JAD devono esserci anche, nelle sezioni MIDlet-Certificate-1-1: e MIDlet-Jar-RSA-SHA1: , le chiavi segrete vendute da Motorola/H2G agli sviluppatori! Quindi, ciccia, non si puo’ fare!
…a meno che non sia possibile smanettare opportunamente il firmware dell’a1000, che contiene un file che descrive le
limitazioni di accesso alle librerie java. Questo file fa si’ che, se tentate di installare una midlet che usa le location API
ma non ha la ”chiave”, il Sistema vi dica che il server java non lo permette; se usate le chiavi di Locator…. niente da fare,
perche’ sono scadute nel 2006.

Il file del firmware che credo si occupi di stabilire i diritti di accesso dovrebbe essere
Z:\SYSTEM\data\midp2\security\policy\jtwi_r1.xpf . Chi è in grado di modificare il firmware dovrebbe
essere anche in grado di fare qualche esperimento.

In alternativa, sembra che esista un programma MOTOMU che dà i permessi alle midlet, ma non ho capito se
modifica il firmware tramite FLEX o se fa altro…

Il forum originale in cui l’utente TheNext1 ha pubblicato per la prima volta Motomu (è pure un utente italiano!) è questo: http://www.3g.co.uk/3GForum/showthread.php?t=28619 , ma naturalmente, essendo il thread vecchio di BEN due anni, i link per scaricare motomu non funzionano piu’, bisognerà cercarlo in giro…

Vista la difficile reperibilità di Motomu e la difficoltà nello scaricare l’SDK dell’a925, che occupa diverse decine di MB e richiede registrazione, ecco il file j2medebug.zip, e il file AGPS.ZIP che raccoglie, oltre a Motomu, vari programmi utili e che è stato “assemblato” dallo stesso autore di Motomu.

Pubblicato su GPS, Java, Motorola a1000, Symbian, Symbian UIQ | Non ci sono Commenti »

Antifurto satellitare con telefoni Symbian

Pubblicato da jumpjack su 27 Dicembre 2007

– Post in lavorazione –

Link utili:

Modulo Pys60 per Location Api (s60 2nd e 3rd)

Sorgente esempio per LocationRequestor (TEST.PY nello zip: cerca GPS interno, se non lo trova cerca GPS bluetooth)

Symbian SIS Developer Certficate (Signed .SIS) 

Thread su forum nokia sul modulo pys60 LocatinRequestor

Thread su altro forum

Sorgente completo Python per leggere coordinate da GPS bluetoth esterno (ottimo, formatta anche le coordinate)

Forum nokioteca

Sorgente di base per accesso a GPS interno (NMEA location viewer)

Sorgenti PythonGPS vari  (NMEA Info)

Bozza di sorgente python che:
-riceve un messaggio
-legge le coordinate da GPS bluetooth
-invia un messaggio

(L’indentatura si è persa, vedi forum)

import inbox
import e32
import socket
import appuifw
import messagingdef read_sms(id):
e32.ao_sleep(0.1)
i=inbox.Inbox()
sms_text=i.content(id)
appuifw.note(u”Messaggio da elaborare: ” + sms_text, “info”)
# esegue procedure diverse a seconda del messaggio ricevuto.
# Ad esempio, legge coordinate da GPS:
sock=socket.socket(socket.AF_BT,socket.SOCK_STREAM)
address,service=socket.bt_discover() ‘ cerca ricevitore.
target=(address,service.values()[0]) ‘ si collega
sock.connect(target)’ al ricevitore.
to_gps=sock.makefile(”r”,0) ‘ prepara lettura coordinate.
msg=to_gps.readline() ‘ legge riga.
messaging.sms_send(”[NUMERO], msg) ‘ invia SMS contenente coordinate.’ Collega ricezione messaggi ad esecuzione procedura:
i=inbox.Inbox()
i.bind(read_sms)

Pubblicato su GPS, Symbian | Non ci sono Commenti »

Car anti-theft with Javaphone PDA

Pubblicato da jumpjack su 9 Novembre 2007

—>VEDI VERSIONE ITALIANA 

This Jython script turns any Javaphone API supporting PDA into a car-antitheft: once you install this script on the phone, as soon as you call the phone it will send to a predefined number an SMS containing latitude and longitude read from an external GPS bluetooth receiver.

Successfully tested on Motorola a1000; should work on Nokia 9200/9210/9300/9500 (please leave a comment to confirm if you successfully use this program on other phones than a1000) 

What you need:

A PDA/phone with support for PersonalJava/Personal Profile and Javaphone API  (regardless of O.S.);

A Jython version compatible with the phone (try this port for PersonalJava, tested on Motorola A1000);

JavaBT: PersonalJava bluetooth libraries; (JavaBT homepage)

The LC GPS car tracker jython script;

A text file containing the number to send the SMS to; it must be named cellphone.txt;

A text file containing the bluetooth address of your GPS receiver, stored as a sequence of 6 hexadecimal numbers
(for example 000a3a2310c2; you can get your GPS’ address from any bluetooth program installed on your PC). File must be named address.txt;

Once you have all of above:

- Install Jython on your phone (let’s suppose you install it into D:\jython);

- Unpack JavaBT zip package on your PC; copy whole ”se“ folder into d:\jython folder onto the phone;  copy javabt.dll into
c:\system\libs folder on your phone;

- Copy the jython script into d:\jython folder on the phone

- Copy the above described text files in c:\documents\Media Files\document\LC_GPS_Tracker onto the phone;

- Launch Jython on the phone, and once it’s started use the menu to start the jython script. Wait for ”READY.” prompt to appear;

- Turn on your GPS receiver, and keep it within phone bluetooth range;

- Now call your phone: as soon as it receives the call, it will start displaying some debug data on the screen. If all works properly, in a few seconds you should receive the SMS on the predefined number. NOTE: if the GPS got the fix, you’ll see in the message “1,xx” at the end of SMS, with xx=number of satellites; else you’ll see “0,00″.

KNOWN ISSUES:

This program CAN’T work on SonyEricsson P800/p900/p910, as they do not support Javaphone API. If you are interested on a version for these phones, I could try writing a Javaphone-indipendent version, but it would be quite tricky, so I’ll (try to) do it only upon request: don’t forget this program is FREEware!

Pubblicato su GPS, Java, Javaphone API, Motorola a1000, Symbian, Symbian UIQ, jython | Non ci sono Commenti »

Avviare applicazione Symbian da Jython

Pubblicato da jumpjack su 26 Ottobre 2007

import java.lang.Runtime

r=java.lang.Runtime.getRuntime()

p=r.exec(”z:\\system\\programs\\apprun.exe c:\\system\\apps\\nome\\nome.app”)

Questo metodo non consente pero’ di avviare applicazioni OPL.

Pubblicato su Java, Motorola a1000, Symbian, Symbian UIQ, jython | Non ci sono Commenti »

Formato date in telefoni Symbian

Pubblicato da jumpjack su 13 Luglio 2007

Il sistema operativo Symbian memorizza le date in forma di milionesimi di secondo trascorsi dal 1 gennaio dell’anno 0001, utilizzando 8 byte.

Nei file di messaggio, ad esempio, si trovano due sequenze del tipo:
fd 8b 8d 72 7e 11 e1 00
cioe’, 8 byte sempre terminati da e1 00 o e0 00

Per ottenere la data equivalente:

- prendere la sequenza di 8 byte e capovolgerla:
00E1117E728D8BFD

- convertirla in decimale: si ottengono i milionesimi di secondo dalla data 0/01/0000 00:00 (che in realtà non esiste…);:
63351104545328125

- DIVIDERE per 1000000: si ottengono i SECONDI dalla data 0/01/0000 00:00
63351104545,328125

- togliere 32486400 secondi, cioe’ un anno (365 giorni) perche’ l’anno 0 non esiste nel calendario gregoriano, piu’ 10 giorni (correzione gregoriana) + 1 giorno (perche’ il giorno 0 ovviamente non esiste); si ottengono cosi’ i secondi trascorsi dal 1/01/0001:
63318618145,328125

- dividere per 86400 per ottenere i GIORNI trascorsi dal 1/01/0001:
732854,3766820384837962962962963

- aggiungere il numero fisso 1721423.5, perche’ il calendario giuliano misura i giorni trascorsi dal primo gennaio 4713 AVANTI CRISTO, e da quella data al primo gennaio 0001 ci sono appunto 1721423.5 giorni:
2454277,8766820384837962962962963

- a questo punto si è ottenuta la vera data in formato giuliano: basta un convertitore da giuliano a gregoriano per ottenere la data nel formato classico hh:mm:ss gg/mm/aaa
09:02:25 - 26 Giugno 2007

Pubblicato su Symbian | Non ci sono Commenti »