void at_command( uint8_t * at_cmd , int32_t at_cmd_len ) { if (at_cmd_len >= 2) { // look at the next byte to determine what to do switch (at_cmd[2]) { case '\0': // no command -> OK //at_ok(); break; case 'S': at_s( at_cmd,at_cmd_len ); break; case 'I': at_i( at_cmd ); break; default: break; } } //return ret ; }
void at_command(void) { // require a command with the AT prefix if (at_cmd_ready) { if ((at_cmd_len >= 2) && (at_cmd[0] == 'R') && (at_cmd[1] == 'T')) { // remote AT command - send it to the tdm // system to send to the remote radio tdm_remote_at(); at_cmd_len = 0; at_cmd_ready = false; return; } if ((at_cmd_len >= 2) && (at_cmd[0] == 'A') && (at_cmd[1] == 'T')) { // look at the next byte to determine what to do switch (at_cmd[2]) { case '\0': // no command -> OK at_ok(); break; case '&': at_ampersand(); break; case '+': at_plus(); break; case 'I': at_i(); break; case 'P': at_p(); break; case 'O': // O -> go online (exit command mode) at_plus_counter = ATP_COUNT_1S; at_mode_active = 0; break; case 'S': at_s(); break; case 'Z': // generate a software reset RSTSRC |= (1 << 4); for (;;) ; default: at_error(); } } // unlock the command buffer at_cmd_len = 0; at_cmd_ready = false; } }