Open Sint
3.4-2
|
cellular phone functions More...
#include "uart.h"
Go to the source code of this file.
Macros | |
#define | PHONE_PORT PORTB |
which port has the power ON switch. | |
#define | PHONE_ON PB0 |
which pin is the power ON. | |
#define | MODEM_USART_PORT 0 |
on which USART port is the modem connected. | |
Functions | |
void | phone_send (const char *s) |
the cellular phone. More... | |
void | phone_init (void) |
initialize the serial port connected to the phone. More... | |
uint8_t | phone_on (void) |
power up the phone. More... | |
uint8_t | phone_msg (char *s) |
check for a message from the phone. More... | |
void | phone_answer (void) |
answer the call | |
void | phone_hangup (void) |
drop the call | |
uint8_t | phone_waitfor (const char *s, const uint8_t locked) |
Wait for string from the modem. More... | |
cellular phone functions
Command sent to the modem MUST be terminated with '' char and not '
'.
void phone_init | ( | void | ) |
initialize the serial port connected to the phone.
and allocate the RXTX struct buffer.
uint8_t phone_msg | ( | char * | s | ) |
check for a message from the phone.
s | pre-allocated string space. |
uint8_t phone_on | ( | void | ) |
power up the phone.
void phone_send | ( | const char * | s | ) |
the cellular phone.
if a fixed cellular operator must be used then uncomment below and change the operator's code example with I_WIND code: 22288 "at+cops=1,2,22288\r"
file cell.c
send the string to the phone.
uint8_t phone_waitfor | ( | const char * | s, |
const uint8_t | locked | ||
) |
Wait for string from the modem.
Used to wait a specific string from the modem in a locked or tmout way. For example used after sending an AT command to the modem and wait for the OK string. In a non-locked case, the waitfor will be 50*100msec long.
s | the string to wait for. |
locked | if locked, wait forever. |
the string s should be checked not to be larger than the allocated RX buffer size or this function will always fail.
delay 100msec to wait for a new message should be releated to the serial speed.