[iPhone] Bluetooth Multiplayer

Previous topic - Next topic

trucidare

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

Crivens

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.

trucidare

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

Crivens

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.

trucidare

#19
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
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

Crivens

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.

trucidare

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

Crivens

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.

trucidare

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

Kitty Hello

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]

Crivens

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.

Kitty Hello

don't use the .a library. Use the .mm source code file.

Crivens

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.

trucidare

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

Kitty Hello

no - I did not compile the .mm into a .a file. If you try my fix, you must use hte .mm file.