This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WL1837MOD: Bluetopia BSC_Initialize

Part Number: WL1837MOD

Hi team,

My goal here is to use the L2CA_Ping() function form the L2CAPAPI.h file. This function requires the use of a BluetoothStackID.

The BluetoothStackID is obtained from the BSC_Initialize(HCI_DriverInformation_t *HCI_DriverInformation, unsigned long Flags) function in BSCAPI.h file.
 
I'm having trouble providing the correct information for the HCI_DriverInformation structure.

This is my attempt at using the function:

    int btStackId;
    char portName[32] = "/dev/ttymxc4";

    driverInfo.DriverType = hdtCOMM;
    driverInfo.DriverInformation.COMMDriverInformation.COMPortNumber = -1;
    driverInfo.DriverInformation.COMMDriverInformation.DriverInformationSize = sizeof(driverInfo.DriverInformation.COMMDriverInformation);
    driverInfo.DriverInformation.COMMDriverInformation.Protocol = cpUART;
    driverInfo.DriverInformation.COMMDriverInformation.BaudRate = 115200;
    driverInfo.DriverInformation.COMMDriverInformation.InitializationDelay = 100;
    driverInfo.DriverInformation.COMMDriverInformation.COMDeviceName = portName;
    driverInfo.DriverInformation.COMMDriverInformation.Flags = 0;

    btStackId = BSC_Initialize(&driverInfo, 0);

    printf("Ping application: bt stackid: %d\n\n", btStackId);

   Attempting to run this app:
root@QConnect:/usr/qk# ./BluetopiaPing
Error: Can't open /proc/device-tree/tibt/dev_nameError: Can't open /proc/device-tree/tibt/baud_rateError: Can't open /proc/device-tree/tibt/flow_cntrlError: Can't open /proc/device-tree/tibt/nshutdown_gpioecho 0 > /sys/class/gpio/export
sh: write error: Resource busy
echo out > /sys/class/gpio/gpio0/direction
echo 0 > /sys/class/gpio/gpio0/value
echo 1 > /sys/class/gpio/gpio0/value
echo 0 > /sys/class/gpio/gpio0/value
echo 1 > /sys/class/gpio/gpio0/value
BT COMM PORT (): -5
Ping application: bt stackid: -14

I'm confused whats going on here? I can confirm the bt module is already powered on and there's no option to provide a GPIO number for the BT_enable pin.

How do i use the BSC_Initialize function?

I'm on a tight schedule here. Thank you in advance