kumar singh
/
Dealer_20Mar
BLE Transmitter not working
Fork of Dealer_23Feb by
Diff: main.cpp
- Revision:
- 15:a448e955b8f3
- Parent:
- 13:8955f2e95021
- Child:
- 16:7703b9d92326
--- a/main.cpp Sun Feb 12 11:03:44 2017 +0000 +++ b/main.cpp Sun Feb 12 18:38:39 2017 +0000 @@ -37,7 +37,7 @@ void Lora_Rcvd_Cmd_Processing_thread(void);// const *args); void Enable_CheckIN_Packet_Sending(); - + uint8 GET_RSSI[]= {0x41,0x54,0x01,0x01,0x0D,0x0A}; /*************************Accelerometer related definitions***********************************/ //Accelerometer related definitions @@ -194,7 +194,7 @@ DEBUG_UART.baud(115200); DEBUG_UART.printf("%s","Debugging started"); LORA_UART.attach(&Lora_onDataRx, Serial::RxIrq); - //BLE_RECEIVER_UART.attach(&BLE_Receiver_onDataRx, Serial::RxIrq); + BLE_RECEIVER_UART.attach(&BLE_Receiver_onDataRx, Serial::RxIrq); //Create a thread to read vehicle data //Thread OBD_thread(OBD_Rcvd_Cmd_Processing_thread); @@ -231,6 +231,7 @@ Status_Packet_Wait_Count++; if(Status_Packet_Wait_Count < 5) { + Send_RSSI_Request_Command(GET_RSSI); Send_HeartBeat_Packet(); //call function to send heartbeat packet DEBUG_UART.printf("Sent HeartBeat Packet"); AT_Response_Receive_Status = FAILURE; @@ -347,4 +348,26 @@ } } } -} */ \ No newline at end of file +} */ + +void Send_RSSI_Request_Command(uint8* Command_To_Send) +{ + BLE_RECEIVER_UART.printf(Command_To_Send); +} + +void Get_Beacon_Receiver_Response(void) +{ + static uint16 Temp_Pos1; + while(true) + { + if(BLE_Receiver_UART_RX_Buffer[Temp_Pos1] == 0x0D) + { + if(BLE_Receiver_UART_RX_Buffer[Temp_Pos1+1] == 0x0A)) + { //check for AT end response <cr><lf> (i.e. 0x0D,0x0A) + break; + } + } + else + Temp_Pos1++; + } +}