13 #define AT_uart huart1
14 #define debug_uart huart2
23 #define GREEN_LED GPIO_PIN_13
27 #define RX_TIMEOUT 1000
28 #define TX_TIMEOUT 100
29 #define BAUD_RATE 38400
30 #define RX_BUFFER_LENGTH 256
31 #define SIM_UART huart2
32 #define DEBUG_UART huart1
33 #define TCP_CONNECT_TIMEOUT 5
34 #define GPS_COORDINATES_LENGTH 23
93 uint8_t
send_AT_cmd(
const char * cmd,
const char * expected_reply, uint8_t save_reply,
char * cmd_reply, uint32_t rx_timeout);
100 uint8_t
send_serial_data(uint8_t * data, uint8_t length,
char * cmd_reply, uint32_t rx_wait);
110 uint8_t
is_subarray_present(
const uint8_t *array,
size_t array_len,
const uint8_t *subarray,
size_t subarray_len);
uint8_t sim_init(SIM808_typedef *sim)
it initialises the SIM808_typedef struct members and powers on the module. initializes the UARTs and ...
Definition: sim808.c:57
uint16_t status_pin
Definition: sim808.h:56
uint8_t is_subarray_present(const uint8_t *array, size_t array_len, const uint8_t *subarray, size_t subarray_len)
Definition: sim808.c:262
GPIO_TypeDef * status_gpio
Definition: sim808.h:55
uint16_t power_on_pin
Definition: sim808.h:52
GPIO_TypeDef * reset_gpio
Definition: sim808.h:53
void system_reset(SIM808_typedef *sim)
power_off the module and reset the MCU
Definition: sim808.c:213
void send_raw_debug(uint8_t *debug_dump, uint8_t length)
Definition: sim808.c:30
uint16_t reset_pin
Definition: sim808.h:54
uint8_t send_AT_cmd(const char *cmd, const char *expected_reply, uint8_t save_reply, char *cmd_reply, uint32_t rx_timeout)
sends a cmd to the module, if the parameter save_reply == 1 then it copies the reply into the paramet...
Definition: sim808.c:220
is used to abstract the SIM808 hardware interface. It will decouple the functions from the hardware (...
Definition: sim808.h:48
uint8_t send_serial_data(uint8_t *data, uint8_t length, char *cmd_reply, uint32_t rx_timeout)
sends raw serial data to the SIM808 module through the AT_uart peripheral. Then it deletes the receiv...
Definition: sim808.c:286
USART_TypeDef * AT_uart_instance
Definition: sim808.h:49
void send_debug(const char *debug_msg)
sends a debug message through the debug UART
Definition: sim808.c:22
GPIO_TypeDef * power_on_gpio
Definition: sim808.h:51
uint8_t sim_power_off(SIM808_typedef *sim)
power_off the module.
Definition: sim808.c:180
USART_TypeDef * debug_uart_instance
Definition: sim808.h:50