BC127: SPP SEND_RAW byte stream

I am using BC127 fw version 6.0.40, I am able to OPEN SPP connection with my headset. Below are the commands I used in Command mode,

// Command to send 4 bytes of data
SEND_RAW 15 8
// response
PENDING
// enter 4 bytes of data
00101000
// response
OK

I am expecting a response from my headset for this byte stream, but I am not receiving it. Could you help me that how an hex byte stream (0x00, 0x10, 0x10, 0x00) need to be sent with SPP connection either in Command/Data Mode?

One more query, SEND_RAW is taking data entered as characters so I am mentioning it as 8 for 4 bytes. I am not sure how this will be interpreted in Melody software and sent to my headset. Is this correct way of sending or there is any other way?

Please help me with above issues.

Thanks in advance.

Regards,
Manish

@manish,

Could you post the full sequence of the commands you are using to connect to the headset and the responses to the below?

version
status
config

Regards

Matt

Thanks for your reply Matt. Below are the details you asked for:
version
BlueCreation Copyright 2016
Melody Audio V6.0.40
Build: 1464972430
Bluetooth address 20FABB075D67
Profiles: A2DP AVRCP AGHFP BLE SPP PBAP MAP
Codecs: SBC
OK

STATUS
STATE CONNECTABLE DISCOVERABLE IDLE
OK

CONFIG
AUDIO=0 0
AUDIO_ANALOG=15 10 ON OFF
AUDIO_DIGITAL=0 44100 64 100A00
AUTOCONN=0
BATT_CONFIG=OFF 145 4250 1500 150
BC_SMART_CONFIG=68E3 28F0 89F7 D93C ON
BEACON_DATA=0 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 04 D2 16 2E EE
BLE_CONFIG=1 OFF OFF 40 ON
BLE_CONN_PARAMS=128 12 6 40 0 400 50 400 400 61 400 400
CLASS_1=OFF
CMD_TO=20
COD=240404
CODEC=0
CONN_TO=0
DEEP_SLEEP=OFF
DEVICE_ID=0001 0002 0003 0004 0005 0006 0007 0008
DISCOVERABLE=2 0
ENABLE_BATT_IND=ON
ENABLE_CAPSENSE=OFF
ENABLE_LED=ON
ENABLE_SPP_SNIFF=OFF 0 0 0 0 0
GPIO_CONFIG=ON 0 254
HFP_CONFIG=OFF ON OFF OFF OFF
HIGH_SPEED=OFF OFF
LOCAL_ADDR=20FABB075D67
MAX_REC=2
MM=OFF OFF 0 OFF OFF OFF OFF OFF
MUSIC_META_DATA=OFF
MUSIC_OLD_AVRCP=OFF
NAME=BC-075D67
NAME_SHORT=BC75D67
PIN=0000
PROFILES=0 2 0 2 2 1 2 1 0 0 1 0
REMOTE_ADDR=000000000000
SPP_UUID=00 00 11 01 00 00 10 00 80 00 00 80 5F 9B 34 FB
SSP_CAPS=3
TWS_CONFIG=OFF 1 2
UART_CONFIG=9600 OFF 0
USB_HOST=OFF
VREG_ROLE=1
OK

Please let me know if you need any more information.

Regards,
Manish

@manish,

I was also after the sequence used when pairing to the head set?

Regards

Matt

@mlw,
Below are the sequence of commands:
INQUIRY 30
PAIR <bd_addr>
OPEN <bd_addr> SPP
SEND_RAW 15 4
//response
PENDING
//enter 4 bytes data
0110
//response
OK

Regards,
Manish

@manish,

So I just ran a test between two BC127’s, I had a script (the attached one) sending data to the other side, the data that came out at the other end was 00 0A 0A 00, I suspect because the 10 in the script is interpreted by teraterm (which the script was run from) as decimal and then converted to hex by it hence it actually sent 0A to the BC127 which it then transmitted over the air, there is not any conversion that happens in the unit.

BC127 - Send raw data.zip (214 Bytes)

Regards

Matt

@mlw,
I ran the script which you has given on v6.0.40 and v6.1.5, sending device output is shown below:
OK
ERROR 0x0012

Receiving device output as below:
RECV 15 4 00 1

Receiving device receives byte data as a character data, that why “00 1” only has been received and remaining has been ignored.

Could you please provide me the sequence of commands to send below byte stream using SPP
and any configuration to be done to set data as hex?
Byte stream : 0x0A 0x0B 0x0C 0x0D

Please share your Firmware version you are using.

Regards,
Manish

@manish

I am sending from 6.0.53 to 6.1.5 because I do not have 6.0.40 to hand right now but it should not make any difference.

I have performed the test using the below teraterm script.

sendln "SEND_RAW 15 3"
wait "PENDING"
pause 1
send 10 11 12
wait "OK"

The /0D was causing problems because it was interfering with the terminal so I cut it out and received /0a, /0b /0c on the other end of the link. You need to understand though the terminal, rather than sending 10, 11, 12 to the unit it is performing a conversion from decimal to hex and sending 0a, 0b, 0c to the UART of the BC127 which is what is then received on the other end.

To send you original requirement through teraterm you would need to use the below string (which I did).

sendln "SEND_RAW 15 4"
wait "PENDING"
pause 1
send 00 16 16 00
wait "OK"

As the teraterm will then perform the conversion decimal to hex and come up with 0x00 0x10 0x10 0x00.

Regards

Matt

@manish,

Also why are you using such old firmware?

Regards

Matt

@mlw,

Could you please share your tera term configuration settings. I think your setting is different. I am using the default setting of tera term and I didn’t get the byte stream converted to hex, I get the output in receiving terminal as character only not byte.

Regards,
Manish

@manish,

They are the normal settings for comms with the BC127, so as follows.

  • Terminal, Local echo on, Receive CR+LF.
  • Serial port 9600, 8, 1, n.

Regards

Matt

@mlw,

Thanks for your help.
Now I am able to send the byte stream to my headset, as well as able to receive the response from it.
Sending the byte stream through tera term or minicom was not properly interpreted by the headset, So I tried it through C code application where i do “SEND_RAW 15 4” and then send the filled buffer data as below:
uint8_t cmd[10];
cmd[0] = 0x00;
cmd[1] = 0x01;
cmd[2] = 0x01;
cmd[3] = 0x00;
write(device, cmd,4);

Regards,
Manish