Digi XBee(R) ANSI C Host Library
Files | Data Structures | Macros | Functions
Frames: Cellular SMS (0x1F, 0x9F)

Files

file  sms.h
 
file  xbee_sms.c
 

Data Structures

struct  xbee_frame_transmit_sms_t
 Format of XBee API frame type 0x1F (XBEE_FRAME_TRANSMIT_SMS); sent from host to XBee. More...
 
struct  xbee_frame_receive_sms_t
 Format of XBee API frame type 0x9F (XBEE_FRAME_RECEIVE_SMS); received from XBee by host. More...
 
struct  xbee_header_transmit_sms_t
 < XBEE_FRAME_TRANSMIT_SMS (0x1F) More...
 

Macros

#define XBEE_FRAME_TRANSMIT_SMS   0x1F
 Transmit an SMS message. [Cellular].
 
#define XBEE_FRAME_RECEIVE_SMS   0x9F
 Sent upon receiving an SMS message. [Cellular].
 
#define XBEE_SMS_MAX_PHONE_LENGTH   20
 
#define XBEE_SMS_MAX_MESSAGE_LENGTH   160
 
#define XBEE_SMS_SEND_OPT_NO_STATUS   0x8000
 

Functions

int xbee_sms_send (xbee_dev_t *xbee, const char *phone, const char *message, uint16_t options)
 Send an SMS message. More...
 
int xbee_sms_receive_dump (xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context)
 Dump received SMS message to stdout. More...
 

Detailed Description

Function Documentation

int xbee_sms_receive_dump ( xbee_dev_t xbee,
const void FAR raw,
uint16_t  length,
void FAR context 
)

Dump received SMS message to stdout.

This is a sample frame handler that simply prints received SMS messages to the screen. Include it in your frame handler table as:

{ XBEE_FRAME_RECEIVE_SMS, 0, xbee_sms_receive_dump, NULL }

See the function help for xbee_frame_handler_fn() for full documentation on this function's API.

References FAR.

int xbee_sms_send ( xbee_dev_t xbee,
const char *  phone,
const char *  message,
uint16_t  options 
)

Send an SMS message.

Parameters
[in]xbeeXBee device sending the message
[in]phoneTarget phone number, a null-terminated string whose length is at most XBEE_SMS_MAX_PHONE_LENGTH (not including the terminating null character).
[in]messageMessage to send, null-terminated string limited to a length of XBEE_SMS_MAX_MESSAGE_LENGTH characters.
[in]optionsBitmask of frame options. XBEE_SMS_SEND_OPT_NO_STATUS - disable TX Status frame
Return values
0Message sent with XBEE_SMS_SEND_OPT_NO_STATUS.
>0Frame ID of message, to correlate with Transmit Status frame received from XBee module.
-EINVALInvalid parameter passed to function.
-E2BIGEither phone or message too big for frame.

References E2BIG, EINVAL, XBEE_FRAME_TRANSMIT_SMS, xbee_frame_write(), and xbee_next_frame_id().