Other Parts Discussed in Thread: MSP432E401Y, CC2564, CC2564C, MSP-EXP432E401Y, CC2564MODNEM,
Hi,
I am using MSP432E401Y with CC2564MODA Bluetooth module. At this moment I am able to communicate with the module using the bluetopia stack.
I am calling InitializeApplication() function successfully we can find on SPPDemo.c file (\Samples\SPPDemo). After initialize the Bluetooth Stack, I am able to open the SPP server using OpenServer() and I call periodically BTPS_ProcessScheduler(). But at this point, my device is not advertising neither accepts Bluetooth connections.
When running my code, this output is provided on the debug console:
OpenStack().
Bluetooth Stack ID: 1
Device Chipset: 4.1
BTPS Version : 4.0.3.0
Project Type : 6
FW Version : 7.26
LOCAL BD_ADDR: CC:78:AB:7D:84:B8
Local Device Name(): MY_BTH_DEVICE
Server Opened: 1.
All mode are OK when I query for the current mode parameters using GAP_Query_Connectability_Mode(), GAP_Query_Discoverability_Mode() and GAP_Query_Pairability_Mode().
Can someone tell me what procedures should I take to detect any anomalies?
Best Regards
Nuno Dias
----------------------------------------------------------
Bellow some code snippets I am extracted from bluetopia stack samples:
int bluetooth_init(void)int bluetooth_init(void) {
DEBUG_MSG("");
int Result;
BTPS_Initialization_t BTPS_Initialization;
HCI_DriverInformation_t HCI_DriverInformation;
HCI_HCILLConfiguration_t HCILLConfig;
HCI_Driver_Reconfigure_Data_t DriverReconfigureData;
/* Configure the hardware for its intended use. */
HAL_ConfigureHardware();
/* Configure the UART Parameters nd Initialize the Bluetooth Stack. */
HCI_DRIVER_SET_COMM_INFORMATION(&HCI_DriverInformation, 1, HAL_HCI_UART_MAX_BAUD_RATE, cpHCILL_RTS_CTS);
HCI_DriverInformation.DriverInformation.COMMDriverInformation.InitializationDelay = 100;
/* Set up the application callbacks. */
BTPS_Initialization.GetTickCountCallback = getTickCountCallback;
BTPS_Initialization.MessageOutputCallback = msgOutputCallback;
/* Initialize the application. */
Result = InitializeApplication(&HCI_DriverInformation, &BTPS_Initialization);
if (Result > 0) {
/* Save the Bluetooth Stack ID. */
BluetoothStackID = (unsigned int)Result;
Result = OpenServer(SPP_PORT_NUMBER_MINIMUM);
} else {
DisplayFunctionError("Initialize the application", Result);
}
int InitializeApplication(HCI_DriverInformation_t *HCI_DriverInformation, BTPS_Initialization_t *BTPS_Initialization)
/* The following function is used to initialize the application */ /* instance. This function should open the stack and prepare to */ /* execute commands based on user input. The first parameter passed */ /* to this function is the HCI Driver Information that will be used */ /* when opening the stack and the second parameter is used to pass */ /* parameters to BTPS_Init. This function returns the */ /* BluetoothStackID returned from BSC_Initialize on success or a */ /* negative error code (of the form APPLICATION_ERROR_XXX). */ int InitializeApplication(HCI_DriverInformation_t *HCI_DriverInformation, BTPS_Initialization_t *BTPS_Initialization) { int ret_val = APPLICATION_ERROR_UNABLE_TO_OPEN_STACK; /* Initialize some defaults. */ SerialPortID = 0; bthRole = BTH_ROLE_NONE; NumberofValidResponses = 0; /* Next, makes sure that the Driver Information passed appears to be */ /* semi-valid. */ if((HCI_DriverInformation) && (BTPS_Initialization)) { /* Try to Open the stack and check if it was successful. */ if(!OpenStack(HCI_DriverInformation, BTPS_Initialization)) { /* The stack was opened successfully. Now set some defaults. */ /* First, attempt to set the Device to be Connectable. */ ret_val = SetConnect(); /* Next, check to see if the Device was successfully made */ /* Connectable. */ if(!ret_val) { /* Now that the device is Connectable attempt to make it */ /* Discoverable. */ ret_val = SetDisc(); /* Next, check to see if the Device was successfully made */ /* Discoverable. */ if(!ret_val) { /* Now that the device is discoverable attempt to make it*/ /* pairable. */ ret_val = SetPairable(); if(!ret_val) { /* Attempt to register a HCI Event Callback. */ ret_val = HCI_Register_Event_Callback(BluetoothStackID, HCI_Event_Callback, (unsigned long)NULL); if(ret_val > 0) { /* Assign a NULL BD_ADDR for comparison. */ ASSIGN_BD_ADDR(NullADDR, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); /* Save the maximum supported baud rate. */ MaxBaudRate = (DWord_t)(HCI_DriverInformation->DriverInformation.COMMDriverInformation.BaudRate); /* Return success to the caller. */ ret_val = (int)BluetoothStackID; } else DisplayFunctionError("HCI_Register_Event_Callback()", ret_val); } else DisplayFunctionError("SetPairable", ret_val); } else DisplayFunctionError("SetDisc", ret_val); } else DisplayFunctionError("SetDisc", ret_val); /* In some error occurred then close the stack. */ if(ret_val < 0) { /* Close the Bluetooth Stack. */ CloseStack(); } } else { /* There was an error while attempting to open the Stack. */ Display(("Unable to open the stack.\r\n")); } } else ret_val = APPLICATION_ERROR_INVALID_PARAMETERS; return(ret_val); }