2010年4月18日 星期日

eBlueShare

Propose : the idea is from Windows's Coffee Table, using the wireless communication bridge, that can be a interface from our "Host (PC)" to our "Client 3c Devices" without "line"..... PS: the 3c Device must support wireless communication Target : Blue Tooth Sharing Environments : toool libs
  • obexftp
  • Linux(Ubuntu)
  • BlueZ
  • usblib
obexftp Ref: http://funningboy.blogspot.com/2010/04/obexftp-4-blueftp.html Ubuntu Ref: http://packages.ubuntu.com/dapper/bluez-utils usb Ref: http://funningboy.blogspot.com/2010/03/usb-device.html Devices: Sony Ericsson k530i Acer aspire 5560 PS: this is one way design, only downloaded data from K530i to our local PC, you can adjust it in both ways Design Flow:
  • GetFolderRoot(); Get the Root of our Device, like Phone Disk or SD Card...
  • GetFolderList(); Get the Children of Root folder, like music, photo...
  • GetFileFmDifFolder(); Get each leaf file of Child folder,
Sample Code: GetFileFmDifFolder(); language: Perl
#Step3 get all folder file in different cat
sub GetFileFmDifFolder{

my ($key,$a);
foreach ( sort keys %folderlths){
$key = $_;
foreach $a (@{$folderlths{$key}}){
system "obexftp -b $DeviceID -l \"$key\/$a\"  > catlt.xml";
system "mkdir $a";

open(ifolder,"catlt.xml")  die "open cat.xml error";

my $cont=();
while(){
$cont = $cont.$_;
}

# create a xml object for the response

  my $xml = new XML::Simple(KeyAttr=>[]);

  my $tree = $xml->XMLin($cont);


  my ($e,$j,$k);

  #print Dumper($tree);


  foreach $e ($tree->{"file"}){
    foreach $j (@{$e}){
       $k = $j->{"name"};
       system "obexftp -c \"$key\/$a\" -g $k";
       system "mv $k $a";
   }
 }
}
}

}
sample code download http://sites.google.com/site/funningboy/perl_code/obexftp.pl?attredirects=0&d=1 Execute Result: Ref: http://indiangeek.com/blog/?tag=w810i

沒有留言:

張貼留言