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.

BLE_Bridge: simpleProfileChangeCB()

Other Parts Discussed in Thread: CC2541

Dear all:


I can not find where to call the function simpleProfileChangeCB() in BLE_Bridge project.

Can someone help me?

B.R.

KJ

  • Hi KJ,

    You don't call the simpleProfileChangeCB "callback" function. It's called by the Profile when a characteristic value is updated.

    Best wishes
  • Could you explain how to test the simpleProfileChangeCB() function using BTool... and UART?
  • Could you explain how to test the simpleProfileChangeCB() function using BTool... with SIMPLEPROFILE_CHAR3...
  • I used Serial_BLE_Bridge on CC2541 BoosterPack and a simple code below on MSP430F5529_LaunchPad.

    I send some data on BTool, like 02:AB:CD on Handle 0x002B. (Where 01 means there are two bytes data and AB, CD are the data).

    And I wrote a simple code in MSP430F5529LP to transfer data from cc2541 to PC.

    // Basic MSP430 and driverLib #includes
    #include "msp430.h"
    
    //=============================================================================
    void main(void)
    {
    
    	WDTCTL = WDTPW | WDTHOLD;		// Stop watchdog timer
    
    	P3SEL |= BIT3+BIT4;                       // P3.3,4 = USCI_A0 TXD/RXD
    	UCA0CTL1 |= UCSWRST;                      // **Put state machine in reset**
    	UCA0CTL1 |= UCSSEL_2;                     // SMCLK
    	UCA0BR0 = 9;                              // 1MHz 115200 (see User's Guide)
    	UCA0BR1 = 0;                              // 1MHz 115200
    	UCA0MCTL |= UCBRS_1 + UCBRF_0;            // Modulation UCBRSx=1, UCBRFx=0
    	UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
    	UCA0IE |= UCRXIE;                         // Enable USCI_A0 RX interrupt
    
    	P4SEL |= BIT4+BIT5;                       // P4.4,5 = USCI_A1 TXD/RXD
    	UCA1CTL1 |= UCSWRST;                      // **Put state machine in reset**
    	UCA1CTL1 |= UCSSEL_2;                     // SMCLK
    	UCA1BR0 = 9;                              // 1MHz 115200 (see User's Guide)
    	UCA1BR1 = 0;                              // 1MHz 115200
    	UCA1MCTL |= UCBRS_1 + UCBRF_0;            // Modulation UCBRSx=1, UCBRFx=0
    	UCA1CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
    	//UCA1IE |= UCRXIE;                       // Enable USCI_A1 RX interrupt
    
    	__bis_SR_register(LPM0_bits + GIE);       // Enter LPM0, interrupts enabled
    
    }
    
    
    /* USCI_A0 ISR */
    #pragma vector=USCI_A0_VECTOR
    __interrupt void USCI_A0_ISR(void)
    {
    
    	switch(__even_in_range(UCA0IV,4))
    	{
    		case 0x00:								// Vector 0: No interrupts
    			break;
    
    		case 0x02:								// Vector 2: Data received: UCRXIFG;
    
    			UCA1TXBUF = UCA0RXBUF;	// Push data to TX buffer
    			break;
    
    		case 0x04:								// Vector 4: Transmit buffer empty: UCTXIFG
    			break;
    
    		default:
    			break;
    	}
    
    }
    

  • i need to test SIMPLEPROFILE_CHAR3 using BTool and using SerialBLEBridge...
    From the BTool with F3:FF and write option is selected, still the micro enters into SIMPLEPROFILE_CHAR1 switch case... I need to know how to test SIMPLEPROFILE_CHAR3 using BTool. If anyone explains with steps on BTool, it would be very helpful...
  • Dear Kantha,

    You can try 0x002B in Handle and  02:11:22 in Value. Where "02" means 2 date fields you send.

    B.R.

    KJ