Using the PC as an OBEX bluetooth Java MAP client

1

I studied the MAP specification and am trying to send an x-bt / message message from my PC to my mobile phone using api bluecove.

I get connection via OBEX, without error, but I have no return in InputStream, and the message is not sent.

My OBEX header:

HeaderSet hsOperation = clientSession.createHeaderSet();
            hsOperation.setHeader(HeaderSet.TYPE, "x-bt/message");
            hsOperation.setHeader(HeaderSet.LENGTH,new Long(sMessage.length()));
            hsOperation.setHeader(HeaderSet.NAME, "TELECOM/MSG/OUTBOX");

And my message and OutputStream:

private final static String CRLF = "\r\n";

static String sMessage = "BEGIN:BMSG"+CRLF
        + "VERSION:1.0"+CRLF
        + "STATUS:UNREAD"+CRLF
        + "TYPE:SMS_GSM"+CRLF
        + " FOLDER:TELECOM/MSG/OUTBOX"+CRLF
        + "BEGIN:VCARD"+CRLF
        + "    VERSION:2.1"+CRLF
        + "    N:Souza,Ricardo"+CRLF
        + "    TEL:+5511666666666"+CRLF
        + "END:VCARD"+CRLF
        + "BEGIN:BENV"+CRLF
        + "    BEGIN:VCARD"+CRLF
        + "        VERSION:2.1"+CRLF
        + "        N:Souza,Ricardo"+CRLF
        + "        TEL:+5511666666666"+CRLF
        + "    END:VCARD"+CRLF
        + "    BEGIN:BBODY"+CRLF
        + "        ENCODING:G-7BIT"+CRLF
        + "        LENGTH:47"+CRLF
        + "        BEGIN:MSG"+CRLF
        + "            This is a short message"+CRLF
        + "        END:MSG"+CRLF
        + "    END:BBODY"+CRLF
        + "END:BENV"+CRLF
        + "END:BMSG"+CRLF; 

OutputStream os = putOperation.openOutputStream (); os.write (sMessage.getBytes ()); os.close ();

Please, if someone has already worked with bluetooth protocol to send SMS (as carkits do) from PC to mobile and can give me a help, I'll be grateful.

Thank you.

    
asked by anonymous 16.05.2016 / 16:50

0 answers