Author Topic: IR address  (Read 1017 times)

Offline AnupamVarghese

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
IR address
« on: August 06, 2007, 08:52:31 AM »
Hi Mike,

On quick question. In BFIrDADeviceX, I noticed there is 'Address' and 'IrDAAddress'. Whats different?

Also, I found out (quite late) that the address keeps changing everytime I switch off and on the phone!

Do you know of any way I can reconnect to a phone ?
The only failsafe way I think is to run IR discovery every time, match the device names and connect if names match - is there a better way to do this?

Thanks.

Regards,
Anupam.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • Karma: 1000
    • Wireless Communication Library
Re: IR address
« Reply #1 on: August 06, 2007, 10:00:02 AM »
Good day!

Address is a formatted string (like (00:00:00:00)). IrDAAddres is the same value but as array[4] (used internally).

You are right. IrDA device's address is dinamic. It changes every time. And yes. The best way is discovery devices and compare its names.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline AnupamVarghese

  • Newbie
  • *
  • Posts: 46
  • Karma: 0
Re: IR address
« Reply #2 on: August 06, 2007, 01:46:37 PM »
Thanks Mike.

Another question, since name also can change, can I use Hint1 and Hint2 to compare devices?
Something like,
if .hint1 = stored_hint1 and .hint2 = stored_hint2
   debug.print "Yup this is the device I was looking for !"
end if

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • Karma: 1000
    • Wireless Communication Library
Re: IR address
« Reply #3 on: August 06, 2007, 02:07:14 PM »
I have never seen that names changing. But whos know ;)

I think yes. The hint1 and hint2 are device's type and subtpe. Here is the codes for that (from af-Irda.h) (it combined by logical or):

Code: [Select]
  // Any hint byte
  LM_HB_Extension    = 128;

  // First hint byte
  LM_HB1_PnP         = 1;
  LM_HB1_PDA_Palmtop = 2;
  LM_HB1_Computer    = 4;
  LM_HB1_Printer     = 8;
  LM_HB1_Modem       = 16;
  LM_HB1_Fax         = 32;
  LM_HB1_LANAccess   = 64;

  // Second hint byte
  LM_HB2_Telephony   = 1;
  LM_HB2_FileServer  = 2;

  LmCharSetASCII      = 0;
  LmCharSetISO_8859_1 = 1;
  LmCharSetISO_8859_2 = 2;
  LmCharSetISO_8859_3 = 3;
  LmCharSetISO_8859_4 = 4;
  LmCharSetISO_8859_5 = 5;
  LmCharSetISO_8859_6 = 6;
  LmCharSetISO_8859_7 = 7;
  LmCharSetISO_8859_8 = 8;
  LmCharSetISO_8859_9 = 9;
  LmCharSetUNICODE    = $FF;
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager