66#include "generated/settings.h"
70#define GSM_LINK UART3100
73#define GSM_MAX_PAYLOAD 160
75#define GSMLinkDev (&(GSM_LINK).device)
77#define GSMLinkChAvailable() GSMLinkDev->check_available(GSMLinkDev->periph)
78#define GSMLinkTransmit(_c) GSMLinkDev->put_byte(GSMLinkDev->periph, 0, _c)
79#define GSMLinkGetch() GSMLinkDev->get_byte(GSMLinkDev->periph)
80#define ReadGSMBuffer() { while (GSMLinkChAvailable&&!gsm_line_received) gsm_parse(GSMLinkGetch()); }
84#define GSM_ORIGIN_MAXLEN 32
85#define DATA_MAXLEN 128
88#define MAXLEN_CMTI_ANSWER 32
89#define MAXLEN_SMS_CONTENT DATA_MAXLEN
106#define STATUS_REQUESTING_MESSAGE 2
107#define STATUS_SEND_AT 3
108#define STATUS_SEND_CMGF 4
109#define STATUS_SEND_CNMI 5
110#define STATUS_SEND_CPMS 6
111#define STATUS_RECEPTION_SMS2 7
112#define STATUS_WAITING_DATA 8
114#define STATUS_WAITING_PROMPT 10
115#define STATUS_DELETE_SMS 11
116#define STATUS_POWERON 12
134static void Send(
const char string[]);
462 Send(
"AT+CNMI=1,1,0,0,0");
469 Send(
"AT+CPMS=\"SM\"");
498static void Send(
const char string[])
498static void Send(
const char string[]) {
…}
514 while (n && (*
s != c)) {
518 return (n ?
s :
NULL);
struct pprz_autopilot autopilot
Global autopilot structure.
Core autopilot interface common to all firmwares.
uint16_t flight_time
flight time in seconds
void nav_goto_block(uint8_t b)
Common code for AP and FBW telemetry.
struct Electrical electrical
Interface for electrical status: supply voltage, current, battery status, etc.
float vsupply
supply voltage in V
struct GpsState gps
global GPS state
Device independent GPS code (interface)
int32_t hmsl
height above mean sea level (MSL) in mm
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over MSL)
struct NedCoor_i ned_vel
speed NED in cm/s
uint16_t gspeed
norm of 2d ground speed in cm/s
int32_t east
in centimeters
int32_t north
in centimeters
#define GSM_ORIGIN_MAXLEN
static void gsm_got_line(void)
static void parse_msg_header(void)
Message header in gsm_bug.
static void gsm_parse(uint8_t c)
static void request_for_msg(void)
void gsm_init_report(void)
static void gsm_receive_content(void)
Receiving a SMS, third step, content in gsm_buf Message can be Bdd where dd is a block index on two d...
static void Send_CMGF(void)
static bool waiting_for_reply
static uint8_t gsm_status
static void gsm_got_prompt(void)
static void Suppr_SMS(int)
#define STATUS_WAITING_PROMPT
static char gsm_buf[GSM_MAX_PAYLOAD]
#define STATUS_REQUESTING_MESSAGE
#define MAXLEN_CMTI_ANSWER
static void Send_CPMS(void)
static char origin[GSM_ORIGIN_MAXLEN]
static void Send(const char string[])
static void gsm_send_report_continue(void)
#define STATUS_WAITING_DATA
static char expected_ack[10]
#define STATUS_DELETE_SMS
static void Send_AT(void)
#define MAXLEN_SMS_CONTENT
static char data_to_send[DATA_MAXLEN]
static uint8_t gsm_buf_len
#define GSMLinkChAvailable()
static bool prompt_received
static char * indexn(char *, char, uint8_t)
static bool gsm_line_received
static uint8_t gsm_buf_idx
static uint8_t gcs_index_max
static void Send_CNMI(void)
static void Send_CSQ(void)
Communications through GSM.
arch independent LED (Light Emitting Diodes) API
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.