hello there, i almost give up on finding a way to connect a client application using widcomm sdk on pc to server application using jsr82 j2me on mobile ph0ne ...
anybody can give me an example code for connecting both of them ...
if u can, or have some advice for me please give me that valueable thing...
my recent not working application :
- server deployed on mobile phone using jsr82 j2me
- client on pc using widcomm sdk visual c++ .net
or may be u can correct and give me advice for my code bellow...
Server (JSR82) :
private static final UUID APP_UUID = new UUID("F0E0D0C0B0A000908070605040302010", false);
private static final String URL = "btspp://localhost:"+APP_UUID+";name=My App;authorize=false";
private static final String APP_ID = "My App";
private static final int ATTR_ID = 0x1234;
try {
localDevice = LocalDevice.getLocalDevice();
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
notifier = (StreamConnectionNotifier)Connector.open(URL);
DataElement base = new DataElement(DataElement.STRING, APP_ID);
record = localDevice.getRecord(notifier);
record.setAttributeValue(ATTR_ID, base);
connection = notifier.acceptAndOpen();
}
catch(Exception e) {
System.err.println(e.getMessage());
}
Client (Widcomm SDK) :
StartDiscovery(m_BdAddr, m_pServiceGuid)
CSdpDiscoveryRec Sdp_Record;
if ( ReadDiscoveryRecords(m_BdAddr, 1, &Sdp_Record, m_pServiceGuid) )
{
UINT8 scn;
SDP_DISC_ATTTR_VAL *pVal;
if ( Sdp_Record.FindRFCommScn(&scn) )
//if(Sdp_Record.FindAttribute(0x1234, pVal))
I can't find an RFComm channel number from server (the j2me one)
regards, Arch_Cancer
// sorry my bad english