SHENZHEN MINEW TECHNOLOGIES CO. LTD. MS49SF2 User Manual

Page of 8
 
 
 
TEL: +86-755-8886 8480                FAX: +86-755-2982 5342                  EMAIL: 
sales@minewtech.com
                  URL: 
wwwminewtech.com
   
Page  7 
  Minew Technologies 
Bluetooth 4.0 Module 
Instructions V1.0   
 
Reference Source Code for the UART Module MS49SF2 
 
void main (void) 
 
 
 
UartInit();          //UART Initial   
        MS49SF2Init();    //Transparent Data Mode Initial   
 
        while(1) 
              { 
 
 
Send_String("minew");      //Send the characters 
 
      }  
 
 
 
void MS49SF2Init(void) 
unsigned    char    Set_Name[8]={0x88,0x05,0x01,0x4D,0x69,0x6E,0x65,0x77};       
 
 
 
 
//Set BLE module name: Minew 
unsigned    char    Set_Broadcast_Time[5]={0x88,0x02,0x02,0x0A,0xAA};       
 
 
 
 
 
  //Set Broadcasting time: 1000mS 
unsigned    char    Set_Disconnect_Time[5]={0x88,0x02,0x03,0x0A,0xAA};      
 
 
 
 
  //Set Disconnection Time: 10 seconds 
unsigned    char    Set_Send_Power[5]={0x88,0x02,0x04,0x02,0xAA};   
                              //Set Transmission Power: 0dBm 
 
 
Send_String_Data(Set_Name,8); 
 
Send_String_Data(Set_Broadcast_Time,5); 
 
Send_String_Data(Set_Disconnect_Time,5); 
 
Send_String_Data(Set_Send_Power,5);