BASIC

Author Topic: [iPhone] Bluetooth Multiplayer  (Read 20627 times)

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #15 on: 2011-Feb-19 »
Here the source of the Project. Added close function.



[attachment deleted by admin]
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #16 on: 2011-Feb-19 »
Nice one mate! I'll try it out tomorrow. Did you find why it dies off after a while?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #17 on: 2011-Feb-20 »
sorry no, didnt have enough time to check and debug, i think its a overflow in recv function.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #18 on: 2011-Feb-20 »
Just trying to implement the new .a file. So I overwrote the original .a file with the one held in the latest release, and then added the extra close function in GLB like this:-
Code: GLBasic [Select]
?IFDEF IPHONE
        IMPORT "C" void GLB_iBT_Init()
        IMPORT "C" void GLB_iBT_Start(const char* sessID)
        IMPORT "C" int GLB_iBT_Send(const char* strValue)
        IMPORT "C" const char* GLB_iBT_Recv()
        IMPORT "C" int GLB_iBT_Connected()
        IMPORT "C" void GLB_iBT_Close()
?ELSE
        FUNCTION GLB_iBT_Init:
        ENDFUNCTION

        FUNCTION GLB_iBT_Start: iBTID$
        ENDFUNCTION

        FUNCTION GLB_iBT_Send: iBTMessage$
        ENDFUNCTION

        FUNCTION GLB_iBT_Recv:
        ENDFUNCTION

        FUNCTION GLB_iBT_Connected:
        ENDFUNCTION
       
        FUNCTION GLB_iBT_Close:
        ENDFUNCTION
?ENDIF

And then I reference GLB_iBT_Close in my GLB code, but in Xcode I am getting an error saying Symbol(s) not found for _GLB_iBT_Close. Where am I going wrong?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #19 on: 2011-Feb-20 »
uhm oh check the extern "C" functions i think the alcoholic drinks made me making a typo.

// EDIT:// or you forgot to replace the iBluetooth.a try again to overwrite
« Last Edit: 2011-Feb-20 by trucidare »
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #20 on: 2011-Feb-20 »
Ok. Originally I copied the function name from a C header file I found. I will try again a little later. It should definitely be using the correct .a file although I will double check. Out of interest is it the .a file from the release directory or the debug directory? I assumed release.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #21 on: 2011-Feb-20 »
check the creation date.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #22 on: 2011-Feb-20 »
It says today. I removed the .a file from the Mac, and made sure the .a file from the zip file was used instead. But I still get the same error messages about symbol(s) not found for _GLB_iBT_Close.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #23 on: 2011-Feb-21 »
uhm i think its because i compiled for armv6 only??? could anyone check?
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: [iPhone] Bluetooth Multiplayer
« Reply #24 on: 2011-Feb-21 »
Try this.
Beware, when 2 string arrive before you try to receive data, you only get the latest received string - no queue is established, yet.

[attachment deleted by admin]

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #25 on: 2011-Feb-21 »
Rats going out tonight. Will try tomorrow. Is it the .a file in the release directory or debug directory?

No worries, that should be fine with the way I've coded it already.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: [iPhone] Bluetooth Multiplayer
« Reply #26 on: 2011-Feb-21 »
don't use the .a library. Use the .mm source code file.

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #27 on: 2011-Feb-21 »
Ah, now you are losing me slightly. I have only got to the using .a files in XCode stage of things. So far I have incorporated Trucidare's .a file he originally posted at the start of this thread, and it is working pretty well (2 idevices talk to each other pretty nicely apart from the mentioned lack of closing ability and that it crashes after a while). As far as .mm files go then you have lost me. So I take it I remove the use of Trucidare's .a file from XCode? But then what do I do with the .mm file?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: [iPhone] Bluetooth Multiplayer
« Reply #28 on: 2011-Feb-21 »
choose the .a file or .mm file if you wont provide source code of bluetooth wrapper choose the .a both have the same result.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: [iPhone] Bluetooth Multiplayer
« Reply #29 on: 2011-Feb-22 »
no - I did not compile the .mm into a .a file. If you try my fix, you must use hte .mm file.