wireless_send.c File Reference

Wireless library send functions. More...

#include "wl_defs.h"
#include "wireless.h"
#include "xbee.h"
#include <string.h>

Functions

void setack (uint8_t num, uint8_t val)
void ackhandle (uint8_t num, uint8_t val)
int8_t send_buf_add (uint8_t *ptr, uint8_t byte)
uint8_t send_buf_get (uint8_t *ptr)
int16_t wl_send (uint8_t *data, uint8_t length, uint8_t group, uint8_t scope, uint16_t dest, uint8_t mode)
 The core send function. This will take all possible arguments and send all types of packets.
int16_t wl_send_global (uint8_t *data, uint8_t length, uint8_t group)
 Wrapper for core send function that will send a global packet across the current channel.
int16_t wl_send_pan (uint8_t *data, uint8_t length, uint8_t group)
 Wrapper for core send function that will send a packet across the current channel on the current pan.
int16_t wl_send_robot (uint8_t *data, uint8_t length, uint8_t group, uint16_t dest, uint8_t mode)
 Wrapper for core send function that will send a packet across the current channel to a specific robot.
int16_t wl_send_basic (uint8_t *data, uint8_t length)
 Default (i.e. basic) send wrapper.
uint8_t wl_ack_error (void)
 Returns the number of acknowledgment errors.
int8_t wl_ack_check (uint8_t packet)
 Checks a specific packet for the acknowledgement status.
void wl_ack_reset (void)
 Resets acknowledgement statistics back to zero.

Variables

uint8_t nextframe = 1
uint8_t ack_buf [64]
uint8_t send_buf [PACKET_BUFFER_SIZE]
uint8_t send_buf_first = 0
uint8_t send_buf_last = 0
uint8_t send_buf_num_packets = 0

Detailed Description

Wireless library send functions.

Copyright (c) 2009 Colony Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Implementation of high level wireless communication. This is the send functions portion of the library.

Author:
Colony Project, CMU Robotics Club

Variable Documentation

uint8_t nextframe = 1

Definition for wireless library send packet structure byte 1: length of packet (from frame number to end of data) byte 2: frame number bytes 3-n: data (dest, options, frame number, group code, packet) byte n+1: num retries

Definition for ack buffer 2 bit system: 0=still sending 1=OK 2=ack failure 3=CCA failure

Referenced by wl_send().

Generated on Thu May 6 13:17:00 2010 for libwireless by  doxygen 1.6.3