|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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
104 #define STATUS_NONE 0
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
113 #define STATUS_IDLE 9
114 #define STATUS_WAITING_PROMPT 10
115 #define STATUS_DELETE_SMS 11
116 #define STATUS_POWERON 12
134 static void Send(
const char string[]);
175 gsm_gsm_init_report_status =
false;
253 gsm_gsm_send_report_status = MODULES_START;
274 char demande_lecture_SMS[16];
277 sprintf(demande_lecture_SMS,
"AT+CMGR=%d",
index_msg);
279 Send(demande_lecture_SMS);
301 || strncmp((
char *)GCS_NUMBER_1,
origin, strlen(GCS_NUMBER_1)) == 0
304 || strncmp((
char *)GCS_NUMBER_2,
origin, strlen(GCS_NUMBER_2)) == 0
306 #ifdef SAFETY_NUMBER_1
307 || strncmp((
char *)SAFETY_NUMBER_1,
origin, strlen(SAFETY_NUMBER_1)) == 0
309 #ifdef SAFETY_NUMBER_2
310 || strncmp((
char *)SAFETY_NUMBER_2,
origin, strlen(SAFETY_NUMBER_2)) == 0
319 if (block_index > 0) {
328 DlSetting(var_index, value);
343 char demande_suppression[20];
345 sprintf(demande_suppression,
"AT+CMGD=%d", index_);
348 Send(demande_suppression);
414 sprintf(buf,
"AT+CMGS=\"%s\"", GCS_NUMBER_1);
420 sprintf(buf,
"AT+CMGS=\"%s\"", GCS_NUMBER_2);
462 Send(
"AT+CNMI=1,1,0,0,0");
469 Send(
"AT+CPMS=\"SM\"");
476 case GSM_CMD_LINE_TERMINATION:
481 case GSM_RESPONSE_FORMATING:
498 static void Send(
const char string[])
503 GSMTransmit(
string[i++]);
505 GSMTransmit(GSM_CMD_LINE_TERMINATION);
514 while (n && (*
s !=
c)) {
518 return (n ?
s : NULL);
static char expected_ack[10]
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
#define GSM_ORIGIN_MAXLEN
static char data_to_send[DATA_MAXLEN]
static char origin[GSM_ORIGIN_MAXLEN]
#define MAXLEN_SMS_CONTENT
static void parse_msg_header(void)
Message header in gsm_bug.
int32_t north
in centimeters
uint16_t flight_time
flight time in seconds
#define MAXLEN_CMTI_ANSWER
static bool waiting_for_reply
static void gsm_got_line(void)
#define STATUS_DELETE_SMS
float vsupply
supply voltage in V
static char * indexn(char *, char, uint8_t)
static char gsm_buf[GSM_MAX_PAYLOAD]
struct NedCoor_i ned_vel
speed NED in cm/s
static void Send_AT(void)
static void Send_CSQ(void)
int32_t east
in centimeters
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void gsm_init_report(void)
#define STATUS_WAITING_DATA
Device independent GPS code (interface)
struct pprz_autopilot autopilot
Global autopilot structure.
static void gsm_got_prompt(void)
uint16_t gspeed
norm of 2d ground speed in cm/s
#define GSMLinkChAvailable()
static void Send_CPMS(void)
static void request_for_msg(void)
#define STATUS_REQUESTING_MESSAGE
struct UtmCoor_i utm_pos
position in UTM (north,east: cm; alt: mm over MSL)
arch independent LED (Light Emitting Diodes) API
Common code for AP and FBW telemetry.
static bool prompt_received
#define STATUS_WAITING_PROMPT
static void Send_CNMI(void)
static uint8_t gsm_buf_len
static void Suppr_SMS(int)
int32_t hmsl
height above mean sea level (MSL) in mm
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 uint8_t gsm_buf_idx
struct Electrical electrical
static void Send_CMGF(void)
static void gsm_parse(uint8_t c)
static void Send(const char string[])
struct GpsState gps
global GPS state
static uint8_t gcs_index_max
void nav_goto_block(uint8_t b)
static uint8_t gsm_status
static bool gsm_line_received
static void gsm_send_report_continue(void)