2019-05-08 12:11 AM
Dear Members,
I want to test my SIM900 module,
Do I need something more from this code ?
printf("TEST SIM900\r\n");
//usart_pstr("AT\r\n");
target =0; //UART1 selected
printf("AT/r");
HAL_UART_Receive(&huart1, (uint8_t *)&RxModem, 8,100);
HAL_UART_Transmit(&huart3,(uint8_t *)&RxModem, 8,100);
2019-05-08 03:44 AM
correct me ?
void usart_transmit( char data )
{
HAL_UART_Transmit(&huart1, (uint8_t *)&data, 1,100);
}
void usart_pstr(char *s) {
//void usart_pstr(BYTE *s) {
// loop through entire string
while (*s) {
usart_transmit(*s);
s++;
}
}
void test_modem (void)
{
uint8_t sim900line_buffer[128];
char rx_data[5];
int x;
printf("TEST SIM900\r\n");
usart_pstr("ATI\r");
//target =0; //UART1 selected
//printf("AT/r");
HAL_UART_Receive(&huart1, (uint8_t *)&RxModem, 18,100);
//memcpy((void *)sim900line_buffer, RxModem, 10);
HAL_UART_Transmit(&huart3,(uint8_t *)&RxModem, 18,100);
target = 1;
printf("\r\nFinished receiving from SIM900 \r\n");
HAL_Delay(3000);